Learn R Programming

PLNmodels (version 0.9.5)

PLNnetworkfit: An R6 Class to represent a PLNfit in a sparse inverse covariance framework

Description

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.PLNnetworkfit + methods inherited from PLNfit.

Arguments

Super class

PLNmodels::PLNfit -> PLNnetworkfit

Public fields

var_par

a list with two matrices, M and S, which are the estimated parameters in the variational approximation

latent

a matrix: values of the latent vector (Z in the model)

optim_par

a list with parameters useful for monitoring the optimization

loglik

variational lower bound of the loglikelihood

BIC

variational lower bound of the BIC

ICL

variational lower bound of the ICL

R_squared

approximated goodness-of-fit criterion

Active bindings

penalty

the level of sparsity in the current model

model_par

a list with the matrices associated with the estimated parameters of the pPCA model: Theta (covariates), Sigma (latent covariance) and Theta (latent precision matrix). Note Omega and Sigma are inverse of each other.

var_par

a list with two matrices, M and S, which are the estimated parameters in the variational approximation

latent

a matrix: values of the latent vector (Z in the model)

optim_par

a list with parameters useful for monitoring the optimization

loglik

variational lower bound of the loglikelihood

pen_loglik

variational lower bound of the l1-penalized loglikelihood

BIC

variational lower bound of the BIC

EBIC

variational lower bound of the EBIC

ICL

variational lower bound of the ICL

R_squared

approximated goodness-of-fit criterion

nb_param

number of parameters in the current PLN model

density

proportion of non-null edges in the network

criteria

a vector with loglik, BIC, ICL, R_squared and number of parameters

Methods

Public methods

Method new()

Usage

PLNnetworkfit$new(
  penalty,
  responses,
  covariates,
  offsets,
  weights,
  model,
  control
)

Method update()

Usage

PLNnetworkfit$update(
  penalty = NA,
  Theta = NA,
  Sigma = NA,
  Omega = NA,
  M = NA,
  S = NA,
  Z = NA,
  A = NA,
  Ji = NA,
  R2 = NA,
  monitoring = NA
)

Method optimize()

Usage

PLNnetworkfit$optimize(responses, covariates, offsets, weights, control)

Method postTreatment()

Usage

PLNnetworkfit$postTreatment(responses, covariates, offsets, weights, nullModel)

Method latent_network()

Usage

PLNnetworkfit$latent_network(type = c("partial_cor", "support", "precision"))

Method plot_network()

Usage

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,
  plot = TRUE
)

Method show()

Usage

PLNnetworkfit$show()

Method clone()

The objects of this class are cloneable with this method.

Usage

PLNnetworkfit$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

See Also

The function PLNnetwork, the class PLNnetworkfamily

Examples

Run this code
# NOT RUN {
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