Learn R Programming

RTL (version 1.3.2)

garch: Wrapper for a Garch(1,1) returning either a plot or data.

Description

Computes annualised Garch(1,1) volatilities using fGarch package.

Usage

garch(x = x, out = TRUE)

Value

plot.xts object or xts series

Arguments

x

Wide dataframe with date column and single series (univariate).

out

"chart" to return chart, "data" to return data or "fit" for garch fit output

Author

Philippe Cote

Examples

Run this code
if (FALSE) {
x <- dflong %>% dplyr::filter(series == "CL01")
x <- returns(df = x, retType = "rel", period.return = 1, spread = TRUE)
x <- rolladjust(x = x, commodityname = c("cmewti"), rolltype = c("Last.Trade"))
summary(garch(x = x, out = "fit"))
garch(x = x, out = "chart")
garch(x = x, out = "data")
}

Run the code above in your browser using DataLab