pymc.find_MAP(start=None, vars=None, method='L-BFGS-B', return_raw=False, include_transformed=True, progressbar=True, maxeval=5000, model=None, *args, seed=None, **kwargs)[source]#

Finds the local maximum a posteriori point given a model.

find_MAP should not be used to initialize the NUTS sampler. Simply call pymc.sample() and it will automatically initialize NUTS in a better way.

start: `dict` of parameter values (Defaults to `model.initial_point`)
vars: list

List of variables to optimize and set to optimum (Defaults to all continuous).

method: string or callable

Optimization algorithm (Defaults to ‘L-BFGS-B’ unless discrete variables are specified in vars, then Powell which will perform better). For instructions on use of a callable, refer to SciPy’s documentation of optimize.minimize.

return_raw: bool

Whether to return the full output of scipy.optimize.minimize (Defaults to False)

include_transformed: bool, optional defaults to True

Flag for reporting automatically transformed variables in addition to original variables.

progressbar: bool, optional defaults to True

Whether or not to display a progress bar in the command line.

maxeval: int, optional, defaults to 5000

The maximum number of times the posterior distribution is evaluated.

model: Model (optional if in `with` context)
*args, **kwargs

Extra args passed to scipy.optimize.minimize


Older code examples used find_MAP to initialize the NUTS sampler, but this is not an effective way of choosing starting values for sampling. As a result, we have greatly enhanced the initialization of NUTS and wrapped it inside pymc.sample() and you should thus avoid this method.