Skip to content

Commit 3e6f5c8

Browse files
Revert removal of pm.compute_log_likelihood
1 parent c899f88 commit 3e6f5c8

5 files changed

Lines changed: 7 additions & 5 deletions

File tree

docs/source/api/misc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Other utils
66
.. autosummary::
77
:toctree: generated/
88

9+
compute_log_likelihood
910
find_constrained_prior
1011

1112
.. currentmodule:: pymc.blocking

docs/source/learn/core_notebooks/model_comparison.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
"\n",
261261
"### Model log-likelihood\n",
262262
"\n",
263-
"In order to compute LOO, ArviZ needs access to the model elemwise loglikelihood for every posterior sample. We can add it via {func}`~pymc.stats.compute_log_likelihood`. Alternatively we can pass `idata_kwargs={\"log_likelihood\": True}` to {func}`~pymc.sample` to have it computed automatically at the end of sampling."
263+
"In order to compute LOO, ArviZ needs access to the model elemwise loglikelihood for every posterior sample. We can add it via {func}`~pymc.compute_log_likelihood`. Alternatively we can pass `idata_kwargs={\"log_likelihood\": True}` to {func}`~pymc.sample` to have it computed automatically at the end of sampling."
264264
]
265265
},
266266
{
@@ -295,7 +295,7 @@
295295
],
296296
"source": [
297297
"with pooled:\n",
298-
" pm.stats.compute_log_likelihood(trace_p)"
298+
" pm.compute_log_likelihood(trace_p)"
299299
]
300300
},
301301
{
@@ -363,7 +363,7 @@
363363
],
364364
"source": [
365365
"with hierarchical:\n",
366-
" pm.stats.compute_log_likelihood(trace_h)"
366+
" pm.compute_log_likelihood(trace_h)"
367367
]
368368
},
369369
{

pymc/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def __set_compiler_flags():
5959
from pymc.pytensorf import compile
6060
from pymc.sampling import *
6161
from pymc.smc import *
62+
from pymc.stats import compute_log_likelihood
6263
from pymc.step_methods import *
6364
from pymc.tuning import *
6465
from pymc.variational import *

pymc/sampling/jax.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ def sample_jax_nuts(
652652
if idata_kwargs.pop("log_likelihood", False):
653653
warnings.warn(
654654
"`passing log_likelihood` is deprecated and will be removed in future versions. Use "
655-
":func:`pymc.stats.compute_log_likelihood` instead.",
655+
":func:`pymc.compute_log_likelihood` instead.",
656656
FutureWarning,
657657
stacklevel=3,
658658
)

pymc/sampling/mcmc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1095,7 +1095,7 @@ def _sample_return(
10951095
if log_likelihood:
10961096
warnings.warn(
10971097
"`passing log_likelihood` is deprecated and will be removed in future versions. Use "
1098-
":func:`pymc.stats.compute_log_likelihood` instead.",
1098+
":func:`pymc.compute_log_likelihood` instead.",
10991099
FutureWarning,
11001100
stacklevel=2,
11011101
)

0 commit comments

Comments
 (0)