my.predictions {autoTS} | R Documentation |
Make predictions with selected algorithms
Description
Fit selected algorithms, make the predictions and combine the results along with observed data in one final dataframe.
Usage
my.predictions(
bestmod = NULL,
prepedTS = NULL,
algos = list("my.prophet", "my.ets", "my.sarima", "my.tbats", "my.bats", "my.stlm",
"my.shortterm"),
n_pred = NA
)
Arguments
bestmod |
A list produced by the |
prepedTS |
A list created by the |
algos |
A list containing the algorithms to be implemented. If |
n_pred |
Int number of periods to forecast forward (eg n_pred = 12 will lead to one year of prediction for monthly time series) |
Value
A dataframe containing : date, actual observed values, one column per used algorithm, and a column indicating the type of measure (mean prediction, upper or lower bound of CI)
Examples
library(lubridate)
library(dplyr)
dates <- seq(lubridate::as_date("2000-01-01"),lubridate::as_date("2010-12-31"),"quarter")
values <- 10+ 1:length(dates)/10 + rnorm(length(dates),mean = 0,sd = 10)
### Stand alone usage
prepare.ts(dates,values,"quarter") %>%
my.predictions(prepedTS = .,algos = list("my.prophet","my.ets"))
### Standard input with bestmodel
getBestModel(dates,values,freq = "quarter",n_test = 6) %>%
my.predictions()