diagnostic.functions.calc_metrics_dt#

calc_metrics_dt(dt_mod: DataTree, da_obs: Dataset, metrics=None, pss_binwidth=None)[source]#

Calculate statistical performance metrics for model data against observed data.

This function computes various metrics between the model data stored in the DataTree object dt_mod and the observed data da_obs. Default metrics include Mean Bias, Mean Absolute Error (MAE) at different percentiles, Root Mean Square Error (RMSE), Spearman Correlation, and Perkins Skill Score (PSS).

Parameters:#

dt_modDataTree

A DataTree containing the model data for different members. The function loops through each member to calculate the metrics.

da_obsxr.DataSet

The observed data to compare against the model data.

metricsdict, optional

A dictionary containing the names of the metrics to calculate and the corresponding functions. Default is the below specified metrics.

pss_binwidthfloat, optional

The bin width to use for the Perkins Skill Score (PSS) calculation. If not provided, the optimal bin width is calculated.a

Returns:#

df_metricpd.DataFrame

A DataFrame containing the calculated metrics and corresponding rank per metric for each member and variable in the data tree.

Metrics:#

  • Mean Bias

  • Mean Absolute Error

  • MAE at 90th Percentile

  • MAE at 99th Percentile

  • MAE at 10th Percentile

  • MAE at 1st Percentile

  • Root Mean Square Error

  • Spearman Correlation

  • Perkins Skill Score