Brms package in R. Error: The following variables can neither be found in 'data' nor in 'data2'

Hello there!
I’m trying to run Bayesian inference for my model in R with the brms package, but I’ve got a problem. Here’s my model:

Baye_model.M1 <- brms::brm(
 bf(
 logBAgr1 ~ b1*logBA1 + b2*DD + b3*SWC - b4*NI + alpha,
 nlf(NI ~ lambda*logBA2),
 alpha ~ (1|plotID),
 nl = TRUE
 ),
 data = pair,
 family = gaussian(), 
 prior = prior_brms.M1,
 warmup = 2000, 
 iter = 5000,   
 chains = 2, 
 cores = 2, 
 control = list(adapt_delta = 0.9, max_treedepth = 15)
) 

when I run this code, I’ve got error message: Error: The following variables can neither be found in ‘data’ nor in ‘data2’: ‘b1’, ‘b2’, ‘b3’, ‘b4’, ‘lambda’.

I’ve tried to add “b1 + b2 +b3 +b4 ~1” and “lambda ~1” in the bf (…), in this way I can run the model without error information. In this way, b1~ b4 and lambda are defined as random intercepts, which is not what I want to simulate. I want to view b1-b4 and lambda as unknown parameters and estimate their values through Bayesian inference. Could anyone give some suggestions on how to set up the model for this purpose correctly? thanks a lot in advance!

I think you need those unknowns in the priors. So I have a model like this:

brm(bf(y ~ a*x^2 + b*x + c, a + b + c ~ 1, nl = TRUE),
            data = dat2, prior = prior2)

and prior2 looks like this

prior2 <- prior(normal(0,1), nlpar = "a") + 
  prior(normal(0, 2), nlpar = "b") + 
  prior(normal(0, 2), nlpar = "c")

Is that what you are talking about?

I’ve set priors already:

prior_brms.M1 ← c(
prior(normal(0, 1), nlpar = “b1”),
prior(normal(0, 1), nlpar = “b2”, lb=0),
prior(normal(0, 1), nlpar = “b3”, lb=0),
prior(normal(0, 1), nlpar = “b4”),
prior(normal(0, 1), nlpar = “alpha”),
prior(normal(0, 1), nlpar = “lambda”),
prior(inv_gamma(1, 2), class = “sigma”))

In your case, a, b, c are viewed as random intercepts?