MoE,mph-method | R Documentation |
Fit method for mph/miph class, using mixture-of-experts regression
## S4 method for signature 'mph'
MoE(
x,
formula,
y,
data,
alpha_mat = NULL,
delta = numeric(0),
stepsEM = 1000,
r = 1,
maxit = 100,
reltol = 1e-08,
rand_init = T
)
x |
An object of class mph. |
formula |
a regression formula. |
y |
A matrix of observations. |
data |
A data frame of covariates (they need to be scaled for the regression). |
alpha_mat |
Matrix with initial distribution vectors for each row of observations. |
delta |
Matrix with right-censoring indicators (1 uncensored, 0 right censored). |
stepsEM |
Number of EM steps to be performed. |
r |
Sub-sampling parameter, defaults to 1 (not supported for this method). |
maxit |
Maximum number of iterations when optimizing the g function (inhomogeneous likelihood). |
reltol |
Relative tolerance when optimizing g function. |
rand_init |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.