Learn R Programming

⚠️There's a newer version (3.6.0) of this package.Take me there.

uGMAR

The goal of uGMAR is to provide tools to work with Gaussian Mixture Autoregressive (GMAR) and Student's t Mixture Autoregressive (StMAR) models. Most importantly it provides function fitGMAR for two phase maximum likelihood estimation, but it also contains tools for quantile residual based model diagnostics, forecasting and simulation for example. With uGMAR it's easy to apply general linear constraints to the autoregressive parameters or to restrict them to be the same for regimes.

Simple example

This is a basic example how to estimate a GMAR or StMAR model to data. I'll use example data "VIX" which comes with the package (for details see ?VIX). The estimation process is computationally heavy and uses parallel computing.

## Estimate GMAR(1, 2) model to VIX data
fit12 <- fitGMAR(data=VIX, p=1, M=2)

## Estimate StMAR(1, 1) model to VIX data
fit11t <- fitGMAR(data=VIX, p=1, M=1, StMAR=TRUE)

Vignette and about references

See vignette for more detailed introduction to the package and see the references for information about the models. Unfortunately there are not yet articles published considering the Student's t Mixture Autoregressive model. This package is based on working papers considering the model and the references will be updated after the papers have been published.

Copy Link

Version

Install

install.packages('uGMAR')

Monthly Downloads

441

Version

1.0.1

License

GPL-3

Maintainer

Savi Virolainen

Last Published

August 29th, 2017

Functions in uGMAR (1.0.1)

forecastGMAR

Forecast GMAR pr StMAR process
getOmega

Generate covariance matrix omega for quantile residual tests
checkConstraintMat

Check constraint matrices R
checkPM

Check p and M are correctly set
changeRegime

Change the specified regime of parameter vector to the given regime-parameter vector
checkAndCorrectData

Check the data is set correctly and correct if not
GAfit

Genetic algorithm for preliminary estimation of GMAR or StMAR model
VIX

CBOE Volatility Index: VIX
extractRegime

Extract regime from a parameter vector
fitGMAR

Estimate Gaussian or Student's t Mixture Autoregressive model
loglikelihood

Compute the log-likelihood of Gaussian or Student's t Mixture Autoregressive model
loglikelihood_int

Compute the log-likelihood of Gaussian or Student's t Mixture Autoregressive model
isStationary

Check the stationary condition of specified GMAR or StMAR model.
isStationary_int

Check the stationary and identification conditions of specified GMAR or StMAR model.
reformConstrainedPars

Reform parameter vector with linear constraints to correspond non-constrained parameter vector.
reformParameters

Reform any parameter vector into standard form.
mixingWeights

Calculate mixing weights of GMAR or StMAR model
mixingWeights_int

Calculate mixing weights of GMAR or StMAR model
quantileResiduals

Compute quantile residuals of GMAR or StMAR model
plotGMAR

Quantile residual based diagnostic plots for GMAR or StMAR model
quantileResidualTests

Quantile residual tests for GMAR or StMAR model
standardErrors

Calculate standard errors for estimates of GMAR or StMAR model
quantileResiduals_int

Compute quantile residuals of GMAR or StMAR model
simulateGMAR

Simulate GMAR or StMAR process
sortComponents

Sort the mixture components of GMAR or StMAR model
nParams

Calculate the number of parameters
parameterChecks

Check the parameter vector is specified correctly
randomIndividual

Create somewhat random GMAR or StMAR model compatible parameter vector
randomIndividual_int

Create random GMAR or StMAR model compatible parameter vector