mixARemFixedPoint: EM estimation for mixture autoregressive models

mixARemFixedPointR Documentation

EM estimation for mixture autoregressive models


Fit a mixture autoregressive model to a univariate time series using the EM algorithm.


mixARemFixedPoint(y, model, est_shift = TRUE, crit = 1e-14, 
                  maxniter = 200, minniter = 10, verbose = FALSE)

mixARgenemFixedPoint(y, model, crit = 1e-14, maxniter = 200, 
                     minniter = 10, verbose = FALSE, ...)



a univariate time series.


an object of class MixAR, a mixture autoregressive model providing the model specifications and initial values for the parameters.


if TRUE optimise also w.r.t. the shift (constant) terms of the AR components, if FALSE keep the shift terms fixed.


stop iterations when the relative change in the log-likelihood becomes smaller than this value.


maximum number of iterations.


minimum number of iterations, do at leat that many iterations.


further arguments to be passed on to the M-step optimiser.


print more details during optimisation.


mixARemFixedPoint and mixARgenemFixedPoint estimate MixAR models with the EM algorithm. For mixARemFixedPoint, the distribution of the components are fixed to be Gaussian. For mixARgenemFixedPoint, the distributions can, in principle be arbitrary (well, to a point).

Starting with model, the expectation and maximisation steps of the EM algorithm are repeated until convergence is detected or the maximum number of iterations, maxniter is exceeded.

Currently the convergence check is very basic—the iterations stop when the relative change in the log-likelihood in the last two iterations is smaller than the threshold value specified by crit and at least minniter iterations have been done.

The EM algorithm may converge very slowly. To do additional iterations use the returned value in another call of this function.


the fitted model as an object inheriting from "MixAR".


This function was not intended to be called directly by the user (hence the inconvenient name).


Georgi N. Boshnakov

See Also

fit_mixAR which uses these functions for estimation, classes "MixARGaussian", "MixARgen"


## data(ibmclose, package = "fma") # ibm data from BJ

m0 <- exampleModels$WL_ibm
m1 <- mixARemFixedPoint(fma::ibmclose, m0)
m1a <- mixARemFixedPoint(fma::ibmclose, m1$model)
show_diff(m1$model, m1a$model)

mixARemFixedPoint(fma::ibmclose, m0, est_shift = FALSE)

## simulate a continuation of ibmclose, assuming m0
ts1 <- mixAR_sim(m0, n = 50, init = c(346, 352, 357), nskip = 0)
m2a <- mixARemFixedPoint(ts1,       m0, est_shift = FALSE)$model
m2b <- mixARemFixedPoint(diff(ts1), m0, est_shift = FALSE)$model

mixAR documentation built on May 29, 2024, 6:21 a.m.