pcame {SCOUTer} | R Documentation |
pcame
Description
Projection of X onto a Principal Component Analysis (PCA) model.
Usage
pcame(X, pcaref)
Arguments
X |
Matrix with observations that will be projected onto the PCA model. |
pcaref |
A list with the elemements of a PCA model:
|
Details
pcame
performs the projection of the data in X onto the PCA model stored as a
list of parameters. It returns the projection of the observations in X, along with the
Squared Prediction Errors (SPE), Hotelling's T^2_A, contribution elements and the
reconstruction of X obtained by the PCA model.
Value
list with elements containing information about X in the PCA model:
-
Xpreprocessed
: matrixX
preprocessed. -
Tscores
: score matrix with the projection ofX
on each one of the A PCs. -
E
: error matrix with the par ofX
not explained by the PCA model. -
SPE
: vector with the SPE for each observation ofX
. -
T2
: vector with the T^_A for each observation ofX
. -
T2matrix
: matrix with the contributions of each PC to the T^2_A for each observation ofX
. -
Xrec
: matrix with the reconstructed part ofX
, i.e. the part ofX
explained by the PCA model.
Examples
X <- as.matrix(X)
pcamodel.ref <- pcamb_classic(X, 3, 0.1, "autosc") # PCA-MB with all observations
pcame(X, pcamodel.ref) # Project all observations onto PCA model of pcamodel.ref
pcamodel.ref <- pcamb_classic(X[1:40,], 2, 0.05, "cent") # PCA-MB with first 40 observations
pcame(X[-c(1:40),], pcamodel.ref) # Project observations not used in PCA-MB onto PCA model
# of pcamodel.ref