Problem with me() function

32 views
Skip to first unread message

Sam Bashevkin

unread,
Apr 6, 2018, 3:20:46 PM4/6/18
to brms-users
Hi,

I'm trying to use the me() function to include predictors with measurement error. When I include this function, I'm getting an error in parsing the Stan model. Here's a simplified version of my model formula with the error message below. I've also tried inputting a vector for the sd instead of the "0.023" and I get the same error. I'd prefer to use a vector if possible since I know the measurement error varies through the data. 

Successes|trials(trials) ~ Predictor1 + me(Predictor2, sdx = 0.023), family=binomial()



SYNTAX ERROR, MESSAGE(S) FROM PARSER:

No matches for: 

  normal_rng(vector, vector)

Available argument signatures for normal_rng:

  normal_rng(real, real)

  error in 'model9fbb19cce93c_file9fbb7b8bd6f2' at line 61, column 46
  -------------------------------------------------
    59:   real prior_temp_Intercept = normal_rng(0,5); 
    60:   real prior_bme = normal_rng(0,5); 
    61:   real prior_Xn_1 = normal_rng(Xme_1,noise_1); 
                                                     ^
    62:   real prior_b_Intercept = prior_temp_Intercept - dot_product(means_X, b); 
  -------------------------------------------------

Error in stanc(model_code = paste(program, collapse = "\n"), model_name = model_cppname,  : 
  failed to parse Stan model 'file9fbb7b8bd6f2' due to the above error.


R version 3.4.4 (2018-03-15)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.3
brms_2.1.0
rstan_2.17.3


Thank you very much,
Sam

Paul Buerkner

unread,
Apr 6, 2018, 8:45:14 PM4/6/18
to Sam Bashevkin, brms-users
Thanks for reporting. This error occurs only if sample_prior = TRUE and it should be fixed in the latest github version of brms now.

--
You received this message because you are subscribed to the Google Groups "brms-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+unsubscribe@googlegroups.com.
To post to this group, send email to brms-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brms-users/0dad616c-111f-4a7b-b052-203b2da24a16%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages