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:

  • m: mean.

  • s: standard deviation.

  • prepro: preprocessing: "none", "cent" or "autosc".

  • P: loading matrix.

  • lambda: vector with variances of each PC.

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:

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

[Package SCOUTer version 1.0.0 Index]