Learn R Programming

PLNmodels (version 0.11.7)

PLNnetwork: Poisson lognormal model towards sparse network inference

Description

Fit the sparse inverse covariance variant of the Poisson lognormal with a variational algorithm. Use the (g)lm syntax for model specification (covariates, offsets).

Usage

PLNnetwork(
  formula,
  data,
  subset,
  weights,
  penalties = NULL,
  control_init = list(),
  control_main = list()
)

Value

an R6 object with class PLNnetworkfamily, which contains a collection of models with class PLNnetworkfit

Arguments

formula

an object of class "formula": a symbolic description of the model to be fitted.

data

an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which lm is called.

subset

an optional vector specifying a subset of observations to be used in the fitting process.

weights

an optional vector of observation weights to be used in the fitting process.

penalties

an optional vector of positive real number controlling the level of sparsity of the underlying network. if NULL (the default), will be set internally. See control_init and control_main options for additional tuning of the penalty.

control_init

a list for controlling the optimization of the PLN model used at initialization, and how the vector of penalties is generated. See details.

control_main

a list for controlling the main optimization process. Can be used to specify adaptive penalty weights. See details.

Details

The list of parameters control_main controls the optimization of the main process, with the following entries:

  • "ftol_rel" stop when an optimization step changes the objective function by less than ftol multiplied by the absolute value of the parameter. Default is 1e-6 when n < p, 1e-8 otherwise.

  • "ftol_abs" stop when an optimization step changes the objective function by less than ftol multiplied by the absolute value of the parameter. Default is 0

  • "xtol_rel" stop when an optimization step changes every parameters by less than xtol_rel multiplied by the absolute value of the parameter. Default is 1e-4

  • "xtol_abs" stop when an optimization step changes every parameters by less than xtol_abs. Default is 0

  • "maxeval" stop when the number of iteration exceeds maxeval. Default is 10000

  • "algorithm" the optimization method used by NLOPT among LD type, i.e. "CCSAQ", "MMA", "LBFGS", "VAR1", "VAR2". See NLOPT documentation for further details. Default is "CCSAQ".

  • "trace" integer for verbosity. Useless when cores > 1

  • "ftol_out" outer solver stops when an optimization step changes the objective function by less than xtol multiply by the absolute value of the parameter. Default is 1e-6

  • "maxit_out" outer solver stops when the number of iteration exceeds out.maxit. Default is 50

  • "penalize_diagonal" boolean: should the diagonal terms be penalized in the graphical-Lasso? Default is TRUE

  • "penalty_weights" p x p matrix of weights (default filled with 1) to adapt the amount of shrinkage to each pairs of node. Must be symmetric with positive values.

The list of parameters control_init controls the optimization process in the initialization and in the function PLN(), plus two additional parameters:

  • "nPenalties" an integer that specified the number of values for the penalty grid when internally generated. Ignored when penalties is non NULL

  • "min.ratio" the penalty grid ranges from the minimal value that produces a sparse to this value multiplied by min.ratio. Default is 0.1.

See Also

The classes PLNnetworkfamily and PLNnetworkfit

Examples

Run this code
data(trichoptera)
trichoptera <- prepare_data(trichoptera$Abundance, trichoptera$Covariate)
fits <- PLNnetwork(Abundance ~ 1, data = trichoptera)

Run the code above in your browser using DataLab