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

332

Version

0.22.8

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Georgi Boshnakov

Last Published

December 19th, 2023

Functions in mixAR (0.22.8)

bx_dx

RJMCMC move for AR order selection of mixture autoregressive models
companion_matrix

Create a companion matrix from a vector
em_tau

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

Log-likelihood of MixAR models
em_est_dist

Optimise scale parameters in MixARgen models
em_est_sigma

Update the scale parameters of MixAR models
dist_norm

Functions for the standard normal distribution
est_templ

Create estimation templates from MixAR model objects
isStable

Check if a MixAR model is stable
get_edist-methods

Methods for function get_edist in package mixAR
inner

Generalised inner product and methods for class "MixComp"
fit_mixARreg-methods

Fit time series regression models with mixture autoregressive residuals
fit_mixAR-methods

Fit mixture autoregressive models
exampleModels

MixAR models for examples and testing
initialize-methods

Methods for function initialize in package mixAR
mixAR-internal

Internal mixAR Functions
mixAR-methods

Create MixAR objects
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
label_switch

A posteriori relabelling of a Markov chain
fit_mixVAR-methods

Fit mixture vector autoregressive models
lastn

Extract the last n elements of a vector
mixARExperiment

Simulation experiments with MixAR models
mixAR_switch

Relabel the components of a MixAR model
mix_location-methods

Conditional mean of MixAR models
mixAR_sim

Simulate from MixAR models
mixAR_diag

Diagnostic checks for mixture autoregressive models
mixMstep

Internal functions for estimation of MixAR models with Gaussian components
mixVARfit

Fit mixture vector autoregressive models
fnoise

Generator functions for noise distributions
mix_central_moment-methods

Methods for mix_central_moment
lik_params

Vector of parameters of a MixAR model
mix_moment-methods

Methods for mix_moment
mixARemFixedPoint

EM estimation for mixture autoregressive models
mixSARfit

Fit mixture autoregressive models with seasonal AR parameters
mix_pdf-methods

Conditional pdf's and cdf's of MixAR models
mix_qf-methods

Conditional quantile functions of MixAR models
mix_ek

Function and methods to compute component residuals for MixAR models
lik_params_bounds

Give natural limits for parameters of a MixAR model.
mix_hatk

Compute component predictions for MixAR models
mixgenMstep

M-step for models from class MixARgen
marg_loglik

Calculate marginal loglikelihood at high density points of a MAR model.
make_fcond_lik-methods

Create a function for computation of conditional likelihood
mixFilter

Filter time series with MixAR filters
raggedCoefS-class

Class "raggedCoefS" --- ragged list
mixAR_BIC

BIC based model selection for MixAR models
mixAR_cond_probs

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

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

Conditional moments of MixAR models
ragged2char

Convert a ragged list into a matrix of characters
raggedCoefV-class

Class "raggedCoefV" --- ragged list
mix_ncomp-methods

Number of rows or columns of a MixComp object
noise_dist-methods

Methods for function noise_dist in package mixAR
mixSubsolve

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

Simulate from multivariate MixAR models
raghat1

Filter a time series with options to shift and scale
multiStep_dist-methods

Multi-step predictions for MixAR models
mix_se-methods

Compute standard errors of estimates of MixAR models
row_lengths-methods

Methods for function row_lengths in package mixAR
sampZpi

Sampling functions for Bayesian analysis of mixture autoregressive models
mix_variance-methods

Methods for mix_variance
noise_rand-methods

Methods for function noise_rand in package mixAR
noise_dist

Internal mixAR functions
parameters

Set or extract the parameters of MixAR objects
randomArCoefficients

Random initial values for MixAR estimation
percent_of

Infix operator to apply functions to matrix-like objects
raggedCoef-class

Class "raggedCoef" --- ragged list objects
noise_params-methods

Methods for function noise_params in package mixAR
noise_moment-methods

Compute moments of the noise components
ragged

Small utilities for ragged objects
predict_coef

Exact predictive parameters for multi-step MixAR prediction
test_unswitch

A test for 'unswitch'
show_diff

Show differences between two models
simuExperiment

Perform simulation experiments
permn_cols

All permutations of the columns of a matrix
tomarparambyComp

Translations of my old MixAR Mathematica functions
stdnormmoment

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

Utility function for mixAR
tau2probhat

Estimate probabilities of a MixAR model from tau.
.canonic_coef

Put core MixAR coefficients into a canonical form, internal function
unswitch

Dealing with label switching in MixAR experiments
MixVAR-class

Class "MixVAR" --- mixture vector autoregressive models
bayes_mixAR

Bayesian sampling of mixture autoregressive models
adjustLengths

Adjust the length of the second argument to be the same as that of the first one
Choose_pk

Choose the autoregressive order of MixAR components
MixAR-class

Class "MixAR" --- mixture autoregressive models
PortfolioData1

Closing prices of four stocks
MixARgen-class

Class "MixARgen"
MixARGaussian-class

mixAR models with Gaussian noise components
MixComp-class

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

Gaussian EM-step with random initialisation
MixVARGaussian-class

MixVAR models with multivariate Gaussian noise components
err_k

Utility function for MixAR
err

Calculate component specific error terms under MixAR model