mape
Mean absolute percentage error between arrays
Syntax
Description
returns the mean absolute percentage
error (MAPE) between the forecast (predicted) array E
= mape(F
,A
)F
and the
actual (observed) array A
.
F
andA
must either be the same size or have sizes that are compatible.If
F
andA
are vectors of the same size, thenE
is a scalar.If
F-A
is a matrix, thenE
is a row vector containing the MAPE for each column.If
F
andA
are multidimensional arrays, thenE
contains the MAPE computed along the first array dimension of size greater than 1, with elements treated as vectors. The size ofE
in this dimension is 1, while the sizes of all other dimensions are the same as inF-A
.
specifies a weighting scheme E
= mape(___,Weight=W
)W
and returns the weighted MAPE. If
W
is a vector, its length must equal the length of the operating
dimension. If W
is a matrix or multidimensional array, it must have the
same dimensions as F
, A
, or F-A
.
You cannot specify a weighting scheme if you specify vecdim
or
"all"
.
Examples
Input Arguments
Output Arguments
More About
Tips
Zeros or small nonzero values in the actual data
A
might indicate that MAPE is not the appropriate metric to measure error forF
andA
Extended Capabilities
Version History
Introduced in R2022b