Skip to content

Commit 043eb04

Browse files
twieckiColCarroll
authored andcommitted
DOC Add note and warning to not use find_MAP() to initialize NUTS. (#3159)
1 parent 096d6fa commit 043eb04

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pymc3/tuning/starting.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,17 @@ def find_MAP(start=None, vars=None, method="L-BFGS-B",
4949
model : Model (optional if in `with` context)
5050
*args, **kwargs
5151
Extra args passed to scipy.optimize.minimize
52+
53+
Notes
54+
-----
55+
Older code examples used find_MAP() to initialize the NUTS sampler,
56+
this turned out to be a rather inefficient method.
57+
Since then, we have greatly enhanced the initialization of NUTS and
58+
wrapped it inside pymc3.sample() and you should thus avoid this method.
5259
"""
60+
61+
warnings.warn('find_MAP should not be used to initialize the NUTS sampler, simply call pymc3.sample() and it will automatically initialize NUTS in a better way.')
62+
5363
model = modelcontext(model)
5464
if start is None:
5565
start = model.test_point

0 commit comments

Comments
 (0)