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

Description Usage Arguments Details Value Methods (by generic) References See Also Examples

View source: R/quantileResidualTests.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## 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.

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

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

Methods (by generic)

References

See Also

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

Examples

 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.

# 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))

uGMAR documentation built on Jan. 24, 2022, 5:10 p.m.