Learn R Programming

gmvarkit (version 1.1.1)

plot.qrtest: Quantile residual tests

Description

quantile_residual_tests performs quantile residual tests described by Kalliovirta and Saikkonen 2010 for autocorrelation, conditional heteroskedasticity and normality.

Usage

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

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

quantile_residual_tests(gmvar, lags_ac = c(1:2, 4, 8), lags_ch = lags_ac, nsimu = 2000, print_res = TRUE)

Arguments

x

object of class 'qrtest' generated by the function quantile_residual_tests).

...

currently not used.

digits

number of decimals to print

gmvar

object of class 'gmvar' created with fitGMVAR or GMVAR.

lags_ac

a positive integer vector specifying the lags used to test autocorrelation.

lags_ch

a positive integer vector specifying the lags used to test conditional heteroskedasticity.

nsimu

to how many simulations should the covariance matrix Omega used in the qr-tests be based on? If smaller than sample size, then the covariance matrix will be evaluated from the sample. Larger number of simulations may result more reliable tests, but the computations become heavier.

print_res

should the test results be printed while computing the tests?

Value

Returns object of class 'qrtest' which has its own print method. The returned object is a list containing quantile residual test results for normality, autocorrelation and conditional heteroskedasticity. The autocorrelation and conditional heteroskedasticity results also contain the associated (vectorized) individual statistics divided by their standard errors (see Kalliovirta and Saikkonen 2010, s.17-20) under the label $ind_stats.

Methods (by generic)

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

  • print: print method for class 'qrtest'

References

  • Kalliovirta L., Meitz M. and Saikkonen P. 2016. Gaussian mixture vector autoregression. Journal of Econometrics, 192, 485-498.

  • Kalliovirta L. and Saikkonen P. 2010. Reliable Residuals for Multivariate Nonlinear Time Series Models. Unpublished Revision of HECER Discussion Paper No. 247.

See Also

fitGMVAR, GMVAR, quantile_residuals, diagnostic_plot, predict.gmvar

Examples

Run this code
# NOT RUN {
## These are long running examples that use parallel computing!

# These examples use the data 'eurusd' which comes with the
# package, but in a scaled form.
data <- cbind(10*eurusd[,1], 100*eurusd[,2])
colnames(data) <- colnames(eurusd)

# GMVAR(1,2) model with default settings
fit12 <- fitGMVAR(data, p=1, M=2)
qrtests12 <- quantile_residual_tests(fit12)
qrtests12
plot(qrtests12)

# GMVAR(2,2) model with mean parametrization
fit22 <- fitGMVAR(data, p=2, M=2, parametrization="mean")
qrtests22 <- quantile_residual_tests(fit22, nsimu=1)
qrtests22

# GMVAR(2,2) model with autoregressive parameters restricted
# to be the same for all regimes
C_mat <- rbind(diag(2*2^2), diag(2*2^2))
fit22c <- fitGMVAR(data, p=2, M=2, constraints=C_mat, ncalls=12)
qrtests22c <- quantile_residual_tests(fit22c, lags_ac=c(1, 4),
                nsimu=10000, print_res=TRUE)
qrtests22c
# }

Run the code above in your browser using DataLab