Skip to content

gp3bayespy.evidence_graphics_gg

16 public functions in this module.

← API reference hub

Source code in src/gp3bayespy/evidence_graphics_gg.py
47
48
def backend_environment_table(x: Any) -> pd.DataFrame:
    return _field(x, "table")
Source code in src/gp3bayespy/evidence_graphics_gg.py
43
44
def backend_parity_table(x: Any) -> pd.DataFrame:
    return _field(x, "table")
Source code in src/gp3bayespy/evidence_graphics_gg.py
59
60
def design_support_table(x: Any) -> pd.DataFrame:
    return _field(x, "table", "checks")
Source code in src/gp3bayespy/evidence_graphics_gg.py
51
52
def manifest_comparison_table(x: Any) -> pd.DataFrame:
    return _field(x, "table")
Source code in src/gp3bayespy/evidence_graphics_gg.py
63
64
def missingness_audit_table(x: Any) -> pd.DataFrame:
    return _field(x, "table", "missingness", "checks")
Source code in src/gp3bayespy/evidence_graphics_gg.py
39
40
def model_evidence_table(x: Any) -> pd.DataFrame:
    return _field(x, "component_table", "table")
Source code in src/gp3bayespy/evidence_graphics_gg.py
136
137
138
139
140
141
def plot_backend_environment_gg(x: Any):
    return _status_plot(
        backend_environment_table(x),
        "Backend environment",
        "component" if "component" in backend_environment_table(x).columns else None,
    )
Source code in src/gp3bayespy/evidence_graphics_gg.py
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
def plot_backend_parity_gg(x: Any):
    d = backend_parity_table(x)
    plt = _plt()
    fig, ax = plt.subplots()
    ax.set_title("Backend posterior parity")
    pairs = [
        (a, b)
        for a, b in (
            ("rstan_mean", "cmdstanr_mean"),
            ("reference_mean", "alternative_mean"),
            ("left_mean", "right_mean"),
        )
        if a in d.columns and b in d.columns
    ]
    if pairs:
        a, b = pairs[0]
        ax.scatter(d[a], d[b])
        lo = min(float(d[a].min()), float(d[b].min()))
        hi = max(float(d[a].max()), float(d[b].max()))
        ax.plot([lo, hi], [lo, hi], linestyle="--")
        ax.set_xlabel(a)
        ax.set_ylabel(b)
    else:
        return _status_plot(
            d, "Backend posterior parity", "variable" if "variable" in d.columns else None
        )
    return fig
Source code in src/gp3bayespy/evidence_graphics_gg.py
162
163
164
165
166
167
def plot_design_support_gg(x: Any):
    return _status_plot(
        design_support_table(x),
        "Design-support diagnostics",
        "check" if "check" in design_support_table(x).columns else None,
    )
Source code in src/gp3bayespy/evidence_graphics_gg.py
144
145
146
147
148
149
150
151
def plot_manifest_comparison_gg(x: Any):
    d = manifest_comparison_table(x)
    plt = _plt()
    fig, ax = plt.subplots()
    ax.set_title("Analysis-manifest comparison")
    ax.barh(d["component"].astype(str), d["identical"].astype(int))
    ax.set_xlim(0, 1)
    return fig
Source code in src/gp3bayespy/evidence_graphics_gg.py
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
def plot_missingness_gg(x: Any):
    d = missingness_audit_table(x)
    plt = _plt()
    fig, ax = plt.subplots()
    ax.set_title("Missingness audit")
    label = next((c for c in ("variable", "column", "component") if c in d.columns), None)
    value = next(
        (c for c in ("missing_fraction", "fraction", "n_missing", "missing") if c in d.columns),
        None,
    )
    if label and value:
        ax.barh(d[label].astype(str), pd.to_numeric(d[value], errors="coerce").fillna(0))
    else:
        ax.text(0.5, 0.5, "Missingness evidence recorded", ha="center")
    return fig
Source code in src/gp3bayespy/evidence_graphics_gg.py
103
104
def plot_model_evidence_gg(x: Any):
    return _status_plot(model_evidence_table(x), "Model evidence inventory", "component")
Source code in src/gp3bayespy/evidence_graphics_gg.py
154
155
156
157
158
159
def plot_schema_comparison_gg(x: Any):
    return _status_plot(
        schema_comparison_table(x),
        "Object-schema comparison",
        "component" if "component" in schema_comparison_table(x).columns else None,
    )
Source code in src/gp3bayespy/evidence_graphics_gg.py
 99
100
def plot_sensitivity_suite_gg(x: Any):
    return _status_plot(sensitivity_suite_table(x), "Sensitivity suite", "component")
Source code in src/gp3bayespy/evidence_graphics_gg.py
55
56
def schema_comparison_table(x: Any) -> pd.DataFrame:
    return _field(x, "table")
Source code in src/gp3bayespy/evidence_graphics_gg.py
30
31
32
33
34
35
36
def sensitivity_suite_table(x: Any) -> pd.DataFrame:
    try:
        from .sensitivity import summarise_sensitivity_suite

        return summarise_sensitivity_suite(x)
    except Exception:
        return _field(x, "component_status", "table")