pymc.model.core.BaseModel.logp#

BaseModel.logp(vars=None, jacobian=True, sum=True)[source]#

Elemwise log-probability of the model.

On frozen models the returned graph is memoized (keyed on the arguments), so repeated calls return the same object and compile_fn can reuse a compiled function. Do not mutate it in place.

Parameters:
varslist of random variables or potential terms, optional

Compute the gradient with respect to those variables. If None, use all free and observed random variables, as well as potential terms in model.

jacobianbool

Whether to include jacobian terms in logprob graph. Defaults to True.

sumbool

Whether to sum all logp terms or return elemwise logp for each variable. Defaults to True.

Returns:
Logp graph(s)