Learn R Programming

PLNmodels (version 0.9.5)

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()
)

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 weights to be used in the fitting process. Should be NULL or a numeric vector.

penalties

an optional vector of positive real number controling the level of sparisty of the underlying network. if NULL (the default), will be set internally

control_init

a list for controling the optimization of the PLN model used at initialization. See details.

control_main

a list for controling the main optimization process. See details.

Value

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

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_rel multiplied by the absolute value of the parameter.

  • "ftol_abs"stop when an optimization step changes the objective function by less than ftol_abs .

  • "xtol_rel"stop when an optimization step changes every parameters by less than xtol_rel multiplied by the absolute value of the parameter.

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

  • "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".

  • "cores"integer for number of cores used. Default is 1.

  • "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 FALSE.

  • "penalty_weights"p x p matrix of weights (defaut 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
# NOT RUN {
data(trichoptera)
trichoptera <- prepare_data(trichoptera$Abundance, trichoptera$Covariate)
fits <- PLNnetwork(Abundance ~ 1, data = trichoptera)
# }

Run the code above in your browser using DataLab