get_forecasts: True Out-of-Sample Time Series Forecasting

Description Usage Arguments Value See Also Examples

View source: R/get_forecasts.R

Description

get_forecasts() extracts the true out-of-sample forecasts from an object previously fitted with get_models().

Usage

1
2
3
4
5
6
7
get_forecasts(.tbl, ...)

## Default S3 method:
get_forecasts(.tbl, ...)

## S3 method for class 'tbl_df'
get_forecasts(.tbl, ...)

Arguments

.tbl

A tidy tibble of the tbl_time class.

...

Additional parameters to be passed to forecast.

Value

A tidy tibble.

See Also

rolling_origin() forecast

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(YahooTickers)
library(dplyr)
library(forecast)

# Download and forecast time series using the "auto.arima"
# function from the forecast package
get_tickers(dow) %>%
  slice(1:2) %>%
  get_stocks(., periodicity = "monthly") %>%
  get_returns(., tickers, log, TRUE, adjusted) %>%
  get_models(., tickers, adjusted, 100, 1, FALSE, auto.arima,
             seasonal = FALSE, stationary = TRUE) %>%
  get_forecasts(.) # h = 1 because .assess = 1

Reckziegel/YahooTickers documentation built on Nov. 29, 2021, 9:45 p.m.