Skip to contents

R6 class for a collection of normal-block models with different number of clusters (q) and a fixed sparsity level.

Super classes

NormalBlockCollection -> NormalBlockCollectionClusters -> NormalBlockVarCollectionClusters

Active bindings

who_am_I

a method to print what model is being fitted

Methods

Inherited methods


NormalBlockVarCollectionClusters$new()

Create a new [`NormalBlockVarCollectionClusters`] object.

Usage

NormalBlockVarCollectionClusters$new(
  mydata,
  q_list,
  zero_inflation = FALSE,
  sparsity = 0,
  control = NB_control()
)

Arguments

mydata

object of NormalBlockData class, with responses and design matrix

q_list

list of q values (number of groups) in the collection

zero_inflation

whether the models in the collection should be zero-inflated or not

sparsity

sparsity penalty on the network density

control

structured list of more specific parameters, to generate with NB_control

Returns

A new [`NormalBlockVarCollectionClusters`] object


NormalBlockVarCollectionClusters$clone()

The objects of this class are cloneable with this method.

Usage

NormalBlockVarCollectionClusters$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

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