library(knitr)
knitr::opts_chunk$set(
    fig.align = "center",
    fig.height = 5.5,
    fig.width = 6,
    warning = FALSE,
    collapse = TRUE,
    dev.args = list(pointsize = 10),
    out.width = "90%",
    par = TRUE
)
knit_hooks$set(par = function(before, options, envir)
  { if (before && options$fig.show != "none") 
       par(family = "sans", mar = c(4.1,4.1,1.1,1.1), mgp = c(3,1,0), tcl = -0.5)
})
library(RMoE)

Introduction

PRMoE (Poisson Regularized Mixture-of-Experts) provides a penalized MLE for the regularized Poisson Mixture of Experts. PRMoE consists of a mixture of K Poisson expert regressors network) gated by a softmax gating network.

It was written in R Markdown, using the knitr package for production.

See help(package="RMoE") for further details.

Application to a simulated dataset

Load data

data("poisson")
X <- as.matrix(poisson[, -8])
y <- poisson$V8

Set up PRMoE model parameters

K <- 2 # Number of experts
Lambda <- 20
Gamma <- 10
opt <- FALSE # opt = FALSE: proximal Newton; opt = TRUE: proximal Newton-type

Estimation

prmoe <- PoissonRMoE(Xmat = X, Ymat = y, K = K, Lambda = Lambda, 
                   Gamma = Gamma, option = opt, verbose = TRUE)

Parameters

You can access to the parameters via the following commands:

# Regression coefficients for each expert
prmoe$betak

# Parameters of the gating network
prmoe$wk

Plot

Log-likelihood

prmoe$plot(what = "loglik")

Proportion of zero coefficients

prmoe$plot(what = "zerocoefficients")

Application to a real dataset

Load data

data("cleveland")
X <- as.matrix(cleveland[, -15])
y <- cleveland$V15

Set up PRMoE model parameters

K <- 2 # Number of experts
Lambda <- 10
Gamma <- 4
opt <- FALSE # opt = FALSE: proximal Newton; opt = TRUE: proximal Newton-type

Estimation

prmoe <- PoissonRMoE(Xmat = X, Ymat = y, K = K, Lambda = Lambda, 
                   Gamma = Gamma, option = opt, verbose = TRUE)

Parameters

You can access to the parameters via the following commands:

# Regression coefficients for each expert
prmoe$betak

# Parameters of the gating network
prmoe$wk

Plot

Log-likelihood

prmoe$plot(what = "loglik")

Proportion of zero coefficients

prmoe$plot(what = "zerocoefficients")


fchamroukhi/HDME documentation built on Nov. 4, 2019, 12:37 p.m.