moma_sfpca creates an SFPCA R6 object and returns it.

moma_spca is a function for performing one-way sparse PCA.

moma_twspca is a function for performing two-way sparse PCA.

moma_fpca is a function for performing one-way functional PCA.

moma_twfpca is a function for performing two-way functional PCA.

moma_sfpca(X, ..., center = TRUE, scale = FALSE,
  u_sparse = moma_empty(), v_sparse = moma_lasso(),
  u_smooth = moma_smoothness(), v_smooth = moma_smoothness(),
  pg_settings = moma_pg_settings(), max_bic_iter = 5, rank = 1,
  deflation_scheme = "PCA_Hotelling")

moma_spca(X, ..., center = TRUE, scale = FALSE,
  u_sparse = moma_empty(), v_sparse = moma_lasso(),
  pg_settings = moma_pg_settings(), max_bic_iter = 5, rank = 1,
  deflation_scheme = "PCA_Hotelling")

moma_twspca(X, ..., center = TRUE, scale = FALSE,
  u_sparse = moma_lasso(), v_sparse = moma_lasso(),
  pg_settings = moma_pg_settings(), max_bic_iter = 5, rank = 1,
  deflation_scheme = "PCA_Hotelling")

moma_fpca(X, ..., center = TRUE, scale = FALSE,
  u_smooth = moma_smoothness(), v_smooth = moma_smoothness(),
  pg_settings = moma_pg_settings(), max_bic_iter = 5, rank = 1,
  deflation_scheme = "PCA_Hotelling")

moma_twfpca(X, ..., center = TRUE, scale = FALSE,
  u_smooth = moma_smoothness(), v_smooth = moma_smoothness(),
  pg_settings = moma_pg_settings(), max_bic_iter = 5, rank = 1,
  deflation_scheme = "PCA_Hotelling")

Arguments

X

A data matrix, each row representing a sample, and each column a feature.

...

Force users to specify arguments by names.

center

A logical value indicating whether the variables should be shifted to be zero centered. Defaults to TRUE.

scale

A logical value indicating whether the variables should be scaled to have unit variance. Defaults to FALSE.

u_sparse, v_sparse

An object of class inheriting from "moma_sparsity_type". Most conveniently specified by functions described in moma_sparsity_options. It specifies the type of sparsity-inducing penalty function used in the model. Note that for moma_spca, these two parameters must not be specified at the same time. For moma_fpca and moma_twfpca, they must not be specified.

u_smooth, v_smooth

An object of class inheriting from "moma_smoothness_type". Most conveniently specified by functions described in moma_smoothness. It specifies the type of smoothness terms used in the model. Note that for moma_fpca, these two parameters must not be specified at the same time. For moma_spca and moma_twspca, they must not be specified.

pg_settings

An object of class inheriting from "moma_pg_settings". Most conviently specified by functions described in moma_pg_settings. It specifies the type of algorithm used to solve the problem, acceptable level of precision, and the maximum number of iterations allowed.

max_bic_iter

A positive integer. Defaults to 5. The maximum number of iterations allowed in nested greedy BIC selection scheme.

rank

A positive integer. Defaults to 1. The maximal rank, i.e., maximal number of principal components to be used.

deflation_scheme

A string specifying the deflation scheme. It should be one of "PCA_Hotelling", "PCA_Schur_Complement", "PCA_Projection".

In the discussion below, let \(u,v\) be the normalized vectors obtained by scaling the penalized singular vectors.

When deflation_scheme = "Hotelling_deflation" is specified, the following deflation scheme is used. \(\boldsymbol{X}_{t} :=\boldsymbol{X}_{t-1}-d_{t} \boldsymbol{u}_{t} \boldsymbol{v}_{t}^{T}\), where \(d_{t}=\boldsymbol{u}_{t}^{T} \boldsymbol{X}_{t-1} \boldsymbol{v}_{t}\).

When deflation_scheme = "PCA_Schur_Complement" is specified, the following deflation scheme is used: \(\boldsymbol{X}_{t} :=\left(\boldsymbol{I}_{n}- \boldsymbol{u}_{t} \boldsymbol{u}_{t}^{T}\right) \boldsymbol{X}_{t-1} \left(\boldsymbol{I}_{p}-\boldsymbol{v}_{t} \boldsymbol{v}_{t}^{T}\right)\).

When deflation_scheme = "PCA_Projection" is specified, the following deflation scheme is used: \(\boldsymbol{X}_{t} :=\boldsymbol{X}_{t-1}-\frac{\boldsymbol{X}_{t-1} \boldsymbol{v}_{t} \boldsymbol{u}_{t}^{T} \boldsymbol{X}_{t-1}}{\boldsymbol{u}_{t}^{T} \boldsymbol{X}_{t-1} \boldsymbol{v}_{t}}\).

Value

An R6 object which provides helper functions to access the results. See moma_R6.

Functions

  • moma_spca: a function for performing one-way sparse PCA

  • moma_twspca: a function for performing two-way sparse PCA

  • moma_fpca: a function for performing one-way functional PCA

  • moma_twfpca: a function for performing two-way functional PCA