CSM PCA


Performs Principal Component Analysis on matrix X.

Utilises the JTPcrossValidatedPCA. Cross Validates a JTPpca model.

Calculates residuals and DModX values. Can be used as input for

csm_plot_pca.

Usage

model = csm_pca ( spectra, npc );

model = csm_pca ( spectra, npc, 'prep', prep );

Arguments (* = required)

VariableTypeDefault ValueDescription
*spectracsm_spectraNonecsm_spectra object containing spectral matrix.
*npc1*1NoneNumber of components to be computed.
prepstr'none'Preprocessing type; 'mc' for mean centering, 'uv' for univariance Scaling, 'par' for Paretto Scaling

Returns

VariableTypeDescription
csm_pcacsm_wrapperObject with some stored inputs, the outputs and auditInfo.
csm_pca.output.Pm*nMatrix of Loadings, components*loadings.
csm_pca.output.Tm*nMatrix of scores, scores*components.
csm_pca.output.Tcvm*nMatrix of cross validated scores, scores*components.
csm_pca.output.Xrm*1Model residuals, residuals*1.
csm_pca.output.R2m*1Modeled variation, componentvariance*1.
csm_pca.output.Q2m*1Cross-validated modeled variation, componentvariance*1.
csm_pca.output.ns1*1Number of samples.
csm_pca.output.Residualm*1Summed residuals for each sample.
csm_pca.output.TotalResidual1*1Summed residuals for all samples.
csm_pca.output.DModXm*1Distance from model for each sample.
csm_pca.output.Dcrit1*1Critical value for DModX.

Reference

NIPALS

Copyright Imperial College London 2019