Description Usage Arguments Details Value Methods (by generic) References See Also Examples
View source: R/quantileResidualTests.R
quantile_residual_tests
performs quantile residual tests for GMAR, StMAR,
and GStMAR models, testing normality, autocorrelation, and conditional heteroscedasticity
of the quantile residuals.
1 2 3 4 5 6 7 8 9 10 11 12 13 
x 
object of class 
... 
graphical parameters passed to 
digits 
the number of digits to be print 
gsmar 
a class 'gsmar' object, typically generated by 
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. 
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).
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 369370.
plot
: Plot pvalues of the autocorrelation and conditional
heteroskedasticity tests.
print
: Print method for class 'qrtest' objects
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, 6371.
Kalliovirta L. (2012) Misspecification tests based on quantile residuals. The Econometrics Journal, 15, 358393.
Kalliovirta L., Meitz M. and Saikkonen P. 2015. Gaussian Mixture Autoregressive model for univariate time series. Journal of Time Series Analysis, 36, 247266.
Meitz M., Preve D., Saikkonen P. 2021. A mixture autoregressive model based on Student's tdistribution. Communications in Statistics  Theory and Methods, doi: 10.1080/03610926.2021.1916531
Virolainen S. 2021. A mixture autoregressive model based on Gaussian and Student's tdistributions. Studies in Nonlinear Dynamics & Econometrics, doi: 10.1515/snde20200060
profile_logliks
, fitGSMAR
, GSMAR
, diagnostic_plot
,
predict.gsmar
, get_test_Omega
,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  ## The below examples take approximately 30 seconds to run.
# GStMAR model with one GMAR type and one StMAR type regime
fit42gs < fitGSMAR(data=M10Y1Y, p=4, M=c(1, 1), model="GStMAR",
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))

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.