# solarforecastarbiter.metrics.deterministic.relative_euclidean_distance¶

solarforecastarbiter.metrics.deterministic.relative_euclidean_distance(obs, fx)[source]

Relative Euclidean distance (D):

$\text{D} = \sqrt{ \left( \frac{\overline{\text{fx}} - \overline{\text{obs}} } { \overline{\text{obs}} } \right) ^ 2 + \left( \frac{\sigma_{\text{fx}} - \sigma_{\text{obs}} } { \sigma_{\text{obs}} } \right) ^ 2 + \left( \textrm{corr} - 1 \right) ^ 2 }$

where:

• $$\overline{\text{fx}}$$ is the forecast mean
• $$\overline{\text{obs}}$$ is the observation mean
• $$\sigma_{\text{fx}}$$ is the forecast standard deviation
• $$\sigma_{\text{obs}}$$ is the observation standard deviation
• $$\textrm{corr}$$ is the Pearson correlation coefficient

Described in [1]

Parameters: obs ((n,) array-like) – Observed values. fx ((n,) array-like) – Forecasted values. d (float) – The relative Euclidean distance of the forecast.

Examples

>>> relative_euclidean_distance(np.array([0, 1]), np.array([1, 2]))
2.0
# observation mean is 0, forecast mean is not 0. d --> inf
>>> relative_euclidean_distance(np.array([-1, 1]), np.array([2, 3]))
np.Inf
# both forecast and observation mean are 0. d is finite
>>> relative_euclidean_distance(np.array([-2, 2]), np.array([3, -3]))
2.0615528128088303
# variance of observation or forecast is 0. d --> nan
>>> relative_euclidean_distance(np.array([1, 1]), np.array([2, 3])
np.NaN


References

 [1] Wu et al. Journal of Geophysical Research : Atmospheres 117, D12202, doi: 10.1029/2011JD016971 (2012)