genpca {GeoXp} | R Documentation |
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.
genpca(data, w = rep(1/nrow(data), length = nrow(data)), m = diag(1, ncol(data), ncol(data)), center = TRUE, reduc = TRUE)
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) |
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_nbar{x}'
Standart deviation :
(σ^j)^2=sum_iw_i(x_i^j)^2-(bar{x^j})^2
Σ=diag((σ^1)^2,...,(σ^p)^2)'
If reduc=True :
x_{cr}=x_c times Σ^{-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(λ_1,...,λ_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
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 p$ (corresponding to matrix $VC$).
Thomas-Agnan C., Aragon Y., Ruiz-Gazen A., Laurent T., Robidou L.
Aragon Yves, Perrin Olivier, Ruiz-Gazen Anne, Thomas-Agnan Christine (2008), ``Statistique et Econométrie pour données géoréférencées : modèles et études de cas''
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.