Usage
mnlm(counts, covars, normalize=FALSE, penalty=c(1,0.2), start=NULL,
tol=0.1, tmax=1000, delta=1, dmin=0, bins=0, verb=FALSE)
Arguments
counts
A matrix of multinomial response counts in ncol(counts)
categories
for nrow(counts)
individuals/observations. This can be a matrix
, or a vector of response factors,
but for most text-analysis applications
covars
A matrix of ncol(covars)
covariate values for each of the nrow(counts)
observations.
This does not include the intercept, which is ALWAYS added in the design matrix.
normalize
Whether or not to normalize the covariate matrix to have mean zero and variance one.
penalty
Either a single fixed value, or a vector of length 2 giving the gamma hyperprior prior shape and rate parameters.
Here, the penalty ($\lambda>0$) is a
scale parameter for the Laplace prior on each non-intercept
regression coefficient, parametrized
start
An initial guess for the full ncol(counts)
by ncol(covars)+1
matrix of regression coefficients.
Under the default start=NULL
,
the intercept is a logit transform of mean phrase frequencies and
coef
tol
Optimization convergence tolerance for the improvement on the
un-normalized negative log posterior over a single full parameter sweep.
tmax
The maximum number of optimization iterations.
delta
An initial step size for the least upper bound approximation to parameter information;
implies a starting trust region of 2*delta
.
dmin
Minimum trust region delta.
bins
For faster inference on large data sets (or just to collapse observations across levels for factor covariates),
you can specify the number of bins
for step-function
approximations to the columns of covars
. Counts a
verb
Control for print-statement output. TRUE
prints some initial info
and updates every iteration.