fg_prophet: Forecast_Helpers

View source: R/forecast_helpers.R

fg_prophetR Documentation

Forecast_Helpers

Description

fg_prophet Augments a prophet::predict.prophet() output into fgts_dygraph() forecastdataset format.

Usage

fg_prophet(prophet_data, seriesname = "y")

Arguments

prophet_data

Data resulting from a prophet::predict.prophet() call

seriesname

(Default: "y") Series name to attach forecast to

Details

Note that prophet::predict.prophet() loses the name of the series, the

Value

data.table suitable for passing into fgts_dygraph() via the forecastdataset parameter

Examples

if (requireNamespace("prophet", quietly = TRUE)) {
p_model <- eqtypx[,.(ds=date,y=QQQ)] |> narrowbydtstr(dtstr="-1y::") |> prophet::prophet()
p_fcst <- predict(p_model,prophet::make_future_dataframe(p_model,periods=60))
fgts_dygraph(eqtypx[,.(date,QQQ)],title="With Prophet Forecasts", roller=1,dtstartfrac=0.8,
      forecast_ds=fg_prophet(p_fcst,seriesname="QQQ"))
}

FinanceGraphs documentation built on June 22, 2026, 5:08 p.m.