Mean absolute percentage error


The mean absolute percentage error, also known as mean absolute percentage deviation, is a measure of prediction accuracy of a forecasting method in statistics, for example in trend estimation, also used as a loss function for regression problems in machine learning. It usually expresses the accuracy as a ratio defined by the formula:
where is the actual value and is the forecast value. The MAPE is also sometimes reported as a percentage, which is the above equation multiplied by 100. The difference between and is divided by the actual value again. The absolute value in this calculation is summed for every forecasted point in time and divided by the number of fitted points . Multiplying by 100% makes it a percentage error.

MAPE in regression problems

Mean absolute percentage error is commonly used as a loss function for regression problems and in model evaluation, because of its very intuitive interpretation in terms of relative error.

Definition

Consider a standard regression setting in which the data are fully described by a random pair with values in, and i.i.d. copies of. Regression models aims at finding a good model for the pair, that is a measurable function from to such that is close to.
In the classical regression setting, the closeness of to is measured via the risk, also called the mean squared error. In the MAPE regression context, the closeness of to is measured via the MAPE, and the aim of MAPE regressions is to find a model such that:
where is the class of models considered.
In practice
In practice can be estimated by the empirical risk minimization strategy, leading to
From a practical point of view, the use of the MAPE as a quality function for regression model is equivalent to doing weighted mean absolute error regression, also known as quantile regression. This property is trivial since
As a consequence, the use of the MAPE is very easy in practice, for example using existing libraries for quantile regression allowing weights.

Consistency

The use of the MAPE as a loss function for regression analysis is feasible both on a practical point of view and on a theoretical one, since the existence of an optimal model and the consistency of the empirical risk minimization can be proved.

Alternative MAPE definitions

Problems can occur when calculating the MAPE value with a series of small denominators. A singularity problem of the form 'one divided by zero' and/or the creation of very large changes in the Absolute Percentage Error, caused by a small deviation in error, can occur.
As an alternative, each actual value of the series in the original formula can be replaced by the average of all actual values of that series. This alternative is still being used for measuring the performance of models that forecast spot electricity prices.
Note that this is equivalent to dividing the sum of absolute differences by the sum of actual values, and is sometimes referred to as WAPE.

Issues

Although the concept of MAPE sounds very simple and convincing, it has major drawbacks in practical application, and there are many studies on shortcomings and misleading results from MAPE.
To overcome these issues with MAPE, there are some other measures proposed in literature: