An R
package for automatically selecting which principal components to keep for detecting changes in the mean and/or covariance matrix. The choice of principal axes to project data onto is tailored to a normal state covariance matrix and a customizable distribution over relevant change scenarios. Functionality for both regular PCA and dynamic PCA exists.
Functionality:
TPCA is designed to be used in for instance high-dimensional sensor network applications, where changes in the mean and/or covariance matrix indicates a system fault. TPCA helps reduce the dimension to those principal components that are most sensitive to the relevant changes. This both saves computation and can increase the precision or speed with which changes are detected.
From inside R
, use the following command:
# install.packages("devtools")
devtools::install_github("NeymanPearsonFan1/tpca")
# library(tpca)
library(tpca)
cor_mat <- rcor_mat(10) # Generate random correlation matrix.
tpca_obj <- tpca(cor_mat, change_distr = 'semisparse_uniform', cutoff = 0.99)
ggplot_types(tpca_obj)
ggplot_sparsities(tpca_obj)
ggplot_prop(tpca_obj)
summary(tpca_obj)
#> Probability of projection j being the most sensitive (the projections are ordered decreasingly w.r.t variance):
#> j = 1 j = 2 j = 3 j = 4 j = 5 j = 6 j = 7 j = 8 j = 9 j = 10
#> 0.000 0.000 0.001 0.001 0.002 0.002 0.009 0.005 0.060 0.920
#>
#> Chosen axes/projections in decreasing order of sensitivity:
#> 10 9 7 8
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.