Likelihood function in the scan function (AR2 model)

No, just the ones inside the scan.

I Understood. Thank you very much.

You can see this notebook in the Samuelson Multiplier-Accelerator section for some discussion specifically in the context of an AR(2). You can see that the posterior mean gives damped oscillations, but there are explosive oscillations in the tails.
Unsolicited opinion: Your data don’t look like an AR(2) at all. They exhibit strong seasonal behavior, so you should model that first, then consider AR dynamics if it seems like the residuals are still auto-correlated. The model is learning parameter combinations with complex eigenvalues to try to capture the seasonal pattern.

Thanks for the advice.
I used NumPyro’s sample as a reference. I will check with other datasets.

https://num.pyro.ai/en/latest/examples/ar2.html