View source: R/CommonForecastingErrors.R
CommonForecastingErrors | R Documentation |
Calculate common forecasting errors
CommonForecastingErrors(TestdataY,ForecastingF,
epsilon=10^-4,na.rm=TRUE,stepsize=1,digits)
TestdataY |
[1:n] numerical vector of test data |
ForecastingF |
[1:n] numerical vector of forecast |
epsilon |
Optional, epsilon defining when zero values should be approximated. Default is 10^-4 |
na.rm |
Optional, removing missing values. Default is TRUE |
stepsize |
Optional, for mase. See |
digits |
Optional, number of digits for the output values to which the results will be scientifically rounded to (and not by R logic) |
MAE: Mean Absolute Error given as
\frac{1}{T} \sum_{t=1}^{T} |Y_t - F_t|
MAPE: Mean Absolute Percentage Error given as
\frac{1}{T} \sum_{t=1}^{T} |\frac{Y_t - F_t}{Y_t}|
SMAPE: Symmetric Mean Absolute Percentage Error given as
\frac{100}{T} * \frac{1}{T} \sum_{t=1}^{T} \frac{|Y_t-X_t|}{|X_t|+|Y_t|}
.
See also SMAPE
MASE: Mean Absolute Scaled Error given as
\frac{T}{T-s}*\frac{|Y_t - F_t|}{\sum_{t=s}^{T}|Y_t - Y_{t-s}|}
where s is the stepsize. See also mase
RMSE: Root Mean Square Error given as
\sqrt{\sum_{t=1}^{T} \frac{(Y_t - F_t)^2}{T}}
. See also rsme
BIAS: Value between -1 and 1 given as
1 - \frac{4}{\pi}\text{arctan}(\frac{b}{a})
,
where b
is the sum of all errors Y_t - F_t < 0
and a
is the sum of all errors Y_t - F_t \geq 0
.
See also RootDeviance
MRD: Mean Root Deviance given as
\frac{1}{T}\sum_{t=1}^{T}\sqrt{Y_t - F_t}
.
See also RootDeviance
Named vector with forecasting error values for:
'MAE','MAPE','SMAPE','MASE','RMSE','BIAS','MRD'
Michael Thrun
to be filled
Y=runif(10)
FOR=runif(10)
CommonForecastingErrors(Y,FOR)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.