Description Usage Arguments Value Author(s) See Also Examples
APE()
calculates the average percentage error
1 | APE(obs, pred, response = .guessResponse(obs, pred), ...)
|
obs |
A numeric vector or matrix, the observed data. Can be continuous values or dicrete. Can be aggregated, and if so you must supply |
pred |
A numeric vector or matrix with predictions, in the same order as |
response |
(default |
... |
more arguments to be passed on to the fitting functions, see e.g. |
Absolute percentage error between obs
and pred
.
Jana B. Jarecki, jj@janajarecki.com, Florian Seitz
Other goodness of fit functions:
Accuracy()
,
MAPE()
,
MDAPE()
,
MSE()
,
RMSE()
,
SSE()
,
gof()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ### APE
# --------------------------------------------------------------------------
# First example from Gilliland, M. (2010).
# The business forecasting deal: exposing myths, eliminating bad practices,
# providing practical solutions (Vol. 27). John Wiley & Sons. (Exhibit A.3):
pred <- rep(1250, 6)
obs <- c(1150, 1400, 1200, 1350, 1100, 1300)
APE(obs, pred, response = "c")
obs <- diag(x = 1, ncol = 3, nrow = 3)
pred <- matrix(c(0.7, 0.2, 0.1,
0.3, 0.4, 0.3,
0.1, 0.1, 0.8), byrow = TRUE, nrow = 3)
APE(obs, pred, response = 'd')
obs <- 1:3
pred <- matrix(c(0.7, 0.2, 0.1,
0.3, 0.4, 0.3,
0.1, 0.1, 0.8), byrow = TRUE, nrow = 3)
APE(obs, pred, response = 'd')
obs <- diag(x = 1, ncol = 3, nrow = 3)
pred <- c(0.7, 0.4, 0.8)
APE(obs, pred, response = 'd')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.