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

Error in tmp$r_vals[lr - 1] * tmp$r_vals[lr] : #18

Closed
hstojic opened this issue Oct 1, 2019 · 8 comments
Closed

Error in tmp$r_vals[lr - 1] * tmp$r_vals[lr] : #18

hstojic opened this issue Oct 1, 2019 · 8 comments

Comments

@hstojic
Copy link

hstojic commented Oct 1, 2019

Hello,

after fitting a hierarchical model, results seem relatively ok (few divergences but n_eff adn Rhat seem fine), but I get the following error:

Error in tmp$r_vals[lr - 1] * tmp$r_vals[lr] : 
  non-numeric argument to binary operator
In addition: Warning message:
logml could not be estimated within maxiter, rerunning with adjusted starting value. 
Estimate might be more variable than usual. 

This was a test run with 2000 iterations. I know that for reliable model evidence estimation I need a much longer run, so perhaps this error is related to a small sample size? Nontheless, I though its worthwhile reporting this error.

Hrvoje

@singmann
Copy link
Collaborator

singmann commented Oct 1, 2019

Hey Hrvoje,

Are you sure you are using the latest CRAN version, 0.7-2?
We have fixed a similar problem some time ago (albeit with a different error message). If you are indeed using the latest version, I fear we need a reproducible example to see what the actual value of tmp$r_vals[lr - 1] and tmp$r_vals[lr] (or probably tmp$r_vals) are to be able to fix it.

Henrik

@hstojic
Copy link
Author

hstojic commented Oct 2, 2019

Yes, I'm using 0.7-2. Ok, I'll look into producing a reproducible example.

@hstojic
Copy link
Author

hstojic commented Oct 23, 2019

A quick update.

At the end this error started appearing in 80% of my models. In previous package version it wasn't there so as a temporary workaround, I reverted back to 0.6-2 and there everything is fine, I don't get these errors.

I will submit this paper in about 10 days and then I'll put up the data and the model.

@singmann
Copy link
Collaborator

Thanks for this message. Unfortunately, it does sound like we added the bug in our latest fix. That would not be too good.

@RemiDav
Copy link

RemiDav commented Nov 4, 2019

I ran into the same issue and I do not know what is causing it.
I have two stan_glmer regression differing only by the value of one dummy variable (the models are identical, only the data changes).
One regression output works well in bridge_sampler, the other doesn't and result in the error.
I tried both 0.7-2 and 0.6-0.

Packages loaded:

other attached packages:
[1] bridgesampling_0.6-0 rstan_2.19.2         ggplot2_3.2.1        StanHeaders_2.19.0   rstanarm_2.19.2     
[6] Rcpp_1.0.2 

@RemiDav
Copy link

RemiDav commented Nov 4, 2019

I changed the seed of the regression that caused me trouble and it fixed the issue.

@Mathieu-Chevalier
Copy link

Hello,
I have the exact same issue as above:
Error in tmp$r_vals[lr - 1] * tmp$r_vals[lr] : non-numeric argument to binary operator In addition: Warning message: logml could not be estimated within maxiter, rerunning with adjusted starting value. Estimate might be more variable than usual.
This error appears with version 0.7.2 of the package. With the version 0.6.0, everything is fine.
Anyway to work around this error message?
Thanks in advance.
Best,
Mathieu

@singmann
Copy link
Collaborator

Should be solved now. We will update on CRAN asap.

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

No branches or pull requests

4 participants