The function PLNnetwork() produces an instance of this class.
This class comes with a set of methods, some of them being useful for the user:
See the documentation for getBestModel(),
getModel() and plot()
PLNmodels::PLNfamily -> PLNnetworkfamily
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
criteriaa data frame with the values of some criteria (approximated 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
new()Initialize all models in the collection
PLNnetworkfamily$new(
penalties,
responses,
covariates,
offsets,
weights,
formula,
xlevels,
control
)penaltiesa vector of positive real number controlling the level of sparsity of the underlying network.
responsesthe matrix of responses common to every models
covariatesthe matrix of covariates common to every models
offsetsthe matrix of offsets common to every models
weightsthe vector of observation weights
formulamodel formula used for fitting, extracted from the formula in the upper-level call
xlevelsnamed listed of factor levels included in the models, extracted from the formula in the upper-level call and used for predictions.
controla list for controlling the optimization. See details.
Update current PLNnetworkfit with smart starting values
optimize()Call to the C++ optimizer on all models of the collection
PLNnetworkfamily$optimize(control)controla list for controlling the optimization. See details.
stability_selection()Compute the stability path by stability selection
PLNnetworkfamily$stability_selection(subsamples = NULL, control = list())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.
controla list controlling the main optimization process in each call to PLNnetwork. See PLNnetwork() for details.
coefficient_path()Extract the regularization path of a PLNnetworkfamily
PLNnetworkfamily$coefficient_path(precision = TRUE, corr = TRUE)precisionLogical. Should the regularization path be extracted from the precision matrix Omega (TRUE, default) or from the variance matrix Sigma (FALSE)
corrLogical. Should the matrix be transformed to (partial) correlation matrix before extraction? Defaults to TRUE
getBestModel()Extract the best network in the family according to some criteria
PLNnetworkfamily$getBestModel(
crit = c("BIC", "EBIC", "StARS"),
stability = 0.9
)critcharacter. Criterion used to perform the selection. Is "StARS" is chosen but $stability field is empty, will compute stability path.
stabilityOnly used for "StARS" criterion. A scalar indicating the target stability (= 1 - 2 beta) at which the network is selected. Default is 0.9.
plot()Display various outputs (goodness-of-fit criteria, robustness, diagnostic) associated with a collection of PLNnetwork fits (a PLNnetworkfamily)
PLNnetworkfamily$plot(
criteria = c("loglik", "pen_loglik", "BIC", "EBIC"),
reverse = FALSE,
log.x = TRUE
)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.
a ggplot graph
plot_stars()Plot stability path
PLNnetworkfamily$plot_stars(stability = 0.9, log.x = TRUE)stabilityscalar: the targeted level of stability in stability plot. Default is 0.9.
log.xlogical: should the x-axis be represented in log-scale? Default is TRUE.
a ggplot graph
plot_objective()Plot objective value of the optimization problem along the penalty path
PLNnetworkfamily$plot_objective()a ggplot graph
show()User friendly print method
PLNnetworkfamily$show()
clone()The objects of this class are cloneable with this method.
PLNnetworkfamily$clone(deep = FALSE)deepWhether to make a deep clone.
The function PLNnetwork(), the class PLNnetworkfit
data(trichoptera)
trichoptera <- prepare_data(trichoptera$Abundance, trichoptera$Covariate)
fits <- PLNnetwork(Abundance ~ 1, data = trichoptera)
class(fits)
Run the code above in your browser using DataLab