Learn R Programming

scorer (version 0.1.0)

ape: Calculate absolute percent error between actual and forecast.

Description

pe takes actual and forecast numeric vectors and returns a numeric vector where forecast is subtracted from the actual and then those errors are divided by the actuals. Lastly, the absolute value of those percent errors are taken.

Usage

ape(actual, forecast)

Arguments

actual
a numeric vector of actuals.
forecast
a numeric vector of forecasts.

Value

  • a numeric vector of absolute percent errors.

Examples

Run this code
# Examples
ape(1:100, 100:1)

Run the code above in your browser using DataLab