Skip to content

Commit

Permalink
🚚 Move diagnostics into separate files
Browse files Browse the repository at this point in the history
  • Loading branch information
francois-rozet committed Feb 13, 2024
1 parent 0bb21fc commit 3e88c8e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/tutorials/coverage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"source": [
"## Expected coverage\n",
"\n",
"Using the [`expected_coverage_mc`](lampe.diagnostics.expected_coverage_mc) and [`expected_coverage_ni`](lampe.diagnostics.expected_coverage_ni) functions provided by the [`lampe.diagnostics`](lampe.diagnostics) module, we estimate the respective expected coverage of the three estimators. The expected coverage at credible level $1 - \\alpha$ is the probability of a set of parameters $\\theta^*$ to fall inside the highest posterior density \n",
"Using the [`expected_coverage_mc`](lampe.diagnostics.coverage.expected_coverage_mc) and [`expected_coverage_ni`](lampe.diagnostics.coverage.expected_coverage_ni) functions provided by the [`lampe.diagnostics`](lampe.diagnostics) module, we estimate the respective expected coverage of the three estimators. The expected coverage at credible level $1 - \\alpha$ is the probability of a set of parameters $\\theta^*$ to fall inside the highest posterior density \n",
"\n",
"The expected coverage of a posterior estimator $q(\\theta | x)$ at credible level $1 - \\alpha$ is the probability of a set of parameters $\\theta^*$ to be included in the highest density region of total probability $1 - \\alpha$ of the posterior estimator, given an observation $x^* \\sim p(x | \\theta^*)$. If the estimator is callibrated, the expected coverage at credible level $1 - \\alpha$ is exactly $1 - \\alpha$. If it is overconfident, the highest density regions are smaller than they should be, which translates into lower coverages. If it is conservative/underconfident, the highest density regions are larger than they should be and the expected coverages are larger than their nominal level."
]
Expand Down
3 changes: 3 additions & 0 deletions lampe/diagnostics/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
r"""Diagnostics and reliability assessment."""

from .coverage import *
4 changes: 2 additions & 2 deletions lampe/diagnostics.py → lampe/diagnostics/coverage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
r"""Diagnostics and reliability assessment."""
r"""Coverage diagnostics."""

import torch

Expand All @@ -8,7 +8,7 @@
from typing import Callable, Iterable, Tuple

# isort: local
from .utils import gridapply
from ..utils import gridapply


def expected_coverage_mc(
Expand Down

0 comments on commit 3e88c8e

Please sign in to comment.