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

View source: R/garch.R

garchR Documentation

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)

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

Value

replot_xts chart, xts data, or uGARCHfit fit

Author(s)

Philippe Cote

Examples

## Not run: 
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")

## End(Not run)

RTL documentation built on Oct. 21, 2023, 1:06 a.m.