Both bayes_R2 and loo_R2 get weird estimate 1

Dear brms developers,

I ran a brms model on a dataset containing almost 11000 species using the following command.

fit <- brm(formula =brl ~ LH + (1|species),
                 data = data_,
                 cov_ranef = list(species=phyloMat),
                 family = gaussian(),
                 save_all_pars = T,
                 chains = 2,
                 cores = 10,
                 backend = "cmdstanr",
                 threads = threading(15)

Then, we used bayes_R2 and loo_R2 methods to calculate the r2. However, we got a weird result: R2 estimates were 1 in both cases.

bayes_r2 = bayes_R2(fit)
loo_r2 = loo_R2(fit)
> print(bayes_r2)
   Estimate    Est.Error Q2.5 Q97.5
R2        1 2.769589e-09    1     1

> print(loo_r2)
   Estimate    Est.Error Q2.5 Q97.5
R2        1 1.131317e-10    1     1

Can you help us infer what caused this problem?

Thank you very much!


By the way, I tried to remove (1|species) (random effect) in the formula, the R2 value gets normal.

Hi and sorry about the delay in getting to this. Is there a way you can share your data (or some simulated data) and print out the priors that are being used? I would guess that having 11000 levels might be an issue depending on the rest of the data and priors.

No problem, can you provide your email address? I can send my dataset and code to you via email.