Executionhalted without error description using stanvars

I’m recently having some hard time debugging code passed via stanvars in brms because the execution stops without an informnative error message. This happens when I missspecify something in the stan code. But it is hard to fix the code without any hint. I think, this was different some month ago. Back then I got error messages when I made a mistake in the stan code. (But maybe I’m wrong and I got the error in the phase when I used stan directly.)

Loading required package: Rcpp
Loading 'brms' package (version 2.13.5). Useful instructions
can be found by typing help('brms'). A more detailed introduction
to the package is available through vignette('brms_overview').

Attaching package: 'brms'

The following object is masked from 'package:stats':


Compiling Stan program...
Execution halted

I already tried to fix this by setting silent = FALSE Is there a way to get these error messages back?

  • Operating System: Win 10 x64, 18363
  • brms Version: 2.13.5

Can you try running make_stancode to thebug the code?

1 Like

Yeah, with this workaround I get the error message:

Variable "r_3_beta_1" does not exist.
 error in 'model2ce4a8a7c35_8747d582fd2aabcbf53b56eab49c02bd' at line 243, column 23
   241: //   alpha1[n] = exp(r_3_logalpha1_1[n]+b_logalpha1[1]); // K_logalpha1 = 1
   242: //   alpha2[n] = exp(r_4_logalpha2_1[n]+b_logalpha2[1]); // K_logalpha2 = 1
   243:   delta[n] = r_3_beta_1[n]+b_beta[1]; // K_beta = 1
   244:   }

Error in stanc(file = file, model_code = model_code, model_name = model_name,  : 
  failed to parse Stan model '8747d582fd2aabcbf53b56eab49c02bd' due to the above error.

(The error was induced on purpose now for test reasons and is not the problem.)

Thanks for the quick hint. This way I can keep working. A bit cumbersome but definetly a solution. In brms itself there is no way to turn on these error message?

Do you get the error if you run the model with verbose=TRUE?

No. This doesn’t help. Tried it with and witout the silent statement. :(

My code for the fit statement looks like:

fit_fachdidaktisches_Wissen_1D_1pl_testlets_quantgen_strongpriors_ml_std <- brm(
  formula = formula_fachdidaktisches_Wissen_1D_1pl_testlets,
  data = data_final_dich_long,
  prior = prior_fachdidaktisches_Wissen_1D_1pl_testlets,
  chains = 4, iter = 3500, warmup = 1500,
  cores = 4, control = control_brm, thin = 5,
  save_all_pars = TRUE, 
  stanvars = stanvar_2PL_generalized, 
  silent = FALSE, refresh = 50,
  file = "models/final/fit_fachdidaktisches_Wissen_1D_1pl_quantgen_strongpriors_thin_ml_std")

control_brm sets adapt_delta to .95.

Can you try with the brms github version?

1 Like

I just updated to Version 2.14.0 and now I get the error messages. Thanks for this super fast solution!