Learn R Programming

amap (version 0.2-5)

acpgen: Generalised principal component analysis

Description

Generalised principal component analysis / Analyse en composantes principales g�n�ralis�e

Usage

acpgen(x,h1,h2,center=TRUE,reduce=TRUE,kernel="gaussien")
K(u,kernel="gaussien")
W(x,h,D=NULL,kernel="gaussien")
WsansC(x,h,D=NULL,kernel="gaussien")

Arguments

Value

An object of class acp The object is a list with components:sdevthe standard deviations of the principal components.loadingsthe matrix of variable loadings (i.e., a matrix whose columns contain the eigenvectors). This is of class "loadings": see loadings for its print method.scoresif scores = TRUE, the scores of the supplied data on the principal components.eigEigen values

Details

acpgen compute generalised pca. i.e. spectral analysis of $U_n . W_n^{-1}$, and project $X_i$ with $W_n^{-1}$ on the principal vector sub-spaces.

$X_i$ a column vector of $p$ variables of individu $i$ (input data)

W compute estimation of noise in the variance. $$W_n=\frac{\sum_{i=1}^{n-1}\sum_{j=i+1}^{n}K(||X_i-X_j||_{V_n^{-1}}/h)(X_i-X_j)(X_i-X_j)'}{\sum_{i=1}^{n-1}\sum_{j=i+1}^{n}K(||X_i-X_j||_{V_n^{-1}}/h)}$$

with $V_n$ variance estimation;

U compute robust variance. $U_n^{-1} = S_n^{-1} - 1/h V_n^{-1}$

$$S_n=\frac{\sum_{i=1}^{n}K(||X_i||_{V_n^{-1}}/h)(X_i-\mu_n)(X_i-\mu_n)'}{\sum_{i=1}^nK(||X_i||_{V_n^{-1}}/h)}$$

with $\mu_n$ estimator of the mean. K compute kernel, i.e.

gaussien: $$\frac{1}{\sqrt{2\pi}} e^{-u^2/2}$$

quartic: $$\frac{15}{16}(1-u^2)^2 I_{|u|\leq 1}$$

triweight: $$\frac{35}{32}(1-u^2)^3 I_{|u|\leq 1}$$

epanechikov: $$\frac{3}{4}(1-u^2) I_{|u|\leq 1}$$

cosinus: $$\frac{\pi}{4}\cos(\frac{\pi}{2}u) I_{|u|\leq 1}$$

References

H. Caussinus, S. Hakam, A. Ruiz-Gazen Projections r�v�latrices contr�l�es: groupements et structures diverses. 2002, to appear in Rev. Statist. Appli.

See Also

acp acprob princomp

Examples

Run this code
data(lubisch)
lubisch <- lubisch[,-c(1,8)]
p <- acpgen(lubisch,h1=1,h2=1/sqrt(2))
plot(p,main='ACP robuste des individus')

# See difference with acp

p <- acp(lubisch)
plot(p)

# Other Data
.Random.seed <- c(1,  416884367 ,1051235439)
n <- 100   # Number of observations
m <- 0     # Mean of 1 group
temp <- cbind(rnorm(n,m,1),rnorm(n,0,10))
m <- 10
mat <- rbind(temp,cbind(rnorm(n,m,1),rnorm(n,0,10)))
mat <- scale(mat,TRUE,TRUE)
rm (m,n,temp)

Run the code above in your browser using DataLab