Autocorrelation for unevenly spaced time series

Please also provide the following information in addition to your question:
I used this autocorrelation cor_ar structure for my time series data. However, I think it is more meant for evenly spaced data, while my data, as well as many other data, are more likely to be unevenly spaced, I believe. Will brms consider implement an autocorrelation structure for unevenly spaced time series data? Although most of my models included autocorrelation (cor_ar) were better than those not included when judged by loo_compare.

Should the random effect and autocorrelation have the same structure? In a model, where I used the same structure for random effect and autocorrelation, and I used re_formula = NA in function fitted to not to include those random effects. However, my predicted lines looked awkward, they were jagged. Can someone tell me what is wrong?

I also found that lines fitted with brms are more wiggly than those fitted with gamm from package mgcv, why is that?

  • Operating System: 64-bit
  • brms Version:2.9.0

With you first question you are refering to continuous time autoregressive models. This might get implemented at some point in brms, but is likely far away in the future (if it will ever come). You may want to look at the ctsem R package which handles continuous time models and can also use Stan as backend,

It is often plausible to assume the random effects and the autocorrelation to have the same structure. For instance, the lme function of the nlme package even has checks that this is indeed the case. However, there is no general answer and it will depend on the specific structure of your data.

I can’t tell why the brms lines were more wiggly than those of mgcv but this may very well happen. After all, we are using a complete different approach to estimate these models.