ml.loglik.fn: Likelihood Functions for mixmeta Models

Description Usage Arguments Details Value Note Author(s) References See Also

View source: R/ml.loglik.fn.R

Description

These functions compute the value of the log-likelihood and the related vectors of first partial derivatives for random-effects meta-analytical models, in terms of model parameters. They are meant to be used internally and not directly run by the users.

Usage

1
2
3
4
5
6
7
8
9
ml.loglik.fn(par, Xlist, Zlist, ylist, Slist, nalist, rep, k, q, nall, const,
  bscov, fix)
ml.loglik.gr(par, Xlist, Zlist, ylist, Slist, nalist, rep, k, q, nall, const,
  bscov, fix)

reml.loglik.fn(par, Xlist, Zlist, ylist, Slist, nalist, rep, k, q, nall, const,
  bscov, fix)
reml.loglik.gr(par, Xlist, Zlist, ylist, Slist, nalist, rep, k, q, nall, const,
  bscov, fix)

Arguments

Assuming a meta-analysis or meta-regression based on n units aggregated within m (outer-level) groups, k outcomes, p fixed-effects predictors, and q random-effects predictors:

par

a vector representing the random-effects parameters defining the random-effects (co)variance matrix (or multiple matrices for multilevel models).

Xlist

a m-dimensional list of group-specific design matrices for the fixed-effects part of the model. Rows corresponding to missing outcomes have been excluded.

Zlist

a m-dimensional list of group-specific design matrices for the random-effects part of the model. Each element of this list represents a list of matrices correponding to the (optionally multiple) grouping levels of random effects. In each matrix, rows corresponding to missing outcomes have been excluded.

ylist

a m-dimensional list of group-specific vectors of estimated outcomes. Entries corresponding to missing outcomes have been excluded.

Slist

a m-dimensional list of within-group (co)variance matrices of estimated outcomes. Rows and columns corresponding to missing outcomes have been excluded.

nalist

a m-dimensional list of group-specific logical vectors, identifying missing outcomes.

rep

matrix with m rows where each column identifies the number of repetitions (number of groups) for each grouping level. The first column (outer level) is by definition a vector of 1's.

k, q, nall

number of outcomes, number of random-effects predictors (including the intercept), total number of observations (excluding missing), respectively. While usually all are scalars, in the case of multilevel models q can be a numeric vector representing the number of predictors for each level.

const

value of the constant to be included in the (restricted) likelihood, therefore not computed in the iterative algorithms.

bscov

a character vector defining the structure of the (co)variance matrix for each level or random effects. See mixmeta.

fix

a matrix (or optionally a list of matrices for multilevel models) defining the fixed components of the random-effects part of the model. See mixmeta.control for details.

Details

These functions are called internally by fitting functions, in particular ml.newton and reml.newton, to compute the (restricted) log-likelihood and its first partial derivatives in terms of random-effects parameters for meta-analytical models.

These functions actually specify the profiled version of the (restricted) likelihood, expressed only in terms of random-effects parameters, while the estimate of the fixed-effects coefficients is computed at each iteration using a generalized least squares estimator, based on the current value of the between-study (co)variance matrix. At convergence, the value of this profiled version is identical to the full (restricted) likelihood. This approach is computationally efficient, as it reduces the number of parameters in the optimization routine, especially for meta-regression models.

The random-effects parameters in par depends on the chosen structure(s) for the random-effects (co)variance matrix (or multiple matrices for multilevel models). The parameterization ensures positive-definiteness. A Cholesky decomposition is then performed on the marginal (co)variance matrix in order to re-express the problem as standard least square equations, an approach which speeds up the computation of matrix inverses and determinants. These equations are finally solved through a QR decomposition, which guarantees stability. More details are provided in the references below.

Some parameters of the fitting procedures are determined through mixmeta.control. Specifically, the user can obtain the Hessian matrix of the estimated parameters (appropriately transformed, see mixmetaCovStruct) in the optimization function by setting hessian=TRUE, and specific settings of the optimization process can be defined by the control list argument optim. These values are passed to the optimization function optim.

Value

ml.loglik.fn and reml.loglik.fn return the value of the (restricted) log-likelihood for a given set of parameters in par. ml.loglik.gr and reml.loglik.gr return instead the related vector of first partial derivatives.

Note

As stated earlier, these functions are called internally by mixmeta.ml and mixmeta.reml, and are not meant to be used directly. In particular, their code does not contain any check on the arguments provided, which are expected in specific formats. They are however exported in the namespace and documented for completeness.

Author(s)

Antonio Gasparrini <antonio.gasparrini@lshtm.ac.uk> and Francesco Sera <francesco.sera@lshtm.ac.uk>

References

Sera F, Armstrong B, Blangiardo M, Gasparrini A (2019). An extended mixed-effects framework for meta-analysis.Statistics in Medicine. 2019;38(29):5429-5444. [Freely available here].

Lindstrom MJ and Bates DM (1988). Newton-Raphson and EM algorithms for linear mixed-effects models for repeated-measures data. Journal of the American Statistical Association. 83(404):1014–1022.

Harville DA (1977) Maximum likelihood approaches to variance component estimation and to related problems. Journal of the American Statistical Association. 72(358):320–338.

Pinheiro JC and Bates DM (2000). Mixed-Effects Models in S and S-PLUS. New York, Springer Verlag.

See Also

See mixmeta.fit and mixmeta.ml for additional info on the fitting procedures. See mixmeta.control to determine specific parameters of the fitting procedures. See mixmetaCovStruct for (co)variance structures. See chol and qr for info on the Cholesky and QR decomposition. See mixmeta-package for an overview of the package and modelling framework.


mixmeta documentation built on Oct. 16, 2021, 5:09 p.m.