prcompReconError: Principal components reconstruction error

Description Usage Arguments Value Examples

View source: R/pca_addson.R

Description

Return the squared reconstruction error from using a subset of principal components.

Usage

1

Arguments

object

an object returned by 'prcomp' function.

data

the original data matrix

...

additional arguments to be passed to the low level functions.

Value

A data frame containing the reconstruction error (RE), the mean square error (MSE), and the R^2 for increasing value of principal components.

Examples

1
2
3
PCA = prcomp(iris[,1:4])
df = prcompReconError(PCA, iris[,1:4])
zapsmall(df,5)

luca-scr/smef documentation built on Feb. 22, 2022, 8:32 p.m.