The function PLNnetwork() produces a collection of models which are instances of object with class PLNnetworkfit.
This class comes with a set of methods, some of them being useful for the user:
See the documentation for plot() and methods inherited from PLNfit.
PLNfit -> PLNfit_fixedcov -> PLNnetworkfit
vcov_modelcharacter: the model used for the residual covariance
penaltythe global level of sparsity in the current model
penalty_weightsa matrix of weights controlling the amount of penalty element-wise.
n_edgesnumber of edges if the network (non null coefficient of the sparse precision matrix)
nb_paramnumber of parameters in the current PLN model
pen_loglikvariational lower bound of the l1-penalized loglikelihood
ebic_gammathe tuning parameter gamma of the EBIC, between 0 and 1. 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 this fit.
EBICvariational lower bound of the extended BIC of Foygel and Drton (2010), that is the BIC with the additional penalty 2 gamma |E| log(p) on the edge set. Their criterion was designed for the graphical Lasso; up to and including version 1.3.2, PLNmodels used instead the approximation gamma |E| log(p (p - 1) / (2 |E|)) of the original EBIC of Chen and Chen (2008).
densityproportion of non-null edges in the network
criteriaa vector with loglik, penalized loglik, BIC, EBIC, ICL, R_squared, number of parameters, number of edges and graph density
PLNnetworkfit$new()Initialize a PLNnetworkfit object
PLNnetworkfit$new(data, control)dataa named list used internally to carry the data matrices
controla list for controlling the optimization.
PLNnetworkfit$optimize()Call to the C++ optimizer and update of the relevant fields
PLNnetworkfit$optimize(data, config)dataa named list used internally to carry the data matrices
configa list for controlling the optimization
PLNnetworkfit$latent_network()Extract interaction network in the latent space
PLNnetworkfit$latent_network(type = c("partial_cor", "support", "precision"))typeedge value in the network. Can be "support" (binary edges), "precision" (coefficient of the precision matrix) or "partial_cor" (partial correlation between species)
a square matrix of size PLNnetworkfit$n
PLNnetworkfit$plot_network()plot the latent network.
PLNnetworkfit$plot_network(
type = c("partial_cor", "support"),
output = c("igraph", "corrplot"),
edge.color = c("#F8766D", "#00BFC4"),
remove.isolated = FALSE,
node.labels = NULL,
layout = layout_in_circle,
edge.alpha = 0.2,
plot = TRUE
)typeedge value in the network. Either "precision" (coefficient of the precision matrix) or "partial_cor" (partial correlation between species).
outputOutput type. Either igraph (for the network) or corrplot (for the adjacency matrix)
edge.colorLength 2 color vector. Color for positive/negative edges. Default is c("#F8766D", "#00BFC4"). Only relevant for igraph output.
remove.isolatedif TRUE, isolated node are remove before plotting. Only relevant for igraph output.
node.labelsvector of character. The labels of the nodes. The default will use the column names ot the response matrix.
layoutan optional igraph layout. Only relevant for igraph output.
edge.alphaopacity of the weakest edge, the strongest one being fully
opaque, so that the strength of an edge can be read off a dense network.
Default is 0.2. Set it to 1 for uniformly opaque edges. Only relevant
for igraph output with type = "partial_cor".
plotlogical. Should the final network be displayed or only sent back to the user. Default is TRUE.
PLNnetworkfit$show()User friendly print method
PLNnetworkfit$show()PLNnetworkfit$clone()The objects of this class are cloneable with this method.
PLNnetworkfit$clone(deep = FALSE)deepWhether to make a deep clone.
The function PLNnetwork(), the class PLNnetworkfamily
if (FALSE) {
data(trichoptera)
trichoptera <- prepare_data(trichoptera$Abundance, trichoptera$Covariate)
nets <- PLNnetwork(Abundance ~ 1, data = trichoptera)
myPLNnet <- getBestModel(nets)
class(myPLNnet)
print(myPLNnet)
}
Run the code above in your browser using DataLab