# mape

## 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`

and`A`

must either be the same size or have sizes that are compatible.If

`F`

and`A`

are vectors of the same size, then`E`

is a scalar.If

`F-A`

is a matrix, then`E`

is a row vector containing the MAPE for each column.If

`F`

and`A`

are multidimensional arrays, then`E`

contains the MAPE computed along the first array dimension of size greater than 1, with elements treated as vectors. The size of`E`

in this dimension is 1, while the sizes of all other dimensions are the same as in`F-A`

.

specifies whether to include or omit `E`

= mape(___,`nanflag`

)`NaN`

values in `F`

and `A`

for any of the previous syntaxes. For example,
`mape(F,A,"omitnan")`

ignores `NaN`

values when
computing the MAPE. By default, `mape`

includes `NaN`

values.

specifies whether to include or omit zero values in `E`

= mape(___,`zeroflag`

)`A`

. For example,
`mape(F,A,"includezero")`

includes the zeros in the calculation, while
`mape(F,A,"omitzero")`

ignores them.

specifies a weighting scheme `E`

= mape(___,Weights=`W`

)`W`

and returns the weighted
MAPE.

## Examples

## Input 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 for`F`

and`A`

.

## Extended Capabilities

## Version History

**Introduced in R2022b**