R6 class for normal-block model with unknown Q (number of groups)
Source:R/NB_changing_sparsity_collection_class.R
NB_changing_sparsity.Rd
R6 class for normal-block model with unknown Q (number of groups)
R6 class for normal-block model with unknown Q (number of groups)
Public fields
models
list of NB_fixed_Q models corresponding to each nb_block value
control
store the list of user-defined model settings and optimization parameters
data
object of NBData class, with responses and design matrix
Active bindings
Q
number of blocks
blocks
group matrix or number of blocks.
sparsity
list of sparsity penalties
sparsity_details
list of information about model's penalties
criteria
a data frame with the values of some criteria ((approximated) log-likelihood, BIC) for the collection of models
stability_path
measure of edges stability based on StARS method
stability
mean edge stability along the sparsity penalties path
who_am_I
a method to print what model is being fitted
Methods
Method new()
Create a new [`NB_changing_sparsity`] object.
Usage
NB_changing_sparsity$new(
mydata,
blocks,
zero_inflation = FALSE,
control = NB_control()
)
Method optimize()
optimizes a model for each penalty
Usage
NB_changing_sparsity$optimize(
control = list(niter = 100, threshold = 1e-04, verbose = TRUE)
)
Method get_model()
returns the NB_fixed_block model corresponding to given penalty
Method get_best_model()
Extract best model in the collection
Usage
NB_changing_sparsity$get_best_model(
crit = c("BIC", "EBIC", "ICL", "StARS"),
stability = 0.9
)
Method plot()
Display various outputs (goodness-of-fit criteria, robustness, diagnostic) associated with a collection of network fits (a [`Networkfamily`])
Usage
NB_changing_sparsity$plot(
criteria = c("deviance", "BIC", "EBIC", "ICL"),
log.x = TRUE
)
Method stability_selection()
Compute the stability path by stability selection
Arguments
subsamples
a 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_subsamples
number of subsamples to create if the subsamples are not given