Learn R Programming

bvhar (version 2.1.0)

mape: Evaluate the Model Based on MAPE (Mean Absolute Percentage Error)

Description

This function computes MAPE given prediction result versus evaluation set.

Usage

mape(x, y, ...)

# S3 method for predbvhar mape(x, y, ...)

# S3 method for bvharcv mape(x, y, ...)

Value

MAPE vector corresponding to each variable.

Arguments

x

Forecasting object

y

Test data to be compared. should be the same format with the train data.

...

not used

Details

Let \(e_t = y_t - \hat{y}_t\). Percentage error is defined by \(p_t = 100 e_t / Y_t\) (100 can be omitted since comparison is the focus).

$$MAPE = mean(\lvert p_t \rvert)$$

References

Hyndman, R. J., & Koehler, A. B. (2006). Another look at measures of forecast accuracy. International Journal of Forecasting, 22(4), 679-688.