fit-phasetype-method: Fit method for phase-type frailty models

fit,phasetype-methodR Documentation

Fit method for phase-type frailty models

Description

Fit method for phase-type frailty models

Usage

## S4 method for signature 'phasetype'
fit(
  x,
  y,
  rcen = numeric(0),
  weight = numeric(0),
  X = numeric(0),
  stepsEM = 100,
  stepsPH = 50,
  initialpoint = 1e-04,
  truncationpoint = 10,
  maxprobability = 0.01,
  maxdelta = 0.05,
  maxit = 100,
  reltol = 1e-08,
  every = 100
)

Arguments

x

An object of class phasetype.

y

Vector or data.

rcen

Vector of right-censored observations.

weight

Vector of weights for observations.

X

A matrix of covariates.

stepsEM

Number of EM steps to be performed.

stepsPH

Number of EM steps for the phase-type component at each iteration of the global EM.

initialpoint

Initial value for discretization of density.

truncationpoint

Ultimate value for discretization of density.

maxprobability

Max probability allowed for an interval in the discretization.

maxdelta

Max size of interval allowed for the discretization.

maxit

Maximum number of iterations when optimizing g function.

reltol

Relative tolerance when optimizing g function.

every

Number of iterations between likelihood display updates.

Value

An object of class phasetype.

Examples

obj <- frailty(phasetype(structure = "general", dimension = 2), bhaz = "weibull", bhaz_pars = 2)
data <- sim(obj, n = 100)
fit(obj, data, stepsEM = 50, every = 10)

jorgeyslas/phfrailty documentation built on April 17, 2025, 4:11 p.m.