Plotting traces from time series

likelihood is an observed variable, and therefore it is NOT sampled during the inference run. It is intended and desired behaviour.

likelihood is defined as a variable to indicate PyMC how to calculate the likelihood, that is, evaluate the probability of the defined distribution AR(beta, sd=sigma) at the observed values, delta in this case. ll_alias is therefore not useful at all to evaluate the fit.

If you pay attention to the plot, you’ll see that all ll_alias samples are identical to delta:

pymc3_deterministic_not_post_pred

To examine how well does the fitted model describe the observed data, you need posterior predictive samples. If the method has random method implemented (which is not the case for AR distribution), you’ll get the proper samples too examine the fit. See the example notebook on posterior predictive checks and PyMC resources for more details and examples.

1 Like