Uses maximum likelihood to fit
Y|X ~ Gamma(exp(beta_0 + beta_x^T X), b), with the
shape-scale (as opposed to shape-rate) parameterization described in
GammaDist
. Y can be precisely measured or subject to
multiplicative mean-1 lognormal errors, in which case replicates can be
incorporated by specifying y
as a list.
gammareg(y, x = NULL, merror = FALSE, integrate_tol = 1e-08,
integrate_tol_hessian = integrate_tol, estimate_var = TRUE,
fix_posdef = FALSE, ...)
Numeric vector.
Numeric vector or matrix. If NULL
, model reduces to marginal
Gamma model Y ~ Gamma(exp(beta_0), b).
Logical value for whether to model multiplicative lognormal measurement errors in Y.
Numeric value specifying the tol
input to
hcubature
. Only used if merror = TRUE
.
Same as integrate_tol
, but for use when
estimating the Hessian matrix only. Sometimes more precise integration
(i.e. smaller tolerance) than used for maximizing the likelihood helps
prevent cases where the inverse Hessian is not positive definite.
Logical value for whether to return Hessian-based variance-covariance matrix.
Logical value for whether to repeatedly reduce
integrate_tol_hessian
by factor of 5 and re-estimate Hessian to try
to avoid non-positive definite variance-covariance matrix.
Additional arguments to pass to nlminb
.
List containing:
Numeric vector of parameter estimates.
Variance-covariance matrix (if estimate_var = TRUE
).
Returned nlminb
object from maximizing the
log-likelihood function.
Akaike information criterion (AIC).