Calculates the MLE of the coefficients of the heteroscedastic linear model (HLM). See Details.
hlm_fit(y, X, Z, method = c("IRLS", "Fisher"), beta0, gamma0, maxit = 100, epsilon = 1e-05)
| y | Vector of observations of length |
|---|---|
| X | Mean covariate matrix of size |
| Z | Variance covariate matrix of size |
| method | Which method to use for fitting the conditional LVLM model. See |
| 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). |
A list with elements:
betaThe MLE of the mean parameters as a vector of length p.
gammaThe MLE of the variance parameters as a vector of length q.
loglikThe loglikelihood at the final step of the algorithm.
iterThe number of iterations of the fitting algorithm.
toleranceThe loglikelihood relative error at the last step.
The heteroscedastic linear model (HLM) is defined as $$ y_i \mid \boldsymbol{x}_i, \boldsymbol{z}_i \stackrel{\mathrm{ind}}{\sim} \mathcal N\big(\boldsymbol{x}_i'\boldsymbol{\beta}, \exp(\boldsymbol{z}_i'\boldsymbol{\gamma})\big), $$ where for each subject \(i\), \(y_i\) is the response, and \(\boldsymbol{x}_i \in \mathbb{R}^p\) and \(\boldsymbol{z}_i \in \mathbb{R}^q\) are mean and variance covariate vectors, respectively.
The low-level function hlm_fit assumes that the response vector is fully observed (uncensored). See chlm_fit for the corresponding function with censoring, or the higher-level interface hlm.
The tuning parameters of the LVLM fitting methods are tuned to their default values in lvlm_fit.
Warning: This R wrapper function provides a direct interface to the C++ source code. Incorrect argument specification may lead to abrupt termination of the R session.