fast_Estep: Fast fitting of the E step

Description Usage Arguments Value

View source: R/fast_Estep.R

Description

This function calculates the E step in a quicker way, without taking all the derivatives of the Laplace transform. Such closed form solutions are only available for the gamma distribution (with or without left truncation) and for the inverse Gaussian distribution (without left truncation). For a data set with K clusters,

Usage

1
fast_Estep(c, c_lt = 0, delta, alpha, bbeta, pvfm, dist)

Arguments

c

Vector of length K of cumulative hazards, i.e. total accumulated hazards within a cluster

c_lt

Vector of length K of cumulative hazard from 0 to the left truncation time

delta

Vector of integers of length K of the number of events for each cluster

alpha, bbeta

Parameters of the frailty distribution

pvfm

Parameter for the PVF distribution, only matters in that case

dist

One of 0 (for gamma), 1 (for stable) or 2 (for PVF)

Value

A K x 4 matrix where the first column and the second column are the numerators and the denominators of the frailty fraction, the third is the log-likelihood contribution, and the last column is the expectation of the squared frailty (only used in calculating the information matrix)


frailtyEM documentation built on Sept. 22, 2019, 5:05 p.m.