Learn R Programming

matrixdist (version 1.1.2)

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,
  plot = FALSE
)

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.

plot

logical indicating whether to plot the fit at each iteration.

Value

An object of class '>ph.

Examples

Run this code
# NOT RUN {
obj <- iph(ph(structure = "general", dimension = 2), gfun = "weibull", gfun_pars = 2)
data <- sim(obj, n = 100)
fit(obj, data, stepsEM = 1000, every = 200)
# }

Run the code above in your browser using DataLab