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 = PLNnetwork_param()
)
an object of class "formula": a symbolic description of the model to be fitted.
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.
an optional vector specifying a subset of observations to be used in the fitting process.
an optional vector of observation weights to be used in the fitting process.
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 PLNnetwork_param()
for additional tuning of the penalty.
a list-like structure for controlling the optimization, with default generated by PLNnetwork_param()
. See the corresponding documentation for details;
an R6 object with class PLNnetworkfamily
, which contains
a collection of models with class PLNnetworkfit
The classes PLNnetworkfamily
and PLNnetworkfit
, and the and the configuration function PLNnetwork_param()
.
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.54443
sparsifying penalty = 6.96857
sparsifying penalty = 6.436665
sparsifying penalty = 5.94536
sparsifying penalty = 5.491556
sparsifying penalty = 5.07239
sparsifying penalty = 4.685219
sparsifying penalty = 4.3276
sparsifying penalty = 3.997278
sparsifying penalty = 3.692169
sparsifying penalty = 3.410349
sparsifying penalty = 3.15004
sparsifying penalty = 2.9096
sparsifying penalty = 2.687513
sparsifying penalty = 2.482377
sparsifying penalty = 2.2929
sparsifying penalty = 2.117885
sparsifying penalty = 1.956228
sparsifying penalty = 1.806911
sparsifying penalty = 1.668991
sparsifying penalty = 1.541598
sparsifying penalty = 1.42393
sparsifying penalty = 1.315242
sparsifying penalty = 1.214851
sparsifying penalty = 1.122122
sparsifying penalty = 1.036472
sparsifying penalty = 0.9573588
sparsifying penalty = 0.8842844
sparsifying penalty = 0.8167877
sparsifying penalty = 0.754443
#> Post-treatments
#> DONE!