Collection of Normal-Block-Mean Models over a Range of Cluster Counts
Source:R/NormalBlockMeanCollectionClusters.R
NormalBlockMeanCollectionClusters.RdR6 class for a collection of mean-block models (NormalBlockMeanBase) with different numbers of clusters (q). As for NormalBlockVarCollectionClusters, the q-independent part of the initial clustering heuristic is computed once for the whole collection.
Super classes
NormalBlockCollection -> NormalBlockCollectionClusters -> NormalBlockMeanCollectionClusters
Methods
Inherited methods
NormalBlockCollection$summary()NormalBlockCollectionClusters$get_best_model()NormalBlockCollectionClusters$get_model()NormalBlockCollectionClusters$initialize()NormalBlockCollectionClusters$optimize()NormalBlockCollectionClusters$plot()NormalBlockCollectionClusters$print()NormalBlockCollectionClusters$refine()
Examples
ex <- generate_normal_block_mean_data(n = 50, p = 20, d = 1, q = 3)
data <- NormalBlockData$new(ex$Y, ex$X)
models <- normal_block(data, blocks = 2:5, model = "mean")
#> Fitting a collection of diagonal normal-block-mean models over q
#> refine(): improved 3 of 4 models
#>
#> DONE
plot(models, criteria = c("BIC", "ICL"))
models$get_best_model()
#> A diagonal normal-block-mean model with 3 unknown clusters.
#> ===========================================================================
#> nb_param q n_edges sparsity loglik deviance BIC ICL EBIC
#> 25 3 0 0 -1984.862 3969.724 4074.679 4077.595 4074.679
#> niter
#> 1
#> ===========================================================================
#> * 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()