Collection of Normal-Block Models over a Sparsity Path
Source:R/NormalBlockVarCollectionSparsity.R
NormalBlockVarCollectionSparsity.RdR6 class for a collection of normal-block models with a fixed clustering (blocks) and different sparsity levels.
Super class
NormalBlockVarCollection -> NormalBlockVarCollectionSparsity
Active bindings
qnumber of blocks
blocksgroup matrix or number of blocks.
sparsitylist of sparsity penalties
sparsity_detailslist of information about model's penalties
criteriaa data frame with the values of some criteria ((approximated) log-likelihood, BIC) for the collection of models
stability_pathmeasure of edges stability based on StARS method
stabilitymean edge stability along the sparsity penalties path
who_am_Ia method to print what model is being fitted
Methods
Inherited methods
NormalBlockVarCollectionSparsity$new()
Create a new [`NormalBlockVarCollectionSparsity`] object.
Usage
NormalBlockVarCollectionSparsity$new(
mydata,
blocks,
zero_inflation = FALSE,
control = NB_control()
)Arguments
mydataobject of NormalBlockData class, with responses and design matrix
blockseither a clustering matrix (known, fixed clustering) or a single integer (number of blocks to infer)
zero_inflationboolean to specify whether data is zero-inflated
controlstructured list of parameters to handle sparsity control
NormalBlockVarCollectionSparsity$optimize()
optimizes every model in the sparsity path, warm-starting each one (after the first) from the previous, adjacent penalty's converged parameters (see [NormalBlockVarBase]'s `warm_start_from()`) instead of re-deriving everything from the heuristic clustering, the way the generic [NormalBlockVarCollection] `optimize()` would. `blocks` (hence q) is fixed across the whole path, only the sparsity penalty changes, so the warm start is always between models of matching shape.
Usage
NormalBlockVarCollectionSparsity$optimize(
control = list(niter = 500, threshold = 1e-04, verbose = TRUE)
)NormalBlockVarCollectionSparsity$get_model()
returns the NormalBlockVarKnownClusters model corresponding to given penalty
NormalBlockVarCollectionSparsity$get_best_model()
Extract best model in the collection
Usage
NormalBlockVarCollectionSparsity$get_best_model(
crit = c("BIC", "EBIC", "ICL", "StARS"),
stability = 0.9
)NormalBlockVarCollectionSparsity$plot()
Display various outputs (goodness-of-fit criteria, robustness, diagnostic) associated with a collection of network fits (a [`Networkfamily`])
Usage
NormalBlockVarCollectionSparsity$plot(
criteria = c("deviance", "BIC", "EBIC", "ICL"),
log.x = TRUE
)NormalBlockVarCollectionSparsity$stability_selection()
Compute the stability path by stability selection
Arguments
subsamplesa list of vectors describing the subsamples. The number of vectors (or list length) determines the number of subsamples used in the stability selection. Automatically set to 20 subsamples with size `10*sqrt(n)` if `n >= 144` and `0.8*n` otherwise following Liu et al. (2010) recommendations.
n_subsamplesnumber of subsamples to create if the subsamples are not given