compute_forecast_metrics: Compute MASE, sMAPE, and RMSE for a forecast

View source: R/metric_utils.R

compute_forecast_metricsR Documentation

Compute MASE, sMAPE, and RMSE for a forecast

Description

Compute MASE, sMAPE, and RMSE for a forecast

Usage

compute_forecast_metrics(actual_df, forecast_df, label = "Test")

Arguments

actual_df

A tibble with ds/y columns – the held-out actuals.

forecast_df

A tibble with ds/yhat columns – the forecast to evaluate.

label

Character scalar identifying this evaluation (shown as the Set column), e.g. "Test".

Value

A tibble with columns Set, Metric ("MASE", "sMAPE (%)", "RMSE"), and Value – NA for all three if fewer than 2 rows overlap.

Examples

ds <- as.Date("2024-01-01") + 0:9
actual_df <- tibble::tibble(ds = ds, y = 1:10)
forecast_df <- tibble::tibble(ds = ds, yhat = 1:10 + 0.5)
compute_forecast_metrics(actual_df, forecast_df, label = "Test")

forecastsuite documentation built on Oct. 18, 2026, 5:08 p.m.