How can I add Autoregressive struture in nonlinear models in brms

Hi, guys, I’m fitting temporal data to population models by using brms, but I found that I cannot add
autoregressive struture in nonlinear model. Is there a good way for everyone to add?

seed_bayes_fit_formula_1 = bf(G~log(lambda)+ar(time = time, p = 1),
                               lambda ~ 1,
                               nl = TRUE)

seed_bayes_fit_1= brm(seed_bayes_fit_formula_1, family=gaussian(), data = temp_data, prior = seedpriors[c(1,2),],  chains = 8, cores = ncores, iter = 10000, backend = 'cmdstanr')  %>%  add_criterion("loo")


 

error: Ill-formed expression. Found identifier. There are many ways to complete this to a well-formed expression.

  • Operating System: Win11
  • brms Version: 2.21.0

Thx!