loop_em {VarReg}R Documentation

The EM loop for the main mean and variance function

Description

loop_em is a basic EM loop function to be utilised by various other higher level functions.

Usage

loop_em(meanmodel, theta.old, p.old, x.0, X, maxit, eps)

Arguments

meanmodel

Dataframe containing only the covariates to be fit in the mean model. NULL for zero mean model and FALSE for constant mean model.

theta.old

Vector containing the initial variance parameter estimates to be fit in the variance model.

p.old

Vector of length n containing the containing the initial variance estimate.

x.0

Matrix of covariates (length n) to be fit in the variance model. All have been rescaled so zero is the minimum. If NULL, then its a constant variance model.

X

Vector of length n of the outcome variable.

maxit

Number of maximum iterations for the EM algorithm.

eps

Very small number for the convergence criteria.

Value

A list of the results from the EM algorithm, including


[Package VarReg version 2.0 Index]