Can’t really delve deep into this due to time constraints, but if you inspect the generated code (via make_stancode
), I would expect the AR term to be represented by a set of nuisance parameters, one for each observation representing the autoregressive term, because there is no closed form. If this is the case, those nuisance parameters basically by their definition depend strongly on the individual observation. The pareto k in loo
checks roughly (in my limited understanding) whether some parameters depend strongly on a single observation. And those nuisance parameters do (by definition) depend on single observations, so you’ll get high pareto k.
The short answer therfore is that for this type of models (with nuisance parameters) you cannot use loo
easily. The longer answer is that you can IMHO try to compute loo
anyway by integrating the nuisance parameters out, but that’s not straightforward (see Is LOO valid for models with missing outcome when using a complete case dataset that is a subset of the original data? - #7 by martinmodrak for a similar, but simpler case - I think 1D integration might not be enough in your case).
Best of luck with your model!