| NormalBlockCollectionSparsity | R Documentation |
Shared scaffolding for NormalBlockVarCollectionSparsity and
NormalBlockMeanCollectionSparsity: the penalty grid, the warm-started
path traversal, the penalty lookup and the criteria plot. Model selection,
StARS included (stability selection, Liu et al. 2010), is shared: a family
only says on which covariance estimate the default penalty grid is read
(private$penalty_scale()), how to refit its path on a subsample with the
clustering held fixed (private$subsample_path()) and how to name the
nodes of its network (private$network_nodes()).
NormalBlockCollection -> NormalBlockCollectionSparsity
dataobject of NormalBlockData class, with responses and design matrix
sparsity_detailsnumber, range and ratio of the penalties of the path
qnumber of blocks
blocksgroup matrix or number of blocks
sparsitylist of sparsity penalties
criteriaa data frame with the criteria of every model of the
path, plus its StARS stability once stability_selection() has run
stability_pathselection probability of every edge at every
penalty (StARS), NULL until stability_selection() has run
stabilitymean edge stability along the penalty path,
1 - mean(4 p (1 - p)) over the edges; NA until
stability_selection() has run
NormalBlockCollectionSparsity$new()Create a collection over a path of sparsity penalties.
By default, control$n_sparsity_penalties values on a log scale, from
the largest absolute (weighted) entry of a covariance estimate, which
removes every edge, down to control$min_ratio times it.
NormalBlockCollectionSparsity$new( mydata, blocks, zero_inflation = FALSE, control = NB_control() )
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_inflationwhether the models of the path are zero-inflated
controlstructured list of parameters to handle sparsity control
A new collection object
NormalBlockCollectionSparsity$optimize()optimizes every model in the sparsity path, warm-starting
each one (after the first) from the previous, adjacent penalty's
converged parameters (see the family's base class's warm_start_from())
instead of re-deriving everything from the heuristic clustering, the
way the generic NormalBlockCollection 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.
NormalBlockCollectionSparsity$optimize( control = list(niter = 500, threshold = 1e-04, verbose = TRUE) )
controloptimization parameters (niter and threshold)
NormalBlockCollectionSparsity$get_model()returns the NormalBlockVarKnownClusters model corresponding to given penalty
NormalBlockCollectionSparsity$get_model(sparsity)
sparsitysparsity penalty asked by user
A NormalBlockVarKnownClusters (sparse) object with given value penalty
NormalBlockCollectionSparsity$get_best_model()Extract best model in the collection
NormalBlockCollectionSparsity$get_best_model(
crit = c("BIC", "EBIC", "ICL", "StARS"),
stability = 0.9
)
crita character for the criterion used to perform the selection: "BIC" (default), "EBIC", "ICL" or "StARS".
stabilityif crit = "StARS", the level of stability required.
a model of the collection's family
NormalBlockCollectionSparsity$stability_selection()Computes the stability path (StARS, Liu et al. 2010): the penalty path is refitted on subsamples of the observations, with the clustering held fixed, and the selection frequency of each edge is recorded at every penalty.
NormalBlockCollectionSparsity$stability_selection( subsamples = NULL, n_subsamples = 10 )
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 10 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
NormalBlockCollectionSparsity$plot()Plot the criteria of the models of the path against the
penalty, with a dashed line at the penalty selected by each criterion
(see also plot.NormalBlockCollection()).
NormalBlockCollectionSparsity$plot(
criteria = c("deviance", "BIC", "EBIC", "ICL"),
log.x = TRUE
)
criteriathe criteria to plot, among "deviance", "BIC",
"EBIC" and "ICL"; all of them by default.
log.xlogical: should the x-axis be represented in log-scale? Default is TRUE.
a ggplot2::ggplot graph
NormalBlockCollectionSparsity$clone()The objects of this class are cloneable with this method.
NormalBlockCollectionSparsity$clone(deep = FALSE)
deepWhether to make a deep clone.
# An internal abstract base class, never instantiated directly -- see
# normal_block() for how collections are created and fitted.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.