Description Usage Arguments Value
Fits a penalized mixture of experts model using the EM algorithm.
In the EM steps penalized logistic models are fitted using function glmnet
from glmnet is used.
1 2 3 4 5 6 | EMglmnet(y, X, colsGating = 1:ncol(X), colsExperts = 1:ncol(X), J = 2,
lambda, alpha = 1, standardize = FALSE,
type.multinomial = c("ungrouped", "grouped"), calculate.path = TRUE,
interceptGating = TRUE, interceptExperts = TRUE, offsetGating = NULL,
offsetExperts = NULL, iter.max = 100, tol = 1e-06,
init.weights = NULL, minprior = 0.05, sd.tol = 1e-04)
|
y |
A |
X |
A |
colsGating |
Names or indices of columns in |
colsExperts |
Names or indices of columns in |
J |
The number of experts / mixture components. Defaults to 2. |
lambda |
Penalty parameter. Can be a scalar or a vector of length |
alpha |
Mixing parameter for the elastic net penalty. Can be a scalar or a vector of length |
standardize |
Logical. Should the columns of |
type.multinomial |
If |
calculate.path |
Logical. Should paths for the gating and expert models be calculated after the EM algorithm terminated? These are based on the weights calculated in the last E step. |
interceptGating |
Logical. Does the gating model include an intercept?
Defaults to |
interceptExperts |
Logical. Does the expert model include an intercept?
Defaults to |
offsetGating |
Offset term for the gating model. |
offsetExperts |
Offset term for the expert model. |
iter.max |
Maximum number of EM iterations. |
tol |
Small positive value to detect convergence of the EM algorithm. |
init.weights |
An |
minprior |
Minimal relative size of experts. Defaults to 0.05. Experts which are smaller are removed. |
sd.tol |
Tolerance for detecting constant gating models, i.e., gating models not depending on the inputs and thus making constant predictions. |
An object of class EMglmnet
.
A list
with entries:
gating |
The gating model. An object of class |
experts |
A |
weights |
The final group membership values. |
iters |
The number of iterations in the EM algorithm. |
J,K, colsGating, colsExperts, lambda, offsetGating, offsetExperts |
See arguments. |
lev1 |
Class labels present in the data. |
lev |
Class labels. |
gatingPath |
Gating model fitted for a sequence of penalty parameters. An object of class |
expertsPath |
A |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.