Skip to contents

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

Value

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

Details

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

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"))
}
#> Disabling yearly seasonality. Run prophet with yearly.seasonality=TRUE to override this.
#> Disabling daily seasonality. Run prophet with daily.seasonality=TRUE to override this.