Learn R Programming

fEGarch (version 1.0.1)

goodn_of_fit_test,fEGarch_fit-method: Adjusted Pearson Goodness-of-Fit Test for Standardized Model Residuals

Description

Consider a probability integral transform on the standardized residuals of a fitted model and apply a Pearson goodness-of-fit test to the binned data using a selection of predefined number of bins.

Usage

# S4 method for fEGarch_fit
goodn_of_fit_test(object, n_bins = c(20, 30, 40, 50), silent = FALSE, ...)

Value

Returns a numeric matrix invisibly.

Arguments

object

an object of class "fEGarch_fit" as returned by the fitting functions of this package like for example fEGarch.

n_bins

a numeric vector giving the number of bins to use.

silent

a logical indicating whether or not to print the test results in a well-formatted manner to the console.

...

currently without purpose.

Details

Use a probability integral transform on the standardized residuals of a fitted model. This is then the basis to conduct a Pearson goodness-of-fit chi-square test.

Examples

Run this code
window.zoo <- get("window.zoo", envir = asNamespace("zoo"))
rt <- window.zoo(SP500, end = "2002-12-31")
spec <- fEGarch_spec()
model <- fEGarch(spec, rt)
goodn_of_fit_test(model)

Run the code above in your browser using DataLab