knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.align = "center", fig.path = "man/figures/README-" )
SNMoE (Skew-Normal Mixtures-of-Experts) provides a flexible modelling framework for heterogenous data with possibly skewed distributions to generalize the standard Normal mixture of expert model. SNMoE consists of a mixture of K skew-Normal expert regressors network (of degree p) gated by a softmax gating network (of degree q) and is represented by:
alpha
's of the softmax net.beta
's, scale parameters sigma
's, and the skewness
parameters lambda
's. SNMoE thus generalises mixtures of (normal,
skew-normal) distributions and mixtures of regressions with these
distributions. For example, when $q=0$, we retrieve mixtures of (skew-normal,
or normal) regressions, and when both $p=0$ and $q=0$, it is a mixture of
(skew-normal, or normal) distributions. It also reduces to the standard
(normal, skew-normal) distribution when we only use a single expert ($K=1$).Model estimation/learning is performed by a dedicated expectation conditional maximization (ECM) algorithm by maximizing the observed data log-likelihood. We provide simulated examples to illustrate the use of the model in model-based clustering of heterogeneous regression data and in fitting non-linear regression functions.
You can install the development version of SNMoE from GitHub with:
# install.packages("devtools") devtools::install_github("fchamroukhi/SNMoE")
To build vignettes for examples of usage, type the command below instead:
# install.packages("devtools") devtools::install_github("fchamroukhi/SNMoE", build_opts = c("--no-resave-data", "--no-manual"), build_vignettes = TRUE)
Use the following command to display vignettes:
browseVignettes("SNMoE")
library(SNMoE)
# Application to a simulated data set n <- 500 # Size of the sample alphak <- matrix(c(0, 8), ncol = 1) # Parameters of the gating network betak <- matrix(c(0, -2.5, 0, 2.5), ncol = 2) # Regression coefficients of the experts lambdak <- c(3, 5) # Skewness parameters of the experts sigmak <- c(1, 1) # Standard deviations of the experts x <- seq.int(from = -1, to = 1, length.out = n) # Inputs (predictors) # Generate sample of size n sample <- sampleUnivSNMoE(alphak = alphak, betak = betak, sigmak = sigmak, lambdak = lambdak, x = x) y <- sample$y K <- 2 # Number of regressors/experts p <- 1 # Order of the polynomial regression (regressors/experts) q <- 1 # Order of the logistic regression (gating network) snmoe <- emSNMoE(X = x, Y = y, K = K, p = p, q = q, verbose = TRUE) snmoe$summary() snmoe$plot()
# Application to a real data set data("tempanomalies") x <- tempanomalies$Year y <- tempanomalies$AnnualAnomaly K <- 2 # Number of regressors/experts p <- 1 # Order of the polynomial regression (regressors/experts) q <- 1 # Order of the logistic regression (gating network) snmoe <- emSNMoE(X = x, Y = y, K = K, p = p, q = q, verbose = TRUE) snmoe$summary() snmoe$plot()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.