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), Student's t Mixture Autoregressive (StMAR) and Gaussian and Student's t Mixture Autoregressive (G-StMAR) models. G-StMAR is such model that some of its mixture components are similar to the ones that GMAR model uses and some similar to the ones that StMAR model uses. Most importantly uGMAR provides function fitGSMAR for two phase maximum likelihood estimation, but it also contains tools for quantile residual based model diagnostics, forecasting and simulations 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.

Example

This is a basic example how to estimate a GMAR, StMAR or G-StMAR model to data. The data "VIX", that is used in this example, 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 <- fitGSMAR(data=VIX, p=1, M=2)
fit12

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

## Estimate G-StMAR(1, 1, 1) model to VIX data
fit12gs <- fitGSMAR(data=VIX, p=1, M=c(1, 1), model="G-StMAR")
fit12gs

References

  • Kalliovirta L., Meitz M. and Saikkonen P. 2015. Gaussian Mixture Autoregressive model for univariate time series. Journal of Time Series Analysis, 36, 247-266.
  • Meitz M., Preve D., Saikkonen P. 2018. A mixture autoregressive model based on Student's t-distribution. arXiv:1805.04010 [econ.EM].
  • There are currently no published references for G-StMAR model, but it's a straightforward generalization with theoretical properties similar to GMAR and StMAR models.

Copy Link

Version

Install

install.packages('uGMAR')

Monthly Downloads

441

Version

3.0.1

License

GPL-3

Maintainer

Savi Virolainen

Last Published

September 22nd, 2018

Functions in uGMAR (3.0.1)

extractRegime

Extract regime from a parameter vector
reformConstrainedPars

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

Create random regime
all_pos_ints

Check whether all arguments are positive scalar whole numbers
pick_phi0

Pick phi0 or mean parameters from parameter vector
isStationary_int

Check the stationary and identification conditions of specified GMAR, StMAR or G-StMAR model.
iterate_more

Maximum likelihood estimation of GMAR, StMAR or G-StMAR model with preliminary estimates
pick_pars

Pick \(\phi_0\)/\(\mu\), AR-coefficients and variance parameters from parameter vector
checkAndCorrectData

Check the data is set correctly and correct if not
checkConstraintMat

Check the constraint matrices
check_gsmar

Check that given object has class attribute 'gsmar'
fitGMAR

fitGMAR is deprecated
checkPM

Check p and M are correctly set
fitGSMAR

Estimate Gaussian or Student's t Mixture Autoregressive model
quantileResiduals

Compute quantile residuals of GMAR, StMAR or G-StMAR model
check_model

Check that the argument model is correctly specified.
quantileResiduals_int

Compute quantile residuals of GMAR, StMAR or G-StMAR model
check_data

Check that given object contains data
check_params_length

Check that the parameter vector has the correct dimension
get_IC

Calculate AIC, HQIC and BIC
forecastGMAR

forecastGMAR is deprecated
regime_distance

Calculate "distance" between two regimes
get_regime_means

Calculate and return regime means \(\mu_{m}\)
isStationary

Check the stationary condition of specified GMAR, StMAR or G-StMAR model.
format_valuef

Function factory for value formatting
diagnosticPlot

Quantile residual based diagnostic plots for GMAR, StMAR and G-StMAR models
mixingWeights

Calculate mixing weights of GMAR, StMAR or G-StMAR model
get_ar_roots

Calculate absolute values of the roots of the AR characteristic polynomials
pick_alphas

Pick mixing weights parameters from parameter vector
removeAllConstraints

Transform constrainted and restricted parameter vector into the regular form
mixingWeights_int

Calculate mixing weights of GMAR, StMAR or G-StMAR model
randomIndividual

Create somewhat random GMAR, StMAR or G-StMAR model compatible parameter vector
randomIndividual_int

Create random GMAR, StMAR or G-StMAR model compatible parameter vector
getOmega

Generate covariance matrix Omega for quantile residual tests
nParams

Calculate the number of parameters
pick_dfs

Pick degrees of freedom parameters from parameter vector
parameterChecks

Check the parameter vector is specified correctly
reformParameters

Reform any parameter vector into standard form.
plot.gsmarpred

plot method for class 'gsmarpred' objects
plotGMAR

plotGMAR is deprecated
predict.gsmar

Forecast GMAR, StMAR or G-StMAR process
reformRestrictedPars

Reform parameter vector with restricted autoregressive parameters to correspond non-restricted parameter vector.
print.gsmarpred

print method for class 'gsmarpred' objects
simulateGMAR

simulateGMAR is deprecated
loglikelihood

Compute the log-likelihood of GMAR, StMAR or G-StMAR model
loglikelihood_int

Compute the log-likelihood of GMAR, StMAR or G-StMAR model
simulateGSMAR

Simulate values from GMAR, StMAR or G-StMAR process
print.gsmarsum

Print method from objects of class 'gsmarsum'
plot.qrtest

Quantile residual tests for GMAR, StMAR or G-StMAR model
sortComponents

Sort the mixture components of GMAR, StMAR or G-StMAR model
standardErrors

Calculate standard errors for estimates of GMAR, StMAR or GStMAR model
swap_parametrization

Swap the parametrization of object of class 'gsmar' defining a gsmar model
GSMAR

Create object of class 'gsmar' defining a GMAR, StMAR or G-StMAR model
calc_gradient

Calculate gradient or Hessian matrix
add_data

Add data to object of class 'gsmar' defining a GMAR, StMAR or G-StMAR model
changeRegime

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

Genetic algorithm for preliminary estimation of GMAR, StMAR or G-StMAR model
change_parametrization

Change parametrization of the parameter vector
VIX

CBOE Volatility Index: VIX
aa_uGMAR

uGMAR: Estimate Univariate Gaussian or Student's t Mixture Autoregressive Model
add_dfs

Add random dfs to a vector