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 getBestModel() function (optional if prepredTS is provided)

prepedTS

A list created by the prepare.ts() function (optional if bestmod provided)

algos

A list containing the algorithms to be implemented. If bestmod is supplied, this value is ignored, and taken from the best model object Using this option will overwrite the provided list of algorithms to implement them all

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()



[Package autoTS version 0.9.11 Index]