lnm: Fit a logistic normal multinomial model using R's formula interface.
Description
This function fits a logistic normal multinomial (LNM) model to the data
using R's formula interface. The LNM model is a generalization of the
multinomial logistic regression model, allowing for correlated responses
within each category of the response variable. It can be used to learn the
relationship between experimental/environmental factors and community
composition. It is a statistical model that estimates the probabilities of
different outcomes in a multinomial distribution, given a set of covariates.
The LNM model assumes that a log-ratio of the outcome probabilities follow a
multivariate normal distribution. By fitting the LNM model to observed data,
we can infer the effects of the covariates on the outcome compositions.
An object of class "lnm" representing the fitted LNM model.
Arguments
formula
A formula specifying the model structure.
data
A data frame containing the variables specified in the formula.
sigma_b
The prior standard deviation of the beta coefficients in the
LNM model. See the 'Stan' code definition in inst/stan/lnm.stan for the
full model specification.
l1
The first inverse gamma hyperprior parameter for sigmas_mu.
l2
The first inverse gamma hyperprior parameter for sigmas_mu.
...
Additional arguments to be passed to the underlying vb() call from
'rstan'.