View source: R/event_helpers.R
| fg_RegimeChange | R Documentation |
Wrapper around the function RegimeChange::detect_regimes() to create events for fgts_dygraph()
fg_RegimeChange(indta, usereturns = TRUE, series = NULL, ...)
indta |
Time series |
usereturns |
(default TRUE) LOgical to take log returns before changepoint calculations. |
series |
Which series in |
... |
Parameters passed to |
Event Helpers : fg_RegimeChange https://cran.r-project.org/web/packages/RegimeChange/vignettes/introduction.html
data.table suitable for passing into fgts_dygraph() via the event_ds parameter
if (requireNamespace("RegimeChange", quietly = TRUE)) {
dta <- tail(eqtypx[,.(date,QQQ,TLT)],260)
eventdt = fg_RegimeChange(dta,bootstrap_reps=50)
fgts_dygraph(dta,event_ds=eventdt,title="With Breakouts")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.