I really hope that someone can help me out.
I want to account for temporal autocorrelation given by the year of sampling within tree different groups of my data. I have coded my groups due to dummy variables.
I am new to brms ealier I have been using the rethinking.
I have various sampling for each year and group.
I tried looking into using arma, but I am obviously coding this wrong. I tried to add year as the time variable in the arma argument. I am also trying to add my groups of interest into the argument, but its wrong to I suppose.
My wrong model looks like this
bf(Y ~ X + Gr2 + Gr3 + arma(time = Year, gr = Gr2:G3)),
prior=c(prior(normal(0,10), class=b), prior(cauchy(0,1), class=sigma)),
iter=2000, warmup=1000, chains=3, cores=1)
I get this error when I run my model.
Error: Time points within groups must be unique.
Thanks a lot in advance,