Learn R Programming

uGMAR (version 3.1.0)

plot.qrtest: Quantile residual tests for GMAR, StMAR or G-StMAR model

Description

quantileResidualTests performs quantile residual tests for GMAR, StMAR or G-StMAR model, testing normality, autocorrelation and conditional heteroscedasticity.

Usage

# S3 method for qrtest
plot(x, ...)

# S3 method for qrtest print(x, ..., digits = 3)

quantileResidualTests(gsmar, lagsAC = c(1, 2, 5, 10), lagsCH = lagsAC, nsimu = 2000, printRes = TRUE)

Arguments

x

object of class 'qrtest' created with the function quantileResidualTests.

...

graphical parameters passed to segments in plot.qrtest. Currectly not used in print.qrtest

digits

number of decimals to print

gsmar

object of class 'gsmar' created with the function fitGSMAR or GSMAR.

lagsAC

a numeric vector of positive integers specifying the lags for which autocorrelation is tested.

lagsCH

a numeric vector of positive integers specifying the lags for which conditional heteroscedasticity is tested.

nsimu

a positive integer specifying to how many simulated observations the covariance matrix Omega (see Kalliovirta (2012)) should be based on. If smaller than data size, then omega will be based on the given data.

printRes

a logical argument defining whether results should be printed or not.

Value

Returns an object of class 'qrtest' containing the test results in data frames. In the cases of autocorrelation and conditional heteroscedasticity tests, the returned object also contains the associated individual statistics and their standard errors, discussed by Kalliovirta (2012) at the pages 369-370.

Methods (by generic)

  • plot: plot p-values of the autocorrelation and conditional heteroskedasticity tests.

  • print: print method for class 'qrtest'

Suggested packages

Install the suggested package "gsl" for faster evaluations in the cases of StMAR and G-StMAR models. For large StMAR and G-StMAR models with large data the evaluations may take significantly long time without the package "gsl".

Details

For details about the quantile residual tests see the cited article by Kalliovirta (2012).

References

  • Galbraith, R., Galbraith, J. 1974. On the inverses of some patterned matrices arising in the theory of stationary time series. Journal of Applied Probability 11, 63-71.

  • Kalliovirta L. (2012) Misspecification tests based on quantile residuals. The Econometrics Journal, 15, 358-393.

  • 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 straight forward generalization with theoretical properties similar to GMAR and StMAR models.

See Also

fitGSMAR, GSMAR, diagnosticPlot, predict.gsmar, getOmega,

Examples

Run this code
# NOT RUN {
# GMAR model
fit12 <- fitGSMAR(data=logVIX, p=1, M=2, model="GMAR")
qrtest12 <- quantileResidualTests(fit12)
plot(qrtest12)

# Restricted GMAR model
fit12r <- fitGSMAR(logVIX, 1, 2, model="GMAR", restricted=TRUE)
qrtest12r <- quantileResidualTests(fit12r, lagsAC=1:10, nsimu=1)
plot(qrtest12r)

# Non-mixture version of StMAR model
fit11t <- fitGSMAR(logVIX, 1, 1, model="StMAR", ncores=1, ncalls=1)
quantileResidualTests(fit11t, lagsAC=c(1, 2, 5), nsimu=1, printRes=FALSE)

# G-StMAR model
fit12gs <- fitGSMAR(logVIX, 1, M=c(1, 1), model="G-StMAR")
quantileResidualTests(fit12gs, lagsAC=c(1, 3), lagsCH=1:2,
 nsimu=1, printRes=FALSE)

# GMAR model as a mixture of AR(2) and AR(1) models
constraints <- list(diag(1, ncol=2, nrow=2), as.matrix(c(1, 0)))
fit22c <- fitGSMAR(logVIX, 2, 2, constraints=constraints)
quantileResidualTests(fit22c, lagsAC=c(1, 3), nsimu=1, printRes=FALSE)
# }

Run the code above in your browser using DataLab