39 mat coeff, score, percent_variance;
41 princomp(coeff, score, latent, tsquared, spectra.t());
42 double eigenvalue_sum = sum(latent);
43 percent_variance = latent / eigenvalue_sum;
44 percent_variance /= 0.01;
45 vec cumulative = cumsum(percent_variance);
46 percent_variance = join_horiz(percent_variance, cumulative);
51 AddMatrix(
"Percent Variance", percent_variance);
void Apply(const mat &spectra)
PrincipalComponentsData::Apply.
void AddMatrix(const QString &key, const mat &value, QStringList column_headings=QStringList())
The AnalysisResults class A container for a mat object that allows a mat to be copied to a heap-alloc...
PrincipalComponentsData(QString name)
PrincipalComponentsData::PrincipalComponentsData.