Learn R Programming

uGMAR (version 3.0.1)

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 heteroscedasticy.

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' generated by 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', generated by 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 heteroscedasticy is tested.

nsimu

a positive integer specifying to how many simulated observations the covariance matrix Omega 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.

  • Lutkepohl H. 2005. New Introduction to Multiple Time Series Analysis. Springer.

  • 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,

Examples

Run this code
# NOT RUN {
# GMAR model
params12 <- c(1.12, 0.91, 0.29, 4.53, 0.70, 3.21, 0.84)
gmar12 <- GSMAR(VIX, 1, 2, params12)
qrtest12 <- quantileResidualTests(gmar12)
plot(qrtest12)

# Restricted GMAR model
params12r <- c(1.4, 1.8, 0.88, 0.29, 3.18, 0.84)
gmar12r <- GSMAR(data=VIX, p=1, M=2, params=params12r, model="GMAR",
 restricted=TRUE)
qrtest12r <- quantileResidualTests(gmar12r, lagsAC=1:10, nsimu=1)
plot(qrtest12r)

# StMAR model
params12t <- c(1.38, 0.88, 0.27, 3.8, 0.74, 3.15, 0.8, 100, 3.6)
stmar12 <- GSMAR(data=VIX, p=1, M=2, params=params12t, model="StMAR")
quantileResidualTests(stmar12, lagsAC=c(1, 2, 5), nsimu=1)

# G-StMAR model
params12gs <- c(1.38, 0.88, 0.27, 3.8, 0.74, 3.15, 0.8, 3.6)
gstmar12 <- GSMAR(data=VIX, p=1, M=c(1, 1), params=params12gs,
 model="G-StMAR")
quantileResidualTests(gstmar12, lagsAC=c(1, 3), lagsCH=1:2, nsimu=1)

# Such StMAR(3,2) that the AR coefficients are restricted to be
# the same for both regimes and that the second AR coefficients are
# constrained to zero.
params32trc <- c(2.2, 1.8, 0.88, -0.03, 2.4, 0.27, 0.40, 3.9, 1000)
stmar32rc <- GSMAR(data=VIX, p=3, M=2, params=params32trc, model="StMAR",
 restricted=TRUE, constraints=matrix(c(1, 0, 0, 0, 0, 1), ncol=2))
quantileResidualTests(stmar32rc, lagsAC=c(1, 3), nsimu=1)
# }

Run the code above in your browser using DataLab