Collection of Normal-Block Models over a Range of Cluster Counts
Source:R/NormalBlockVarCollectionClusters.R
NormalBlockVarCollectionClusters.RdR6 class for a collection of normal-block models with different number of clusters (q) and a fixed sparsity level.
Super classes
NormalBlockCollection -> NormalBlockCollectionClusters -> NormalBlockVarCollectionClusters
Methods
NormalBlockVarCollectionClusters$new()
Create a new [`NormalBlockVarCollectionClusters`] object.
Usage
NormalBlockVarCollectionClusters$new(
mydata,
q_list,
zero_inflation = FALSE,
sparsity = 0,
control = NB_control()
)Arguments
mydataobject of NormalBlockData class, with responses and design matrix
q_listlist of q values (number of groups) in the collection
zero_inflationwhether the models in the collection should be zero-inflated or not
sparsitysparsity penalty on the network density
controlstructured list of more specific parameters, to generate with NB_control
Examples
ex <- generate_normal_block_var_data(n = 50, p = 20, d = 1, q = 3)
data <- NormalBlockData$new(ex$Y, ex$X)
models <- normal_block(data, blocks = 2:4, control = NB_control(verbose = FALSE))
models$get_best_model("ICL")$q
#> [1] 4