tombolo.plots.convergence_table

 1import jsonschema
 2import matplotlib.pyplot as plt
 3
 4from .primitives.table import _table
 5
 6_schema = {
 7    "type": "object",
 8    "required": ["convergence"],
 9    "properties": {
10        "convergence": {
11            "type": "object",
12            "required": ["rhat_max", "ess_bulk_min", "ess_tail_min"],
13            "properties": {
14                "rhat_max": {"type": "number"},
15                "ess_bulk_min": {"type": "number"},
16                "ess_tail_min": {"type": "number"},
17            },
18        }
19    },
20}
21
22
23def convergence_table(data: dict) -> plt.Figure:
24    """Summary table of MCMC convergence diagnostics. Only applicable to BNMA results.
25
26    Args:
27        data: Result dict from `tombolo.bnma`. Only `convergence` is used.
28
29    Returns:
30        R̂ (max), ESS bulk (min), and ESS tail (min) across all model parameters.
31    """
32    jsonschema.validate(instance=data, schema=_schema)
33    return _table(data["convergence"])
def convergence_table(data: dict) -> matplotlib.figure.Figure:
24def convergence_table(data: dict) -> plt.Figure:
25    """Summary table of MCMC convergence diagnostics. Only applicable to BNMA results.
26
27    Args:
28        data: Result dict from `tombolo.bnma`. Only `convergence` is used.
29
30    Returns:
31        R̂ (max), ESS bulk (min), and ESS tail (min) across all model parameters.
32    """
33    jsonschema.validate(instance=data, schema=_schema)
34    return _table(data["convergence"])

Summary table of MCMC convergence diagnostics. Only applicable to BNMA results.

Args: data: Result dict from tombolo.bnma. Only convergence is used.

Returns: R̂ (max), ESS bulk (min), and ESS tail (min) across all model parameters.