emNMoE: emNMoE implements the EM algorithm to fit a Normal Mixture of Experts (NMoE).
Description
emNMoE implements the maximum-likelihood parameter estimation of a Normal
Mixture of Experts (NMoE) model by the Expectation-Maximization (EM)
algorithm.
emNMoE function implements the EM algorithm for the NMoE model. This
function starts with an initialization of the parameters done by the method
initParam of the class ParamNMoE, then it alternates between
the E-Step (method of the class StatNMoE) and the M-Step
(method of the class ParamNMoE) until convergence (until the
relative variation of log-likelihood between two steps of the EM algorithm
is less than the threshold parameter).
# NOT RUN {data(tempanomalies)
x <- tempanomalies$Year
y <- tempanomalies$AnnualAnomaly
nmoe <- emNMoE(X = x, Y = y, K = 2, p = 1, verbose = TRUE)
nmoe$summary()
nmoe$plot()
# }