pcamb_classic: pcamb_classic

Description Usage Arguments Value Examples

View source: R/pcamb_classic.R

Description

Principal Component Analysis (PCA) model fitting according to a matrix X using singular value decomposition (svd)

Usage

1
pcamb_classic(X, ncomp, alpha, prepro)

Arguments

X

Matrix with observations that will used to fit the PCA model.

ncomp

An integer indicating the number of PCs that the model will have.

alpha

A number between 0 and 1 indicating the type I risk assumed to calculate the Upper Control Limits (UCLs) for the Squared Prediction Error (SPE), the Hotelling's T^2_A and the scores. The confidence level of these limits will be (1-alpha)*100.

prepro

A string indicating the preprocessing to be performed on X. Its possible values are: "none", for any preprocessing, "cent", for a mean-centering, or "autosc", for a mean-centering and unitary variance scaling (autoscaling).

Value

list with elements containing information about PCA model:

Examples

1
2
3
4
X <- as.matrix(X)
pcamodel.ref <- pcamb_classic(X, 3, 0.1, "autosc") # PCA-MB with all observations
pcamodel.ref <- pcamb_classic(X[1:40,], 2, 0.05, "cent") # PCA-MB with first 40 
# observations

SCOUTer documentation built on July 1, 2020, 6:27 p.m.