monet.util.stats

Functions

AC(obs, mod[, axis])

Calculate Anomaly Correlation.

CSI(obs, mod, minval, maxval)

Critical Success Index (1 is perfect - Range 0 -> 1)

E1(obs, mod[, axis])

Modified Coefficient of Efficiency, E1

ETS(obs, mod, minval, maxval)

Equitable Threat Score (1 is perfect - Range -1/3 -> 1)

FB(obs, mod[, axis])

Fractional Bias (%)

FE(obs, mod[, axis])

Fractional Error (%)

HSS(obs, mod, minval, maxval)

Calculate Heidke Skill Score.

IOA(obs, mod[, axis])

Calculate the Index of Agreement (IOA).

IOA_m(obs, mod[, axis])

Index of Agreement, IOA (avoid single block error in np.ma)

MAE(obs, mod[, axis])

Mean absolute error.

MAPE(obs, mod[, axis])

Mean absolute percentage error.

MB(obs, mod[, axis])

Mean Bias

ME(obs, mod[, axis])

Mean Gross Error (model and obs unit)

MNB(obs, mod[, axis])

Mean Normalized Bias (%)

MNE(obs, mod[, axis])

Mean Normalized Gross Error (%)

MNPB(obs, mod, paxis[, axis])

Mean Normalized Peak Bias (%)

MNPE(obs, mod, paxis[, axis])

Mean Normalized Peak Error (%)

MO(obs, mod[, axis])

Mean Observations (obs unit)

MP(obs, mod[, axis])

Mean Predictions (model unit)

MSE(obs, mod[, axis])

Mean squared error.

MdnB(obs, mod[, axis])

Median Bias

MdnE(obs, mod[, axis])

Median Gross Error (model and obs unit)

MdnNB(obs, mod[, axis])

Median Normalized Bias (%)

MdnNE(obs, mod[, axis])

Median Normalized Gross Error (%)

MdnNPB(obs, mod, paxis[, axis])

Median Normalized Peak Bias (%)

MdnNPE(obs, mod, paxis[, axis])

Median Normalized Peak Bias (%)

MdnO(obs, mod[, axis])

Median Observations (obs unit)

MdnP(obs, mod[, axis])

Median Predictions (model unit)

NMB(obs, mod[, axis])

Normalized Mean Bias (%)

NMB_ABS(obs, mod[, axis])

Normalized Mean Bias - Absolute of the denominator (%)

NME(obs, mod[, axis])

Normalized Mean Error (%)

NME_m(obs, mod[, axis])

Normalized Mean Error (%) (avoid single block error in np.ma)

NME_m_ABS(obs, mod[, axis])

Normalized Mean Error (%) - Absolute of the denominator (avoid single block error in np.ma)

NMPB(obs, mod, paxis[, axis])

Normalized Mean Peak Bias (%)

NMPE(obs, mod, paxis[, axis])

Normalized Mean Peak Error (%)

NMdnB(obs, mod[, axis])

Normalized Median Bias (%)

NMdnE(obs, mod[, axis])

Normalized Median Error (%)

NMdnGE(obs, mod[, axis])

Normalized Median Gross Error (%)

NMdnPB(obs, mod, paxis[, axis])

Normalized Median Peak Bias (%)

NMdnPE(obs, mod, paxis[, axis])

Normalized Median Peak Bias (%)

NO(obs, mod[, axis])

