View source: R/metrics-quantile.R
| ae_median_quantile | R Documentation | 
Compute the absolute error of the median calculated as
  |\text{observed} - \text{median prediction}|
The median prediction is the predicted value for which quantile_level == 0.5.
The function requires 0.5 to be among the quantile levels in quantile_level.
ae_median_quantile(observed, predicted, quantile_level)
| observed | Numeric vector of size n with the observed values. | 
| predicted | Numeric nxN matrix of predictive
quantiles, n (number of rows) being the number of forecasts (corresponding
to the number of observed values) and N
(number of columns) the number of quantiles per forecast.
If  | 
| quantile_level | Vector of of size N with the quantile levels for which predictions were made. | 
Numeric vector of length N with the absolute error of the median.
 
Overview of required input format for quantile-based forecasts
ae_median_sample()
observed <- rnorm(30, mean = 1:30)
predicted_values <- replicate(3, rnorm(30, mean = 1:30))
ae_median_quantile(
  observed, predicted_values, quantile_level = c(0.2, 0.5, 0.8)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.