ts_accuracy: Time series accuracy

Description Usage Arguments Value Examples

View source: R/ts_accuracy.R

Description

Calculates ME, MAE, MASE, Coverage, and Width for a time series tibble.

Usage

1
ts_accuracy(ts_df, lag = 1)

Arguments

ts_df

A tibble containing dates in column labeled 'ds' and values in column labeled 'y'. The point forecast should be in a column labeled 'yhat', and respective prediction intervals should be in columns labeled 'yhat_lower' and 'yhat_upper'.

lag

The lag to be used in calculating MASE, which should be the period of seasonality of the time series.

Value

A tibble with ME, MAE, MASE, Coverage, and Width columns.

Examples

1
2
3
4
5
6
7
8
df <- tidyr::tibble(
  ds = lubridate::today() - 100:1,
  y = rnorm(100),
  yhat = rnorm(100),
  yhat_lower = yhat - 1,
  yhat_upper = yhat + 1
)
ts_accuracy(df)

travisandersen14/tsfuncs documentation built on May 23, 2020, 12:38 a.m.