Collection of Mean-Block Models over a Sparsity Path
Source:R/NormalBlockMeanCollectionSparsity.R
NormalBlockMeanCollectionSparsity.RdR6 class for a collection of mean-block models ([NormalBlockMeanBase]) with a fixed clustering (or a fixed number of blocks) and different sparsity levels applied to the p x p precision matrix of the variables. Mirrors [NormalBlockVarCollectionSparsity], minus the StARS/stability selection path, which relies on `fixed_tau`, not supported by the mean-block VEM.
Super classes
NormalBlockCollection -> NormalBlockCollectionSparsity -> NormalBlockMeanCollectionSparsity
Methods
NormalBlockMeanCollectionSparsity$new()
Create a new [`NormalBlockMeanCollectionSparsity`] object.
Usage
NormalBlockMeanCollectionSparsity$new(mydata, blocks, control = NB_control())NormalBlockMeanCollectionSparsity$get_best_model()
Extract best model in the collection
Usage
NormalBlockMeanCollectionSparsity$get_best_model(
crit = c("BIC", "EBIC", "ICL")
)Examples
ex <- generate_normal_block_mean_data(n = 60, p = 20, d = 1, q = 3)
data <- NormalBlockData$new(ex$Y, ex$X)
models <- normal_block(data, blocks = 3, sparsity = TRUE, model = "mean",
control = NB_control(n_sparsity_penalties = 5))
#> Fitting a normal-block-mean model with sparsity path
#> penalty = 0.3489394
penalty = 0.1103443
penalty = 0.03489394
penalty = 0.01103443
penalty = 0.003489394
#> DONE
models$plot(c("BIC", "EBIC"))