Skip to contents

R6 class for a collection of mean-block models (NormalBlockMeanBase) over both a range of cluster counts (q) and a sparsity path, i.e. one NormalBlockMeanCollectionSparsity per q. Mirrors NormalBlockVarCollectionClustersSparsity.

Super classes

NormalBlockCollection -> NormalBlockCollectionClustersSparsity -> NormalBlockMeanCollectionClustersSparsity

Methods

Inherited methods


NormalBlockMeanCollectionClustersSparsity$clone()

The objects of this class are cloneable with this method.

Usage

NormalBlockMeanCollectionClustersSparsity$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

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 = 2:4, sparsity = TRUE, model = "mean",
                       control = NB_control(n_sparsity_penalties = 4))
#> Fitting a collection of full normal-block-mean models over q and sparsity penalties 
#> 
#> DONE
plot(models, criterion = "BIC")

models$get_best_model("BIC")
#> A full normal-block-mean model with 3 unknown clusters.
#> ===========================================================================
#>  nb_param q n_edges sparsity    loglik deviance      BIC      ICL     EBIC
#>        86 3      61    0.844 -2236.571 4473.143 4832.046 4833.154 5197.526
#>  niter
#>      7
#> ===========================================================================
#> * Useful fields
#>     $model_par, $posterior_par / $var_par, $clustering 
#>     $loglik, $BIC, $ICL, $objective, $nb_param, $criteria
#> * Useful S3 methods
#>     print(), summary(), plot(), coef(), sigma(), fitted(), predict()