gBox: Generalized Portmanteau Tests for GARCH Models

View source: R/gBox.R

gBoxR Documentation

Generalized Portmanteau Tests for GARCH Models

Description

Perform a goodness-of-fit test for the GARCH model by checking whether the standardized residuals are iid based on the ACF of the absolute residuals or squared residuals.

Usage

gBox(model, lags = 1:20, x, method = c("squared", "absolute")[1], plot = TRUE)

Arguments

model

fitted model from the garch function of the tseries library

lags

a vector of maximum ACF lags to be used in the test

x

time series data to which the GARCH model is fitted

method

"squared": test is based on squared residuals; "absolute": test is based on absolute residuals

plot

logical variable, if TRUE, the p-values of the tests are plotted

Value

lags

lags in the input

pvalue

a vector of p-values of the tests

method

method used

x

x

Author(s)

Kung-Sik Chan

References

"Time Series Analysis, with Applications in R" by J.D. Cryer and K.S. Chan

Examples


require(tseries) # need to uncomment this line when running the example
data(CREF)
r.cref=diff(log(CREF))*100
m1=tseries::garch(x=r.cref,order=c(1,1))
summary(m1)
gBox(m1,x=r.cref,method='squared')


TSA documentation built on July 5, 2022, 5:05 p.m.