Likelihood function in the scan function (AR2 model)

I considered the case of multiple observations.