shine.validation.plots¶
Diagnostic plots for bias measurement.
Generates trace plots, marginal posterior histograms, pair plots, and (future) bias regression and coverage visualizations.
plots
¶
Diagnostic plots for bias measurement using matplotlib and ArviZ.
plot_level0_diagnostics(idata, g1_true, g2_true, output_dir)
¶
Generate Level 0 diagnostic plots, dispatching on inference method.
Reads inference_method from idata.posterior.attrs to select
the appropriate plotting style:
- NUTS: trace plots + histograms + pair plot
- VI: histograms + pair plot (no trace since no chains)
- MAP: bar at point estimate + truth line (2 panels: g1, g2)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
idata
|
InferenceData
|
ArviZ InferenceData with posterior samples. |
required |
g1_true
|
float
|
True g1 shear value. |
required |
g2_true
|
float
|
True g2 shear value. |
required |
output_dir
|
str
|
Directory to save plots. |
required |
Returns:
| Type | Description |
|---|---|
List[Path]
|
List of saved plot file paths. |
Source code in shine/validation/plots.py
plot_bias_vs_shear(g_true_values, g_est_means, g_est_stds, component, output_dir, m=None, c=None)
¶
Plot estimated shear vs true shear with bias regression line.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
g_true_values
|
ndarray
|
Array of true shear values. |
required |
g_est_means
|
ndarray
|
Array of estimated shear means. |
required |
g_est_stds
|
ndarray
|
Array of estimated shear standard deviations. |
required |
component
|
str
|
Shear component name ("g1" or "g2"). |
required |
output_dir
|
str
|
Directory to save plot. |
required |
m
|
Optional[float]
|
Multiplicative bias (for regression line). |
None
|
c
|
Optional[float]
|
Additive bias (for regression line). |
None
|
Returns:
| Type | Description |
|---|---|
Path
|
Path to saved plot. |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
This function is a stub for Level 1+. |
Source code in shine/validation/plots.py
plot_coverage(alpha_levels, observed_coverage, output_dir)
¶
Plot observed vs expected coverage.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
alpha_levels
|
List[float]
|
Expected coverage levels. |
required |
observed_coverage
|
List[float]
|
Observed coverage fractions. |
required |
output_dir
|
str
|
Directory to save plot. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
Path to saved plot. |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
This function is a stub for Level 1+. |
Source code in shine/validation/plots.py
plot_sbc_histogram(ranks, param, output_dir)
¶
Plot SBC rank histogram.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ranks
|
ndarray
|
Array of rank statistics. |
required |
param
|
str
|
Parameter name. |
required |
output_dir
|
str
|
Directory to save plot. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
Path to saved plot. |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
This function is a stub for Level 1+. |