Learn R Programming

RTL (version 1.3.7)

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

replot_xts chart, xts data, or uGARCHfit fit

Arguments

x

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

out

"chart" to return replot_xts chart, "data" to return xts data or "fit" for uGARCHfit 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