Extract info from formulas, reTrms, etc., format for TMB
mkTMBStruc(
formula,
ziformula,
dispformula,
combForm,
mf,
fr,
yobs,
respCol,
weights,
contrasts,
size = NULL,
family,
se = NULL,
call = NULL,
verbose = NULL,
ziPredictCode = "corrected",
doPredict = 0,
whichPredict = integer(0),
REML = FALSE,
start = NULL,
map = NULL,
sparseX = NULL
)
combined fixed and random effects formula, following lme4 syntax.
a one-sided (i.e., no response variable) formula for zero-inflation combining fixed and random effects: the default ~0
specifies no zero-inflation. Specifying ~.
sets the zero-inflation formula identical to the right-hand side of formula
(i.e., the conditional effects formula); terms can also be added or subtracted. When using ~.
as the zero-inflation formula in models where the conditional effects formula contains an offset term, the offset term will automatically be dropped. The zero-inflation model uses a logit link.
a one-sided formula for dispersion containing only fixed effects: the default ~1
specifies the standard dispersion given any family. The argument is ignored for families that do not have a dispersion parameter. For an explanation of the dispersion parameter for each family, see sigma
. The dispersion model uses a log link. In Gaussian mixed models, dispformula=~0
fixes the residual variance to be 0 (actually a small non-zero value: at present it is set to sqrt(.Machine$double.eps)
), forcing variance into the random effects.
combined formula
call to model frame
model frame
observed y
response column
weights, as in glm
. Not automatically scaled to have sum 1.
an optional list, e.g., list(fac1="contr.sum")
. See the contrasts.arg
of model.matrix.default
.
number of trials in binomial and betabinomial families
family object
(logical) compute standard error?
original glmmTMB
call
whether progress indication should be printed to the console.
zero-inflation code
flag to enable sds of predictions
which observations in model frame represent predictions
whether to use REML estimation rather than maximum likelihood.
starting values, expressed as a list with possible components beta
, betazi
, betad
(fixed-effect parameters for conditional, zero-inflation, dispersion models); b
, bzi
(conditional modes for conditional and zero-inflation models); theta
, thetazi
(random-effect parameters, on the standard deviation/Cholesky scale, for conditional and z-i models); thetaf
(extra family parameters, e.g., shape for Tweedie models).
a list specifying which parameter values should be fixed to a constant value rather than estimated. map
should be a named list containing factors corresponding to a subset of the internal parameter names (see start
parameter). Distinct factor values are fitted as separate parameter values, NA
values are held fixed: e.g., map=list(beta=factor(c(1,2,3,NA)))
would fit the first three fixed-effect parameters of the conditional model and fix the fourth parameter to its starting value. In general, users will probably want to use start
to specify non-default starting values for fixed parameters. See MakeADFun
for more details.
see glmmTMB
offset for zero-inflated model
offset for dispersion model