nlmm.fit: Fitter Function for Generalized Laplace Mixed-Effects Models

nlmm.fitR Documentation

Fitter Function for Generalized Laplace Mixed-Effects Models

Description

This is the basic computing engine called by nlmm used to fit generalized Laplace mixed-effects models. These should usually not be used directly unless by experienced users.

Usage

nlmm.fit(args, control)

Arguments

args

list of arguments for fitting as returned by nlmm with fit = FALSE.

control

list of control parameters of the fitting process as returned by nlmmControl.

Details

The function fits a generalized Laplace mixed-effects model conditional on the covariates, as specified by the formula argument, and on random effects, as specified by the random argument. The predictor is assumed to be linear. The function maximizes the (log)likelihood of the generalized Laplace regression as proposed by Geraci and Farcomeni (2020). The likelihood is numerically integrated via Gaussian quadrature techniques. The optimization algorithm is based on the function nlminb.

By default, the function fits a mixed-effects model where both random effects and error term follow a generalized Laplace distribution (GenLaplace). This is a family of distributions that includes the normal and the Laplace distributions as special cases. Constrained fitting can be controlled via the arguments alpha.index and alpha in nlmmControl. For example, if alpha.index = 0, the model is Normal-Normal if alpha = c(0,0), Normal-Laplace if alpha = c(0,1), Laplace-Normal if alpha = c(1,0), and Laplace-Laplace if alpha = c(1,1). But any value of alpha between 0 (normal distribution) and 1 (Laplace distribution) is allowed.

Different standard types of positive–definite matrices for the random effects can be specified: pdIdent multiple of an identity; pdCompSymm compound symmetry structure (constant diagonal and constant off–diagonal elements); pdDiag diagonal; pdSymm general positive–definite matrix, with no additional structure.

Within-group heteroscedasticity can be modeled via the weights argument using varClasses in the nlme packages.

Value

nlmm returns an object of class nlmm.

The function summary is used to obtain and print a summary of the results.

An object of class nlmm is a list containing the following components:

theta

a vector containing (in this order) fixed regression coefficients, parameters of the variance–covariance matrix of the random effects, shape parameter, scale parameter, and (optional) within-group variance function parameters. All parameters are unconstrained. See VarCorr.nlmm to extract the variance–covariance of the random effects from an "nlmm" object.

theta_x,theta_z

partition of theta: fixed regression coefficients (theta_x) and unique variance–covariance unconstrained parameters (theta_z).

tau

unconstrained shape parameter.

alpha

constrained shape parameter.

phi

unconstrained scale parameter.

sigma

constrained scale parameter.

vf

(fitted) within-group variance function of class varFunc. S3 methods (summary.varFunc, varWeights.varFunc, coef.varFunc) can be applied.

value

negative log–likelihood.

call

the matched call.

nn

column names of mmf.

mm

column names of mmr.

nobs

the number of observations.

dim_theta

the number of columns in mmf and mmr.

dim_theta_z

the length of theta_z.

mmf

the model matrix – fixed effects.

mmr

the model matrix – random effects.

y

the model response.

revOrder

original order of observations (now ordered according to group).

group

the grouping factor.

ngroups

the number of groups.

InitialPar

starting values for theta, included the fitted lme or lm object from where starting values have been taken.

control

list of control parameters used for optimization (see nlmmControl).

cov_name

class of variance-covariance matrix for the random effects.

mfArgs

arguments for model.frame to return the full data frame.

sc

model's distribution. "Generalized Laplace" if unconstrained estimation, or one of four special case for specific values of alpha ("Normal-Normal", "Normal-Laplace", "Laplace-Normal", "Laplace-Laplace").

Author(s)

Marco Geraci

References

Geraci, M. and Farcomeni A (2020). A family of linear mixed-effects models using the generalized Laplace distribution. Statistical Methods in Medical Research.

See Also

summary.nlmm, fixef.nlmm, ranef.nlmm, VarCorr.nlmm, predict.nlmm, residuals.nlmm

Examples


data(rats)

nlmm(y ~ trt*time, random = ~ 1, group = id, data = rats, control = nlmmControl(multistart = FALSE))
 

marco-geraci/nlmm documentation built on Sept. 12, 2023, 2:25 a.m.