Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"unexpected end of input" error when running loo on a brms fit #769

Closed
bnicenboim opened this issue Oct 3, 2019 · 2 comments
Closed

"unexpected end of input" error when running loo on a brms fit #769

bnicenboim opened this issue Oct 3, 2019 · 2 comments
Labels
Milestone

Comments

@bnicenboim
Copy link
Contributor

I'm running the following model

m <-  brm(bf(n400 ~ c_cloze 
                                     + (1 | item) + (c_cloze  | subject)+
                                     + (c_cloze  | lab), sigma ~ (1|lab)),
                  prior= c(
                      prior(normal(0, 10), class = Intercept),
                      prior(normal(0, 1), class = b),
                      prior(normal(0, 10), class = sd),
                      prior(lkj(2), class = cor),
                      prior(normal(0,10), class = Intercept, dpar= sigma),
                      prior(normal(0,10), class = sd, dpar= sigma)
                  ),
                  data = data_eeg_noun_nieuwland,
                  chains = chains, iter=iter,
                  control= list(adapt_delta = .99, max_treedepth=13)
)

Then when I do

 loo_raw <- loo(m)

I get the following error:

Error in parse(text = x, keep.source = FALSE) : 
  <text>:2:0: unexpected end of input
1: n400~c_cloze+
   ^

You can find a subset of the data (that give the same problem) here: www.ling.uni-potsdam.de/~nicenboim/files/data_loo.RDS

If I remove some random effects, it actually works, so I'm not sure of what's going on.

@paul-buerkner
Copy link
Owner

paul-buerkner commented Oct 3, 2019

There is a typo in your formula having ++ in it after the varying effect of subject. This should ideally not create any problems, but apparently it does. I will see how I can fix it, but in the mean time you can just remove the extra + and that's it.

@paul-buerkner paul-buerkner added this to the brms 2.10.0++ milestone Oct 3, 2019
paul-buerkner added a commit that referenced this issue Oct 3, 2019
@paul-buerkner
Copy link
Owner

should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants