Learn R Programming

'mixAR' is an R package for time series modelling with mixture autoregressive and related models.

Installing mixAR

Install the latest stable version from CRAN:

install.packages("mixAR")

Alternatively, install the development version of mixAR from Github:

remotes::install_github("GeoBosh/mixAR")

Overview

Package mixAR provides functions for modelling with mixture autoregressive (MAR/mixAR) models.

See, for example, the overview of mixAR and model fitting functions such as fit_mixAR and bayes_mixAR.

Copy Link

Version

Install

install.packages('mixAR')

Monthly Downloads

267

Version

0.22.9

License

GPL (>= 2)

Maintainer

Georgi Boshnakov

Last Published

December 16th, 2025

Functions in mixAR (0.22.9)

MixARGaussian-class

mixAR models with Gaussian noise components
bayes_mixAR

Bayesian sampling of mixture autoregressive models
MixARgen-class

Class "MixARgen"
MixVARGaussian-class

MixVAR models with multivariate Gaussian noise components
adjustLengths

Adjust the length of the second argument to be the same as that of the first one
MixVAR-class

Class "MixVAR" --- mixture vector autoregressive models
MixComp-class

Class "MixComp" --- manipulation of MixAR time series
MixAR-class

Class "MixAR" --- mixture autoregressive models
PortfolioData1

Closing prices of four stocks
em_est_dist

Optimise scale parameters in MixARgen models
bx_dx

RJMCMC move for AR order selection of mixture autoregressive models
dist_norm

Functions for the standard normal distribution
em_est_sigma

Update the scale parameters of MixAR models
est_templ

Create estimation templates from MixAR model objects
cond_loglik

Log-likelihood of MixAR models
companion_matrix

Create a companion matrix from a vector
exampleModels

MixAR models for examples and testing
em_rinit

Gaussian EM-step with random initialisation
Choose_pk

Choose the autoregressive order of MixAR components
err_k

Utility function for MixAR
fit_mixAR-methods

Fit mixture autoregressive models
mixAR-internal

Internal mixAR Functions
get_edist-methods

Methods for function get_edist in package mixAR
err

Calculate component specific error terms under MixAR model
mixAR-methods

Create MixAR objects
initialize-methods

Methods for function initialize in package mixAR
make_fcond_lik-methods

Create a function for computation of conditional likelihood
fnoise

Generator functions for noise distributions
inner

Generalised inner product and methods for class "MixComp"
mixSARfit

Fit mixture autoregressive models with seasonal AR parameters
isStable

Check if a MixAR model is stable
mixMstep

Internal functions for estimation of MixAR models with Gaussian components
label_switch

A posteriori relabelling of a Markov chain
mixARemFixedPoint

EM estimation for mixture autoregressive models
lik_params

Vector of parameters of a MixAR model
fit_mixARreg-methods

Fit time series regression models with mixture autoregressive residuals
mixVARfit

Fit mixture vector autoregressive models
mixAR_switch

Relabel the components of a MixAR model
lastn

Extract the last n elements of a vector
mix_location-methods

Conditional mean of MixAR models
mixARnoise_sim

Simulate white noise series from a list of functions and vector of regimes
em_tau

Compute probabilities for the observations to belong to each of the components
mixAR_diag

Diagnostic checks for mixture autoregressive models
mix_central_moment-methods

Methods for mix_central_moment
fit_mixVAR-methods

Fit mixture vector autoregressive models
lik_params_bounds

Give natural limits for parameters of a MixAR model.
marg_loglik

Calculate marginal loglikelihood at high density points of a MAR model.
mixFilter

Filter time series with MixAR filters
mixgenMstep

M-step for models from class MixARgen
mixAR_sim

Simulate from MixAR models
multiStep_dist-methods

Multi-step predictions for MixAR models
mixAR-package

require("mixAR") pd <- packageDescription("mixAR") lb <- library(help="mixAR", character.only=TRUE) lbinfo <- if(!is.null(lb$info[[2]])) lb$info[[2]] else "No_matches" anypat <- function(string, pat, ...){ any(sapply(pat, function(x) grepl(x, string, ...))) } lbsubset <- function(lbinfo, pat){ if(length(lbinfo) == 0) return("No entries") ind.start <- which(sapply(lbinfo, function(x) anypat(x, pat))) if(length(ind.start) == 0) return("No entries") ind.ws <- which(grepl("^[[:space:]]+", lbinfo)) res <- ind.start for(ind in ind.start){ while(any((ind+1) - ind.ws == 0)){ ind <- ind + 1 res <- c(res, ind) } } lbinfo[ sort(res) ] } lbpaste <- function(pat) paste("\\preformatted{", {wrk <- lbsubset(lbinfo,pat); wrk <- gsub("(^[^\\]?%)|(([^\\])%)", paste0("\\3", "\\\\", "%"), wrk); paste(if(length(wrk) > 0) wrk else "No entries", collapse="\n")}, "}", sep="") pd$Title
mix_moment-methods

Methods for mix_moment
noise_dist

Internal mixAR functions
noise_dist-methods

Methods for function noise_dist in package mixAR
percent_of

Infix operator to apply functions to matrix-like objects
mixARExperiment

Simulation experiments with MixAR models
mix_ncomp-methods

Number of rows or columns of a MixComp object
raggedCoefS-class

Class "raggedCoefS" --- ragged list
randomArCoefficients

Random initial values for MixAR estimation
mixAR_BIC

BIC based model selection for MixAR models
noise_rand-methods

Methods for function noise_rand in package mixAR
mix_variance-methods

Methods for mix_variance
mix_ek

Function and methods to compute component residuals for MixAR models
permn_cols

All permutations of the columns of a matrix
stdnormmoment

Compute moments and absolute moments of standardised-t and normal distributions
tau2probhat

Estimate probabilities of a MixAR model from tau.
raggedCoefV-class

Class "raggedCoefV" --- ragged list
predict_coef

Exact predictive parameters for multi-step MixAR prediction
mix_hatk

Compute component predictions for MixAR models
ragged

Small utilities for ragged objects
mixAR_cond_probs

The E-step of the EM algorithm for MixAR models
raghat1

Filter a time series with options to shift and scale
unswitch

Dealing with label switching in MixAR experiments
mixSubsolve

Support for EM estimation of MixAR models, internal function.
parameters

Set or extract the parameters of MixAR objects
mix_se-methods

Compute standard errors of estimates of MixAR models
show_diff

Show differences between two models
ragged2char

Convert a ragged list into a matrix of characters
mix_moment

Conditional moments of MixAR models
noise_moment-methods

Compute moments of the noise components
mix_qf-methods

Conditional quantile functions of MixAR models
noise_params-methods

Methods for function noise_params in package mixAR
mixVAR_sim

Simulate from multivariate MixAR models
mix_pdf-methods

Conditional pdf's and cdf's of MixAR models
.canonic_coef

Put core MixAR coefficients into a canonical form, internal function
row_lengths-methods

Methods for function row_lengths in package mixAR
sampZpi

Sampling functions for Bayesian analysis of mixture autoregressive models
simuExperiment

Perform simulation experiments
ui

Utility function for mixAR
tomarparambyComp

Translations of my old MixAR Mathematica functions
raggedCoef-class

Class "raggedCoef" --- ragged list objects
test_unswitch

A test for 'unswitch'