Learn R Programming

PLNmodels (version 0.9.5)

PLNLDA: Poisson lognormal model towards Linear Disciminant Analysis

Description

Fit the Poisson lognormal for LDA with a variational algorithm. Use the (g)lm syntax for model specification (covariates, offsets).

Usage

PLNLDA(formula, data, subset, weights, grouping, control = 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.

grouping

a factor specifying the class of each observation used for discriminant analysis.

control

a list for controling the optimization process. See details.

Value

an R6 object with class PLNLDAfit

Details

The parameter control is a list controlling the optimization with the following entries

  • "covariance"character setting the model for the covariance matrix. Either "full" or "spherical". Default is "full".

  • "trace"integer for verbosity.

  • "inception"Set up the intialization. By default, the model is initialized with a multivariate linear model applied on log-transformed data. However, the user can provide a PLNfit (typically obtained from a previsous fit), which often speed up the inference.

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

  • "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 1e-6

  • "xtol_rel"stop when an optimization step changes every parameters by less than xtol 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 multiplied by the absolute value of the parameter. Default is 1e-4

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

  • "maxtime"stop when the optimization time (in seconds) exceeds maxtime. Default is -1 (no restriction)

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

  • "lower_bound"the lower bound (box constraint) for the variational variance parameters. Default is 1e-4.

See Also

The class PLNLDAfit

Examples

Run this code
# NOT RUN {
data(trichoptera)
trichoptera <- prepare_data(trichoptera$Abundance, trichoptera$Covariate)
myPLNLDA <- PLNLDA(Abundance ~ 1, grouping = Group, data = trichoptera)
# }

Run the code above in your browser using DataLab