chlm_fit: Low-level fitting functions for the censored HLM model.

Description Usage Arguments Details Value References

View source: R/chlm_fit.R

Description

Low-level fitting functions for the censored HLM model.

Usage

1
2
3
4
5
chlm_fit(y, delta, X, Z, beta0, gamma0, maxit = 100, epsilon = 1e-08,
  splitE = FALSE, nIRLS = 5)

chlm_control(epsilon = 1e-05, maxit = 100, nIRLS = 5,
  splitE = TRUE)

Arguments

y

Vector of observations of length n.

delta

Optional logical vector of length n indicating the censorring status (TRUE: uncensored, FALSE: uncensored).

X

Mean covariate matrix of size n x p.

Z

Variance covariate matrix of size n x q.

beta0

Optional initial mean parameter vector of length p.

gamma0

Optional initial variance parameter vector of length q.

maxit

Maximum number of iteration of the fitting algorithm (see Details).

epsilon

Tolerance threshold for termination of the algorithm (see Details).

splitE

If TRUE, perform the E-step after each conditional M-step (see Details).

nIRLS

Number of IRLS steps to take before switching to Fisher scoring. Can be 0 or greater than maxit to do only one or the other.

Details

The heteroscedastic linear model (HLM) is defined as

y_i | x_i, z_i ~ind N(x_i'β, exp(z_i'γ)),

where for each subject i, y_i is the response, and x_i \in R^p and z_i \in R^q are mean and variance covariate vectors, respectively.

The fitting algorithm is an Expectation-Conditional-Maximization (ECM) algorithm extending the alternating weighted-LM/GLM updates of beta and gamma, proposed by Smyth (1989) for the uncensored setting. The ECM algorithm terminates when either maxit iterations have been reached, or when

1
|ll_curr - ll_prev| / (0.1 + |ll_curr|) < epsilon,

where ll_curr and ll_prev are the loglikelihood values at the current and previous iterations.

TODO:

Value

A list with the following elements:

beta

The MLE of the mean parameter vector.

gamma

The MLE of the variance parameter vector.

loglik

The value of the loglikelihood at the fitted parameter values.

iter

The number of steps taken by the algorithm.

error

The value of the loglikelihood relative error at the end of the algorithm.

References

Smyth, G.K. "Generalized Linear Models with Varying Dispersion." Journal of the Royal Statistical Society Series B 51:1 (1989): 47-60. https://www.jstor.org/stable/2345840.


mlysy/hlm documentation built on Nov. 4, 2019, 7:26 p.m.