
An R6 Class to virtually represent a collection of network fits
Source:R/PLNnetworkfamily-class.R
Networkfamily.RdThe functions PLNnetwork() and ZIPLNnetwork() both produce an instance of this class, which can be thought of as a vector of PLNnetworkfits ZIPLNfit_sparses (indexed by penalty parameter)
This class comes with a set of methods mostly used to compare
network fits (in terms of goodness of fit) or extract one from
the family (based on penalty parameter and/or goodness of it).
See the documentation for getBestModel(),
getModel() and plot() for the user-facing ones.
See also
The functions PLNnetwork(), ZIPLNnetwork() and the classes PLNnetworkfit, ZIPLNfit_sparse
Super class
PLNfamily -> Networkfamily
Active bindings
penaltiesthe sparsity level of the network in the successively fitted models
stability_paththe stability path of each edge as returned by the stars procedure
stabilitymean edge stability along the penalty path
ebic_gammathe tuning parameter gamma of the EBIC, between 0 and 1, shared by every fit of the collection. Zero gives back the BIC; the default 0.5 is the value recommended by Foygel and Drton (2010). Assign to it to change the EBIC of the whole collection, and hence the model selected by
getBestModel("EBIC").criteriaa data frame with the values of some criteria (variational log-likelihood, (E)BIC, ICL and R2, stability) for the collection of models / fits BIC, ICL and EBIC are defined so that they are on the same scale as the model log-likelihood, i.e. with the form, loglik - 0.5 penalty
Methods
Inherited methods
Networkfamily$new()
Initialize all models in the collection
Usage
Networkfamily$new(penalties, data, control)Networkfamily$getBestModel()
Extract the best network in the family according to some criteria
Usage
Networkfamily$getBestModel(crit = c("BIC", "EBIC", "StARS"), stability = 0.9)Networkfamily$plot()
Display various outputs (goodness-of-fit criteria, robustness, diagnostic) associated with a collection of network fits (a Networkfamily)
Usage
Networkfamily$plot(
criteria = c("loglik", "pen_loglik", "BIC", "EBIC"),
reverse = FALSE,
log.x = TRUE
)Arguments
criteriavector of characters. The criteria to plot in
c("loglik", "pen_loglik", "BIC", "EBIC"). Defaults to all of them.reverseA logical indicating whether to plot the value of the criteria in the "natural" direction (loglik - 0.5 penalty) or in the "reverse" direction (-2 loglik + penalty). Default to FALSE, i.e use the natural direction, on the same scale as the log-likelihood.
log.xlogical: should the x-axis be represented in log-scale? Default is
TRUE.
Returns
a ggplot2::ggplot graph
Networkfamily$plot_stars()
Plot stability path
Arguments
stabilityscalar: the targeted level of stability using stability selection. Default is
0.9.log.xlogical: should the x-axis be represented in log-scale? Default is
TRUE.
Returns
a ggplot2::ggplot graph
Networkfamily$plot_objective()
Plot objective value of the optimization problem along the penalty path
Returns
a ggplot2::ggplot graph