Learn R Programming

matrixdist (version 1.1.9)

fit,ph-method: Fit method for ph class

Description

Fit method for ph class

Usage

# S4 method for ph
fit(
  x,
  y,
  weight = numeric(0),
  rcen = numeric(0),
  rcenweight = numeric(0),
  stepsEM = 1000,
  methods = c("RK", "RK"),
  rkstep = NA,
  uni_epsilon = NA,
  maxit = 100,
  reltol = 1e-08,
  every = 100,
  r = 1
)

Value

An object of class ph.

Arguments

x

An object of class ph.

y

Vector or data.

weight

Vector of weights.

rcen

Vector of right-censored observations.

rcenweight

Vector of weights for right-censored observations.

stepsEM

Number of EM steps to be performed.

methods

Methods to use for matrix exponential calculation: RM, UNI or PADE.

rkstep

Runge-Kutta step size (optional).

uni_epsilon

Epsilon parameter for uniformization method.

maxit

Maximum number of iterations when optimizing g function.

reltol

Relative tolerance when optimizing g function.

every

Number of iterations between likelihood display updates.

r

Sub-sampling proportion for stochastic EM, defaults to 1.

Examples

Run this code
obj <- iph(ph(structure = "general", dimension = 2), gfun = "weibull", gfun_pars = 2)
data <- sim(obj, n = 100)
fit(obj, data, stepsEM = 100, every = 20)

Run the code above in your browser using DataLab