loop_lss: The EM loop for the LSS model

View source: R/loop_lss.R

loop_lssR Documentation

The EM loop for the LSS model

Description

loop_lss is the EM loop function for the LSS model to be utilised by various other higher level functions

Usage

loop_lss(
  alldat,
  xiold,
  omega2old,
  nuold,
  mean.ind,
  var.ind,
  nu.ind,
  para.space,
  maxit,
  eps,
  int.maxit,
  print.it
)

Arguments

alldat

Dataframe containing all the data for the models. Outcome in the first column.

xiold

Vector of initial location parameter estimates to be fit in the location model.

omega2old

Vector of initial scale2 parameter estimates to be fit in the scale2 model.

nuold

Vector of initial nu parameter estimates to be fit in the nu model.

mean.ind

Vector containing the column numbers of the data in 'alldat' to be fit as covariates in the location model.

var.ind

Vector containing the column numbers of the data in 'alldat' to be fit as covariates in the scale2 model. FALSE indicates a constant variance model.

nu.ind

Vector containing the column numbers of the data in 'alldat' to be fit as covariates in the nu model. NULL indicates constant model.

para.space

Parameter space to search for variance parameter estimates. "positive" means only search positive parameter space, "negative" means search only negative parameter space and "all" means search all.

maxit

Number of maximum iterations for the main EM algorithm.

eps

Very small number for the convergence criteria.

int.maxit

Number of maximum iterations for the internal EM algorithm for the location and scale.

print.it

Logical to indicate if the estimates for each iteration should be printed.

Value

A list of the results from the algorithm, including conv, reldiff, it, mean, xi.new, omega2.new, nu.new, fitted.xi

  • conv: Logical argument indicating if convergence occurred

  • it: Total iterations performed of the EM algorithm

  • reldiff: the positive convergence tolerance that occured at the final iteration

  • xinew: Vector of location parameter estimates

  • omega2new: Vector of scale squared parameter estimates

  • nunew: Vector of shape parameter estimates

  • fitted.xi: Vector of fitted location estimates


VarReg documentation built on May 31, 2023, 8:44 p.m.