get_metrics: Summarise Forecasting Models Errror Metrics

Description Usage Arguments Value Examples

View source: R/get_metrics.R

Description

Summarise the out-of-sample stocks forecasts by asset and time periods.

Usage

1
get_metrics(.tbl, .group, .truth, .forecast)

Arguments

.tbl

A tibble object..

.group

The column in which the data should be grouped. This will often be a column with stock tickers or stocks names.

.truth

The truth results of a time series realization.

.forecast

The out-of-sample forecasts from the chosen model.

Value

A tibble with the following summary statistics by asset: mse, rmse, mae, mape and mase.

Examples

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

get_tickers(dow) %>%
  slice(2:3) %>%
  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(.) %>%
  get_metrics(., tickers, adjusted, point_forecast)

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