EMlnet: Penalized Mixtures of Experts

Description Usage Arguments Value

Description

Fits a penalized mixture of experts model using the EM algorithm. In the EM steps penalized linear models are fitted using function glmnet from glmnet is used.

Usage

1
2
3
4
EMlnet(y, X, colsGating = 1:ncol(X), colsExperts = 1:ncol(X), J = 2,
  lambda, alpha = 1, standardize = FALSE, interceptGating = TRUE,
  interceptExperts = TRUE, offsetGating = NULL, offsetExperts = NULL,
  iter.max = 100, tol = 1e-06, init.weights = NULL)

Arguments

y

A factor specifying the class membership for each observation.

X

A matrix or data.frame or Matrix containing the explanatory variables (must not contain an intercept column).

colsGating

Names or indices of columns in X to be used for the gating model. Default is all columns.

colsExperts

Names or indices of columns in X to be used for the expert models. Default is all columns.

J

The number of experts / mixture components. Defaults to 2.

lambda

Penalty parameter. Can be a scalar or a vector of length J+1 with different components for the J experts and the gating model. All components must be >= 0.

alpha

Mixing parameter for the elastic net penalty. Can be a scalar or a vector of length J+1 with different components for the J experts and the gating model. All components must be in [0,1]. Defaults to 1.

standardize

Logical. Should the columns of X be standardized prior to fitting the model?

interceptGating

Logical. Does the gating model include an intercept? Defaults to TRUE.

interceptExperts

Logical. Does the expert model include an intercept? Defaults to TRUE.

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 nrow(X) times J matrix containing initial group membership values for the EM algorithm. The row sums must be 1. Defaults to NULL, which means that initial weights will be obtained by random segmentation.

Value

An object of class EMlnet. A list with entries:

gating

The gating model. An object of class glmnet.

experts

A list of J expert models. These are objects of class glmnet

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.


schiffner/EMnet documentation built on May 29, 2019, 3:38 p.m.