ljung_box_test,fEGarch_fit-method {fEGarch} | R Documentation |
Weighted Ljung-Box Test for Autocorrelation
Description
Apply a (weighted) Ljung-Box test (through the Gamma approximation) to check the standardized residuals of a fitted model from this package for remaining autocorrelation. Two different options allow to check either the simple residuals or the squared residuals.
Usage
## S4 method for signature 'fEGarch_fit'
ljung_box_test(
object,
m_max = 20,
weight_f = function(lag) {
m <- max(lag)
(m + 1 - lag)/m
},
adj_df = NULL,
silent = FALSE,
type = c("simple", "squared"),
...
)
Arguments
object |
an object |
m_max |
the maximum lag; tests will be conducted for 1 up to
|
weight_f |
a function with argument |
adj_df |
degrees of freedom to adjust for as a number or the default
|
silent |
a logical value reflecting whether or not test results should be printed in a well-formatted manner to the console. |
type |
either |
... |
currently without use. |
Value
Returns a numeric matrix invisibly.
Examples
window.zoo <- get("window.zoo", envir = asNamespace("zoo"))
rt <- window.zoo(SP500, end = "2002-12-31")
spec <- fEGarch_spec()
model <- fEGarch(spec, rt)
ljung_box_test(model)