quantile_residual_tests function

Quantile residual tests for GMAR, StMAR , and G-StMAR models

Quantile residual tests for GMAR, StMAR , and G-StMAR models

quantile_residual_tests performs quantile residual tests for GMAR, StMAR, and G-StMAR models, testing normality, autocorrelation, and conditional heteroscedasticity of the quantile residuals.

## S3 method for class 'qrtest' plot(x, ...) ## S3 method for class 'qrtest' print(x, ..., digits = 3) quantile_residual_tests( gsmar, lags_ac = c(1, 3, 6, 12), lags_ch = lags_ac, nsimu = 1, print_res = TRUE )

Arguments

  • x: object of class 'qrtest' created with the function quantile_residual_tests.
  • ...: graphical parameters passed to segments in plot.qrtest. Currently not used in print.qrtest
  • digits: the number of digits to be print
  • gsmar: a class 'gsmar' object, typically generated by fitGSMAR or GSMAR.
  • lags_ac: a numeric vector of positive integers specifying the lags for which autocorrelation is tested.
  • lags_ch: 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 and not on simulated data. Having the covariance matrix omega based on a large simulated sample might improve the tests size properties.
  • print_res: a logical argument defining whether the results should be printed or not.

Returns

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 in Kalliovirta (2012) at the pages 369-370.

Details

For a correctly specified GSMAR model employing the maximum likelihood estimator, the quantile residuals are asymptotically independent with standard normal distribution. They can hence be used in a similar manner to conventional Pearson's residuals. For more details about quantile residual based diagnostics, and in particular, about the quantile residual tests, see the cited article by Kalliovirta (2012).

Functions

  • plot(qrtest): Plot p-values of the autocorrelation and conditional heteroskedasticity tests.
  • print(qrtest): Print method for class 'qrtest' objects

Examples

## The below examples take approximately 30 seconds to run. # G-StMAR model with one GMAR type and one StMAR type regime fit42gs <- fitGSMAR(data=M10Y1Y, p=4, M=c(1, 1), model="G-StMAR", ncalls=1, seeds=4) # Tests based on the observed data (without simulation procedure) with the # default lags: qrt1 <- quantile_residual_tests(fit42gs) # Tests based on the simulation procedure using sample size 10000 and with # the lags specified by hand: set.seed(1) qrt2 <- quantile_residual_tests(fit42gs, lags_ac=c(1, 6), nsimu=10000) # GMAR model fit12 <- fitGSMAR(data=simudata, p=1, M=2, model="GMAR", ncalls=1, seeds=1) qrt3 <- quantile_residual_tests(fit12, lags_ac=c(1, 5, 10, 15))

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 (2), 247-266.
  • Meitz M., Preve D., Saikkonen P. 2023. A mixture autoregressive model based on Student's t-distribution. Communications in Statistics - Theory and Methods, 52 (2), 499-515.
  • Virolainen S. 2022. A mixture autoregressive model based on Gaussian and Student's t-distributions. Studies in Nonlinear Dynamics & Econometrics, 26 (4) 559-580.

See Also

profile_logliks, fitGSMAR, GSMAR, diagnostic_plot, predict.gsmar, get_test_Omega,

  • Maintainer: Savi Virolainen
  • License: GPL-3
  • Last published: 2025-04-07

Useful links