geoprior.scripts.plot_uncertainty#
Script helpers for plotting uncertainty diagnostics.
Functions
|
Coverage + sharpness for the 80% interval. |
|
|
|
Extract per-horizon coverage/sharpness from GeoPrior JSON. |
|
Fig. 5: |
|
|
|
Row of mini reliability panels (H1..Hk). |
|
|
|
|
|
Empirical Pr(Y <= q_pred) versus nominal q. |
- geoprior.scripts.plot_uncertainty.quantile_reliability(df, *, by_horizon, ycol='subsidence_actual')[source]#
Empirical Pr(Y <= q_pred) versus nominal q.
- If by_horizon=True, returns:
forecast_step, nominal, empirical
- else:
nominal, empirical
- geoprior.scripts.plot_uncertainty.interval_stats(df, *, by_horizon, lower='subsidence_q10', upper='subsidence_q90', ycol='subsidence_actual')[source]#
Coverage + sharpness for the 80% interval.
- If by_horizon=True:
forecast_step, coverage80, sharpness80
- else:
one-row DataFrame with coverage80, sharpness80
- geoprior.scripts.plot_uncertainty.per_horizon_from_phys(meta)[source]#
Extract per-horizon coverage/sharpness from GeoPrior JSON.
- Expected:
- per_horizon:
coverage80: {“H1”:…, “H2”:…} sharpness80: {“H1”:…, “H2”:…}
Returns empty DataFrame if missing.
- geoprior.scripts.plot_uncertainty.plot_reliability(ax, rel, *, city, color, show_point_values, show_legend, show_labels, show_ticklabels, show_panel_titles, title_txt)[source]#
- geoprior.scripts.plot_uncertainty.plot_horizon_row(fig, gs_row, rel_items, *, horizons, show_mini_titles, show_mini_legend, show_labels, show_ticklabels)[source]#
Row of mini reliability panels (H1..Hk).
- Each mini panel shows:
y=x diagonal
one curve per city in rel_items
- rel_items is:
[(city_name, rel_by_h_df, color), …]
- where rel_by_h_df has:
forecast_step, nominal, empirical
- geoprior.scripts.plot_uncertainty.plot_radial(ax, stats_h, *, city, color, title_mode, show_ticklabels, show_panel_titles)[source]#
- geoprior.scripts.plot_uncertainty.plot_fig5_uncertainty(*, ns_df, zh_df, ns_meta, zh_meta, split_ns, split_zh, out, out_csv, dpi, font, show_legend, show_labels, show_ticklabels, show_title, show_panel_titles, show_point_values, show_mini_titles, show_mini_legend, show_json_notes, radial_title, title)[source]#
- Fig. 5:
Top row: per-city reliability (overall)
Mid row: per-horizon mini reliability (all cities)
Bot row: per-city radial sharpness (edge cov err)
Supports 1-city and 2-city layouts.
- Parameters:
ns_df (DataFrame | None)
zh_df (DataFrame | None)
split_ns (str)
split_zh (str)
out (str)
out_csv (str)
dpi (int)
font (int)
show_legend (bool)
show_labels (bool)
show_ticklabels (bool)
show_title (bool)
show_panel_titles (bool)
show_point_values (bool)
show_mini_titles (bool)
show_mini_legend (bool)
show_json_notes (bool)
radial_title (str)
title (str | None)
- Return type:
None