Description Usage Arguments Details Value References
Low-level fitting functions for the censored HLM model.
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)
|
y |
Vector of observations of length |
delta |
Optional logical vector of length |
X |
Mean covariate matrix of size |
Z |
Variance covariate matrix of size |
beta0 |
Optional initial mean parameter vector of length |
gamma0 |
Optional initial variance parameter vector of length |
maxit |
Maximum number of iteration of the fitting algorithm (see Details). |
epsilon |
Tolerance threshold for termination of the algorithm (see Details). |
splitE |
If |
nIRLS |
Number of IRLS steps to take before switching to Fisher scoring. Can be 0 or greater than |
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:
Input checking.
print
, summary
, vcov
methods.
residual
method. Perhaps use expected lifetime for the censored observations?
Separate into chlm
and hlm
classes?
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.
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.