N Observations (#)

NOP(obs, mod[, axis])

N Observations/Prediction Pairs (#)

NP(obs, mod[, axis])

N Predictions (#)

PSUTMNPB(obs, mod[, axis])

Paired Space/Unpaired Time Mean Normalized Peak Bias (%)

PSUTMNPE(obs, mod[, axis])

Paired Space/Unpaired Time Mean Normalized Peak Error (%)

PSUTMdnNPB(obs, mod[, axis])

Paired Space/Unpaired Time Median Normalized Peak Bias (%)

PSUTMdnNPE(obs, mod[, axis])

Paired Space/Unpaired Time Median Normalized Peak Error (%)

PSUTNMPB(obs, mod[, axis])

Paired Space/Unpaired Time Normalized Mean Peak Bias (%)

PSUTNMPE(obs, mod[, axis])

Paired Space/Unpaired Time Normalized Mean Peak Error (%)

PSUTNMdnPB(obs, mod[, axis])

Paired Space/Unpaired Time Normalized Median Peak Bias (%)

PSUTNMdnPE(obs, mod[, axis])

Paired Space/Unpaired Time Normalized Median Peak Error (%)

R2(obs, mod[, axis])

Calculate the coefficient of determination (R-squared).

RM(obs, mod[, axis])

Mean Ratio Observations/Predictions (none)

RMSE(obs, mod[, axis])

Root Mean Square Error (model unit)

RMSEs(obs, mod[, axis])

Root Mean Squared Error (obs, mod_hat)

RMSEu(obs, mod[, axis])

Root Mean Squared Error (mod_hat, mod)

RMdn(obs, mod[, axis])

Median Ratio Observations/Predictions (none)

SMAPE(obs, mod[, axis])

Symmetric mean absolute percentage error.

STDO(obs, mod[, axis])

Standard deviation of Observations

STDP(obs, mod[, axis])

Standard deviation of Predictions

USUTPB(obs, mod[, axis])

Unpaired Space/Unpaired Time Peak Bias (%)

USUTPE(obs, mod[, axis])

Unpaired Space/Unpaired Time Peak Error (%)

WDAC(obs, mod[, axis])

Wind Direction Anomaly Correlation

WDIOA(obs, mod[, axis])

Calculate Wind Direction Index of Agreement.

WDIOA_m(obs, mod[, axis])

Calculate wind direction Index of Agreement.

WDMB(obs, mod[, axis])

Wind Direction Mean Bias

WDMB_m(obs, mod[, axis])

Wind Direction Mean Bias (avoid single block error in np.ma)

WDME(obs, mod[, axis])

Wind Direction Mean Gross Error (model and obs unit)

WDME_m(obs, mod[, axis])

Wind Direction Mean Gross Error (model and obs unit) (avoid single block error in np.ma)

WDMdnB(obs, mod[, axis])

Wind Direction Median Bias

WDMdnE(obs, mod[, axis])

Wind Direction Median Gross Error (model and obs unit)

WDNMB_m(obs, mod[, axis])

Wind Direction Normalized Mean Bias (%) (avoid single block error in np.ma)

WDRMSE(obs, mod[, axis])

Wind Direction Root Mean Square Error (model unit)

WDRMSE_m(obs, mod[, axis])

Wind Direction Root Mean Square Error (model unit) (avoid single block error in np.ma)

circlebias(b)

Calculate circular bias.

circlebias_m(b)

Calculate circular bias avoiding single block error.

d1(obs, mod[, axis])

Modified Index of Agreement, d1

matchedcompressed(a1, a2)

Match masks and compress arrays to 1D.

matchmasks(a1, a2)

Match masks between two arrays.

scores(obs, mod, minval[, maxval])

Calculate multiple verification scores between obs and model.

stats(df, minval, maxval)

Short summary.

monet.util.stats.AC(obs, mod, axis=None)

Calculate Anomaly Correlation.

Parameters:
  • obs (numpy.ndarray) – Observed values

  • mod (numpy.ndarray) – Modeled values

  • axis (int, optional) – Axis along which to compute. Default is None (flatten array)

Returns:

Anomaly correlation coefficient

Return type:

float

monet.util.stats.CSI(obs, mod, minval, maxval)

Critical Success Index (1 is perfect - Range 0 -> 1)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • minval (type) – Description of parameter minval.

  • maxval (type) – Description of parameter maxval.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.E1(obs, mod, axis=None)

Modified Coefficient of Efficiency, E1

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.ETS(obs, mod, minval, maxval)

Equitable Threat Score (1 is perfect - Range -1/3 -> 1)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • minval (type) – Description of parameter minval.

  • maxval (type) – Description of parameter maxval.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.FB(obs, mod, axis=None)

Fractional Bias (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.FE(obs, mod, axis=None)

Fractional Error (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.HSS(obs, mod, minval, maxval)

Calculate Heidke Skill Score.

Parameters:
  • obs (numpy.ndarray) – Observed values

  • mod (numpy.ndarray) – Modeled values

  • minval (float) – Minimum threshold value for contingency table

  • maxval (float) – Maximum threshold value for contingency table

Returns:

Heidke Skill Score value

Return type:

float

monet.util.stats.IOA(obs, mod, axis=None)

Calculate the Index of Agreement (IOA).

Parameters:
  • obs (numpy.ndarray) – Observed values

  • mod (numpy.ndarray) – Modeled values

  • axis (int, optional) – Axis along which to calculate IOA. Default is None (flatten array)

Returns:

Index of Agreement value between 0 and 1, where 1 indicates perfect agreement

Return type:

float

monet.util.stats.IOA_m(obs, mod, axis=None)

Index of Agreement, IOA (avoid single block error in np.ma)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.MAE(obs, mod, axis=None)

Mean absolute error.

Parameters:
  • obs (array_like) – Observed values.

  • mod (array_like) – Modeled values.

  • axis (int, optional) – Axis along which to compute. Default is None (all axes).

Returns:

Mean absolute error value(s), in the same units as obs and mod.

Return type:

float or numpy.ndarray

monet.util.stats.MAPE(obs, mod, axis=None)

Mean absolute percentage error.

Parameters:
  • obs (array_like) – Observed values.

  • mod (array_like) – Modeled values.

  • axis (int, optional) – Axis along which to compute. Default is None (all axes).

Returns:

Mean absolute percentage error value(s), expressed as percent.

Return type:

float or numpy.ndarray

Notes

Elements where obs == 0 are masked and excluded from the mean.

monet.util.stats.MB(obs, mod, axis=None)

Mean Bias

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.ME(obs, mod, axis=None)

Mean Gross Error (model and obs unit)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.MNB(obs, mod, axis=None)

Mean Normalized Bias (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.MNE(obs, mod, axis=None)

Mean Normalized Gross Error (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.MNPB(obs, mod, paxis, axis=None)

Mean Normalized Peak Bias (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • paxis (type) – Description of parameter paxis.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.MNPE(obs, mod, paxis, axis=None)

Mean Normalized Peak Error (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • paxis (type) – Description of parameter paxis.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.MO(obs, mod, axis=None)

Mean Observations (obs unit)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.MP(obs, mod, axis=None)

Mean Predictions (model unit)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.MSE(obs, mod, axis=None)

Mean squared error.

Parameters:
  • obs (array_like) – Observed values.

  • mod (array_like) – Modeled values.

  • axis (int, optional) – Axis along which to compute. Default is None (all axes).

Returns:

Mean squared error value(s), in squared units of obs and mod.

Return type:

float or numpy.ndarray

monet.util.stats.MdnB(obs, mod, axis=None)

Median Bias

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.MdnE(obs, mod, axis=None)

Median Gross Error (model and obs unit)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.MdnNB(obs, mod, axis=None)

Median Normalized Bias (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.MdnNE(obs, mod, axis=None)

Median Normalized Gross Error (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.MdnNPB(obs, mod, paxis, axis=None)

Median Normalized Peak Bias (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • paxis (type) – Description of parameter paxis.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.MdnNPE(obs, mod, paxis, axis=None)

Median Normalized Peak Bias (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • paxis (type) – Description of parameter paxis.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.MdnO(obs, mod, axis=None)

Median Observations (obs unit)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.MdnP(obs, mod, axis=None)

Median Predictions (model unit)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.NMB(obs, mod, axis=None)

Normalized Mean Bias (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.NMB_ABS(obs, mod, axis=None)

Normalized Mean Bias - Absolute of the denominator (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.NME(obs, mod, axis=None)

Normalized Mean Error (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.NME_m(obs, mod, axis=None)

Normalized Mean Error (%) (avoid single block error in np.ma)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.NME_m_ABS(obs, mod, axis=None)

Normalized Mean Error (%) - Absolute of the denominator (avoid single block error in np.ma)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.NMPB(obs, mod, paxis, axis=None)

Normalized Mean Peak Bias (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • paxis (type) – Description of parameter paxis.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.NMPE(obs, mod, paxis, axis=None)

Normalized Mean Peak Error (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • paxis (type) – Description of parameter paxis.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.NMdnB(obs, mod, axis=None)

Normalized Median Bias (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.NMdnE(obs, mod, axis=None)

Normalized Median Error (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.NMdnGE(obs, mod, axis=None)

Normalized Median Gross Error (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.NMdnPB(obs, mod, paxis, axis=None)

Normalized Median Peak Bias (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • paxis (type) – Description of parameter paxis.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.NMdnPE(obs, mod, paxis, axis=None)

Normalized Median Peak Bias (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • paxis (type) – Description of parameter paxis.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.NO(obs, mod, axis=None)

N Observations (#)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.NOP(obs, mod, axis=None)

N Observations/Prediction Pairs (#)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.NP(obs, mod, axis=None)

N Predictions (#)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.PSUTMNPB(obs, mod, axis=None)

Paired Space/Unpaired Time Mean Normalized Peak Bias (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.PSUTMNPE(obs, mod, axis=None)

Paired Space/Unpaired Time Mean Normalized Peak Error (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.PSUTMdnNPB(obs, mod, axis=None)

Paired Space/Unpaired Time Median Normalized Peak Bias (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.PSUTMdnNPE(obs, mod, axis=None)

Paired Space/Unpaired Time Median Normalized Peak Error (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.PSUTNMPB(obs, mod, axis=None)

Paired Space/Unpaired Time Normalized Mean Peak Bias (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.PSUTNMPE(obs, mod, axis=None)

Paired Space/Unpaired Time Normalized Mean Peak Error (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.PSUTNMdnPB(obs, mod, axis=None)

Paired Space/Unpaired Time Normalized Median Peak Bias (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.PSUTNMdnPE(obs, mod, axis=None)

Paired Space/Unpaired Time Normalized Median Peak Error (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.R2(obs, mod, axis=None)

Calculate the coefficient of determination (R-squared).

Computes R-squared statistic between observed and modeled values.

Parameters:
  • obs (numpy.ndarray) – Observed values

  • mod (numpy.ndarray) – Modeled values

  • axis (int, optional) – Axis along which to compute R-squared. Default is None (whole array).

Returns:

R-squared value(s). If axis=None, returns a float. Otherwise returns array of R-squared values along specified axis.

Return type:

float or numpy.ndarray

monet.util.stats.RM(obs, mod, axis=None)

Mean Ratio Observations/Predictions (none)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.RMSE(obs, mod, axis=None)

Root Mean Square Error (model unit)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.RMSEs(obs, mod, axis=None)

Root Mean Squared Error (obs, mod_hat)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.RMSEu(obs, mod, axis=None)

Root Mean Squared Error (mod_hat, mod)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.RMdn(obs, mod, axis=None)

Median Ratio Observations/Predictions (none)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.SMAPE(obs, mod, axis=None)

Symmetric mean absolute percentage error.

Parameters:
  • obs (array_like) – Observed values.

  • mod (array_like) – Modeled values.

  • axis (int, optional) – Axis along which to compute. Default is None (all axes).

Returns:

Symmetric mean absolute percentage error value(s), expressed as percent.

Return type:

float or numpy.ndarray

Notes

Elements where abs(obs) and abs(mod) are both zero are masked and excluded from the mean.

monet.util.stats.STDO(obs, mod, axis=None)

Standard deviation of Observations

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.STDP(obs, mod, axis=None)

Standard deviation of Predictions

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.USUTPB(obs, mod, axis=None)

Unpaired Space/Unpaired Time Peak Bias (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.USUTPE(obs, mod, axis=None)

Unpaired Space/Unpaired Time Peak Error (%)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.WDAC(obs, mod, axis=None)

Wind Direction Anomaly Correlation

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.WDIOA(obs, mod, axis=None)

Calculate Wind Direction Index of Agreement.

Parameters:
  • obs (numpy.ndarray) – Observed wind direction values (degrees)

  • mod (numpy.ndarray) – Modeled wind direction values (degrees)

  • axis (int, optional) – Axis along which to compute. Default is None (flatten array)

Returns:

Wind Direction Index of Agreement value

Return type:

float

monet.util.stats.WDIOA_m(obs, mod, axis=None)

Calculate wind direction Index of Agreement.

Modified version that handles circular nature of wind direction.

Parameters:
  • obs (numpy.ndarray) – Observed wind directions

  • mod (numpy.ndarray) – Modeled wind directions

  • axis (int, optional) – Axis along which to compute

Returns:

Wind direction IOA value(s)

Return type:

float or numpy.ndarray

monet.util.stats.WDMB(obs, mod, axis=None)

Wind Direction Mean Bias

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.WDMB_m(obs, mod, axis=None)

Wind Direction Mean Bias (avoid single block error in np.ma)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.WDME(obs, mod, axis=None)

Wind Direction Mean Gross Error (model and obs unit)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.WDME_m(obs, mod, axis=None)

Wind Direction Mean Gross Error (model and obs unit) (avoid single block error in np.ma)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.WDMdnB(obs, mod, axis=None)

Wind Direction Median Bias

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.WDMdnE(obs, mod, axis=None)

Wind Direction Median Gross Error (model and obs unit)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.WDNMB_m(obs, mod, axis=None)

Wind Direction Normalized Mean Bias (%) (avoid single block error in np.ma)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.WDRMSE(obs, mod, axis=None)

Wind Direction Root Mean Square Error (model unit)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.WDRMSE_m(obs, mod, axis=None)

Wind Direction Root Mean Square Error (model unit) (avoid single block error in np.ma)

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.circlebias(b)

Calculate circular bias.

For circular quantities like wind direction where the values wrap around.

Parameters:

b (numpy.ndarray) – Array of differences between values (e.g. model - obs)

Returns:

Bias values adjusted for circular nature of data

Return type:

numpy.ndarray

monet.util.stats.circlebias_m(b)

Calculate circular bias avoiding single block error.

For circular quantities like wind direction where the values wrap around.

Parameters:

b (numpy.ndarray) – Array of differences between values (e.g. model - obs)

Returns:

Bias values adjusted for circular nature of data

Return type:

numpy.ndarray

monet.util.stats.d1(obs, mod, axis=None)

Modified Index of Agreement, d1

Parameters:
  • obs (type) – Description of parameter obs.

  • mod (type) – Description of parameter mod.

  • axis (type) – Description of parameter axis.

Returns:

Description of returned object.

Return type:

type

monet.util.stats.matchedcompressed(a1, a2)

Match masks and compress arrays to 1D.

First matches masks between arrays then compresses them to 1D by removing masked values.

Parameters:
  • a1 (numpy.ndarray or numpy.ma.MaskedArray) – First array to process

  • a2 (numpy.ndarray or numpy.ma.MaskedArray) – Second array to process

Returns:

(compressed_a1, compressed_a2) containing flattened 1D arrays with masked values removed

Return type:

tuple

monet.util.stats.matchmasks(a1, a2)

Match masks between two arrays.

Creates a combined mask from two arrays, ensuring they have compatible masking for operations.

Parameters:
  • a1 (numpy.ndarray or numpy.ma.MaskedArray) – First array to match masks

  • a2 (numpy.ndarray or numpy.ma.MaskedArray) – Second array to match masks

Returns:

(masked_a1, masked_a2) containing both arrays with matched masks

Return type:

tuple

monet.util.stats.scores(obs, mod, minval, maxval=100000.0)

Calculate multiple verification scores between obs and model.

Parameters:
  • obs (numpy.ndarray) – Observed values

  • mod (numpy.ndarray) – Modeled values

  • minval (float) – Minimum threshold value for categorical scores

  • maxval (float, optional) – Maximum threshold value for categorical scores. Default is 1.0e5

Returns:

Dictionary containing various statistical scores

Return type:

dict

monet.util.stats.stats(df, minval, maxval)

Short summary.

Parameters:
  • df (type) – Description of parameter df.

  • minval (type) – Description of parameter minval.

  • maxval (type) – Description of parameter maxval.

Returns:

Description of returned object.

Return type:

type