
Last chance! 50% off unlimited learning
Sale ends in
Fit method for mph/miph class, using mixture-of-experts regression
# S4 method for mph
MoE(
x,
formula,
y,
data,
alpha_mat = NULL,
delta = numeric(0),
stepsEM = 1000,
r = 1,
maxit = 100,
reltol = 1e-08,
rand_init = T
)
An object of class mph.
a regression formula.
A matrix of observations.
A data frame of covariates (they need to be scaled for the regression).
Matrix with initial distribution vectors for each row of observations.
Matrix with right-censoring indicators (1 uncensored, 0 right censored).
Number of EM steps to be performed.
Sub-sampling parameter, defaults to 1 (not supported for this method).
Maximum number of iterations when optimizing the g function (inhomogeneous likelihood).
Relative tolerance when optimizing g function.
Random initiation in the R-step of the EM algorithm.
under_mph <- mph(structure = c("general", "general"), dimension = 3)
x <- miph(under_mph, gfun = c("weibull", "weibull"), gfun_pars = list(c(2), c(3)))
n <- 100
responses <- cbind(rexp(n), rweibull(n, 2, 3))
covariates <- data.frame(age = sample(18:65, n, replace = TRUE) / 100, income = runif(n, 0, 0.99))
f <- responses ~ age + income
MoE(x = x, formula = f, y = responses, data = covariates, stepsEM = 20)
Run the code above in your browser using DataLab