MoE-ph-method: MoE method for ph Class

MoE,ph-methodR Documentation

MoE method for ph Class

Description

MoE method for ph Class

Usage

## S4 method for signature 'ph'
MoE(
  x,
  formula,
  data,
  inhom = NULL,
  alpha_vecs = NULL,
  weight = numeric(0),
  delta = numeric(0),
  stepsEM = 1000,
  optim_method = "BFGS",
  maxit = 50,
  reltol = 1e-08,
  every = 10,
  rand_init = TRUE
)

Arguments

x

An object of class ph.

formula

A regression formula.

data

A data frame.

inhom

A list with the inhomogeneity functions.

alpha_vecs

Matrix of initial probabilities.s

weight

Vector of weights.

delta

Right-censoring indicator.

stepsEM

Number of EM steps to be performed.

optim_method

Method to use in gradient optimization.

maxit

Maximum number of iterations when optimizing g function.

reltol

Relative tolerance when optimizing g function.

every

Number of iterations between likelihood display updates.

rand_init

Random initiation in the R-step.

Value

An object of class sph.

Examples

x <- iph(ph(structure = "general"), gfun = "weibull")
n <- 100
responses <- rweibull(n, 2, 3)
covariate <- data.frame(age = sample(18:65, n, replace = TRUE) / 100, income = runif(n, 0, 0.99))
f <- responses ~ age + income # regression formula
MoE(x = x, formula = f, y = responses, data = covariate, stepsEM = 20)

matrixdist documentation built on Aug. 8, 2023, 5:06 p.m.