mape

Mean absolute percentage error between forecasts and actual values.

Category: Data Import and Analysis > Descriptive Statistics

Syntax

e = mape(F, A)

Average of |F - A| ./ |A|, expressed as a percentage.

Description

mape measures the typical size of the error relative to the actual value, which makes it easy to read: 5 means the forecasts are off by about 5 percent on average. Each term is divided by the actual value, so the measure is undefined when an actual value is zero and is dominated by errors on small values.

Use rmse when the error should be in the units of the data.

Input arguments

F
Forecast or estimated values.
A
Actual (reference) values, same size as F.

Output arguments

e
The error as a percentage. Smaller is better; 0 means a perfect match.

Example

Forecast error

actual   = [11 18 33];
forecast = [10 20 30];
e = mape(forecast, actual)
Output
e = 9.7643

See also

rmse mean abs rms