Computes \(\mathrm{RAFE} = \sqrt{(\hat\mu - \mu)^\top \Sigma^{-1} (\hat\mu - \mu)}\), the risk-adjusted distance between a forecast mean and the realised mean.
Usage
compute_rafe(
mu_hat,
mu,
Sigma = NULL,
Sigma_inv = NULL,
variant = c("none", "cc05", "cc0", "cv", "i")
)Arguments
- mu_hat
Numeric vector of forecast means.
- mu
Numeric vector of realised means (same length as
mu_hat).- Sigma
Realised covariance matrix. The argument order matches the paper's replication code, so
compute_rafe(mu_hat, mu, Sigma)does the same thing here as it does there.- Sigma_inv
Optional precision matrix, supplied instead of
Sigmawhen it is already available (it avoids an inversion). Must be a precision, not a covariance. Ignored unlessvariantis"none".- variant
Covariance restriction from the nested sequence of Section 3.3; see
restrict_cov()."i"returns the paper's RMSE.
Details
The metric is a Mahalanobis distance in the population-risk metric, with no \(1/N\) normalisation. Consequently, at \(\Sigma = I\) it reduces to the Euclidean norm of the forecast error, which is \(\sqrt{N}\) times the conventional RMSE — see the examples.
