princ {lazy.tools}R Documentation

Principal Component Analysis of Y with possible missing elements

Description

Principal Component Analysis of Y with possible missing elements

Usage

princ(Y, ndim = 1, estmu = 1, maxiter = 1000, eps = 1e-08, init = 1, print = 1)

Arguments

Y

matrix of n x p

ndim

# of dimensions: Must be less than or equal to p.

estmu

= 0 not to estimate mu (No standardization of Y)

maxiter

Maximum # of iterations for missing elements

eps

criterion for convergence

init

= 0 to use random number as the first estimate of missing
= 1 to use the gramd mean
= 2 to use the column mean

print

= 1 to print the result

Details

This function minimizes the following RSS
RSS = tr( ( Y - 1 mu' - F A')'( Y - 1 mu' - F A') )
where mu is the p x 1 vector,
F is the n x ndim orthonormal score matrix,
and A is the p x ndim matrix of loadings.

Value

A list of:
Yhat=1mu'-FA', F, A, mu, iter, eps, rmse=sqrt(RSS)

Examples

n <- 20; np <- 5;  pmiss <- 0.1
Y <- matrix( rnorm(n*np),n )
Y[which(matrix(runif(n*np),n,np) < pmiss)]=NA
princ(Y,2, print=10, estmu=1, init=1)

[Package lazy.tools version 0.1.6 ]