Main fitting function of LRMoE

FitLRMoE(
  Y,
  X,
  alpha_init,
  comp_dist,
  params_list,
  experts_init = NULL,
  exposure = NULL,
  exact_Y = FALSE,
  penalty = TRUE,
  pen_alpha = 5,
  pen_params = NULL,
  eps = 0.001,
  alpha_iter_max = 3,
  ecm_iter_max = 200,
  grad_jump = TRUE,
  grad_seq = NULL,
  print_steps = TRUE
)

Arguments

Y

A N by d (exact_Y=T) or N by 4d (exact_Y=F) matrix of numerics, where N is sample size and d is the dimension of each obsevation. If the size is N by 4d, Each block of four columns should be organized as (tl, yl, yu, tu), representing the truncation lower bound, censoring lower bound, censoring upper bound and truncation upper bound.

X

A N*P matrix of numerics, where P is the number of covariates. The first column of X should be 1, which is the intercept.

alpha_init

A g*P matrix of numerics, which contains initial guess of the logit regression coefficients. The last row should all be zero, representing the default latent class. If no initialization is provided, all coefficients are set to zero.

comp_dist

A d*g matrix of strings, which specify the component distributions to fit. The rows represent the dimensions of Y, while the columns represent the component distributions.

params_list

A d * g matrix of list with paramster names and values, which is the initial parameter guess for the corresponding comp_dist.

experts_init

An initialization of expert functions returned by cmm_init. Provide either experts_init or (comp_dist and params_init).

exposure

A vector of length N, representing the exposure of the observations (how long it has been observed).

exact_Y

TRUE/FALSE: whether Y is observed exactly, or with censoring and/or truncation.

penalty

TRUE/FALSE: whether the parameters are penalized for their magnitude. Default (and recommended) is TRUE.

pen_alpha

A numeric, which contains penalties for alpha_init. If penalty=T but no pen_alpha is provided, a constant is used.

pen_params

A list of length d, where each element is a sublist of length g. Each sublist contains one numeric vector, which is the corresponding penalty for params.init.

eps

Stopping criteria for loglikelihood convergence. Default is 1e-03.

alpha_iter_max

Maximum number of iterations for updating alpha. Defauls is 5.

ecm_iter_max

Maximum number of iterations for ECM. Default is 200.

grad_jump

TRUE/FALSE: whether to use an approximated gradient jump to speed up convergence.

grad_seq

How are the gradient sequence selected. Default is 2^(seq(8)-1)-1.

print_steps

TRUE/FALSE: whether paramater updates are printed on screen. Default is TRUE.