geocat.comp.stats.nmse#
- geocat.comp.stats.nmse(observed, modeled)#
Calculate the normalized mean squared error metric of Williamson, 1995 as described in section 3 of “An Evaluation of the Large-Scale Atmospheric Circulation and Its Variability in CESM2 and Other CMIP Models” (Simpson et al., 2020).
\[NMSE(X_m) = \frac{\overline{(X_m - X_o)^2}}{\overline{(X'_o)^2}}\]where \(X_m\) is the modeled field, \(X_o\) is the observed field, \(X'_o\) is the weighted deviation of the observed field (\(X'_o = X_o - X_{wo}\)) and the overbar indicates a weighted spatial average.
The weights are calculated by:
\[weights = \cos(lat)\]and assumes regular spacing.
This implementation is based on Isla Simpson’s implementation in CASanalysis and CUPID.
- Parameters:
observed (
xarray.DataArrayorxarray.Dataset) – The observed field.modeled (
xarray.DataArrayorxarray.Dataset) – The modeled field. Must have the same dimensions as observed.
- Returns:
nmse (
xarray.DataArrayorxarray.Dataset) – The normalized mean squared error between the modeled and observed fields.