AR dims/coords/shape in v4

I am pretty naive when it comes to time series modeling, but I think AR is expecting parameters for each series you are observing. If you want to use a single set of parameters for all observed series and do it in a single likelihood, then maybe something like this?

import aesara.tensor as at

with pm.Model(coords={"time": df.index.values, "series": [0, 1]}) as m:
    rho = pm.Normal("rho")
    init = pm.Normal.dist(shape=2)
    sigma = pm.HalfNormal('sigma')
    ar1 = pm.AR("ar1",
                rho=at.stack([rho, rho]),
                sigma=at.stack([sigma, sigma]),
                init_dist=init,
                observed=df[['res1', 'res2']].to_numpy().T,
                dims=("series", "time")
    )

Of course, you should also be able build 2 separate likelihoods, which should do the same thing, but then you wouldn’t have everything in one giant data structure with series as a dimension.