genpca: Generalized Principal Component Analysis (PCA)

View source: R/genpca.R

genpcaR Documentation

Generalized Principal Component Analysis (PCA)

Description

The function genpca computes a generalized Principal Component Analysis (PCA). It calculates the principal components, the coordinates of the variables and in these principals components axes and the inertia of these principal components.

Usage

genpca(data, w = rep(1/nrow(data), length = nrow(data)), 
 m = diag(ncol(data)), center = NULL, reduc = TRUE)

Arguments

data

matrix n \times p

w

vector of size n of weight (by default : weight=t(1/n,...,1/n))

m

matrix p \times p (by default : metric=Identity matrix)

center

boolean. if TRUE, centered PCA (by default : center=TRUE)

reduc

boolean. if TRUE, reduced PCA (by default : reduce=TRUE)

Details

Let

W=diag(w)

x=data=(x_1',...,x_n')'

with

x_i=(x_i^1,...,x_i^p)


Let

1_n=(1,...,1)'

with n rows and :

1_p=(1,...,1)'

with p rows. Normalization of weight :

w_i=\frac{w_i}{\sum_iw_i}

Vector of means :

\bar{x}=(\bar{x^1},...,\bar{x^p})'

with:

\bar{x^j}=\sum_iw_ix_i^j


If center=True,

x_c=x-1_n\bar{x}'

Standart deviation :

(\sigma^j)^2=\sum_iw_i(x_i^j)^2-(\bar{x^j})^2

\Sigma=diag((\sigma^1)^2,...,(\sigma^p)^2)'

If reduc=True :

x_{cr}=x_c \times \Sigma^{-1/2}

Variance-Covariance matrix:

C=x_{cr}'Wx_{cr}

Cholesky decomposition : M=LL' where M=m
Let

C_l=LCL'

Let U and D as :

C_lU=UD

with D=diag(\lambda_1,...,\lambda_p)
Let

V=L'U


Then :
Coordinates of individuals in the principals components basis :

CC=x_{cr}V

Coordinates of variables in principals components :

VC=CVD^{-1/2}

Inertia :

I=D1_p

Value

Returns ‘inertia’ vector of size p with percent of inertia of each component (corresponding to I), ‘casecoord’ matrix n \times p (corresponding to matrix CC), ‘varcoord’ matrix p \times n (corresponding to matrix VC0).

Author(s)

Thomas-Agnan C., Aragon Y., Ruiz-Gazen A., Laurent T., Robidou L.

References

Thibault Laurent, Anne Ruiz-Gazen, Christine Thomas-Agnan (2012), GeoXp: An R Package for Exploratory Spatial Data Analysis. Journal of Statistical Software, 47(2), 1-23.

Caussinus H., Fekri M., Hakam S., Ruiz-Gazen A. (2003) , A monitoring display of Multivariate Outliers, Computational Statistics and Data Analysis, vol. 44, 1-2, 237-252.

See Also

clustermap,pcamap


tibo31/GeoXp documentation built on April 8, 2023, 7:50 a.m.