ae: Calculate absolute error between actual and forecast.

Description Usage Arguments Value Examples

View source: R/errors.R

Description

ae takes actual and forecast numeric vectors and returns a numeric vector where forecast is subtracted from the actual and then the absolute value is taken of those errors.

Usage

1
ae(y_true = NULL, y_pred = NULL, actual = NULL, forecast = NULL)

Arguments

y_true

Ground truth (correct) target values.

y_pred

Estimated target values.

actual

a numeric vector of actuals.

forecast

a numeric vector of forecasts.

Value

a numeric vector of absolute errors.

Examples

1
2
# Examples
ae(1:100, 100:1)

Example output

  [1] 99 97 95 93 91 89 87 85 83 81 79 77 75 73 71 69 67 65 63 61 59 57 55 53 51
 [26] 49 47 45 43 41 39 37 35 33 31 29 27 25 23 21 19 17 15 13 11  9  7  5  3  1
 [51]  1  3  5  7  9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49
 [76] 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99
Warning messages:
1: In ae(1:100, 100:1) : 'ae' is deprecated. Use 'absolute_error' instead.
2: In e(actual, forecast) :
  'e' is deprecated. Use 'absolute_error' instead.

scorer documentation built on May 2, 2019, 3:22 a.m.