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

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

## 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 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-6

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

The list of parameters control_init controls the optimization process in the initialization and in the function PLN(), plus some 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.

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

• "penalty_weights" either a single or a list of 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 classes PLNnetworkfamily and PLNnetworkfit

## Examples

data(trichoptera)
trichoptera <- prepare_data(trichoptera$Abundance, trichoptera$Covariate)
fits <- PLNnetwork(Abundance ~ 1, data = trichoptera)
#>
#>  Initialization...
#>  Adjusting 30 PLN with sparse inverse covariance estimation
#> 	Joint optimization alternating gradient descent and graphical-lasso
#> 	sparsifying penalty = 7.510862
sparsifying penalty = 6.937564
sparsifying penalty = 6.408026
sparsifying penalty = 5.918907
sparsifying penalty = 5.467121
sparsifying penalty = 5.049821
sparsifying penalty = 4.664372
sparsifying penalty = 4.308345
sparsifying penalty = 3.979492
sparsifying penalty = 3.675741
sparsifying penalty = 3.395175
sparsifying penalty = 3.136024
sparsifying penalty = 2.896654
sparsifying penalty = 2.675555
sparsifying penalty = 2.471332
sparsifying penalty = 2.282698
sparsifying penalty = 2.108461
sparsifying penalty = 1.947524
sparsifying penalty = 1.798871
sparsifying penalty = 1.661565
sparsifying penalty = 1.534739
sparsifying penalty = 1.417594
sparsifying penalty = 1.30939
sparsifying penalty = 1.209446
sparsifying penalty = 1.11713
sparsifying penalty = 1.03186
sparsifying penalty = 0.953099
sparsifying penalty = 0.8803498
sparsifying penalty = 0.8131535
sparsifying penalty = 0.7510862

#>  Post-treatments
#>  DONE!