Open maxwaldo opened 3 years ago
Hi max waldo, You are spot on. I am having the same problem with Bayesian Models code 10-26. Adding errors in measurements to the code and controls to minimize them results in the same error. Have same R and RStan versions and Big Sur 11.5.2. I suspect RStan is the culprit, because I ran the same code with introduced measurement errors and controls some time ago and got nearly the same results given in the book. Thanks for your input. As a rank amateur I began to think I had made one or more code errors. Is there a way to obtain the previous RStan package? Never had a problem with it.
I stumbled onto a solution. I went to Stan home page , click on quick start guide, go down page to "If you are using R version 3.x on a Mac, go to here and click it (trust me!) Follow instructions to install RStan from source and all down to and including install.packages("rstan", type = "source" ) . After pages of screen output you have rstan version 2.21.2 that works with control. I assume you already have a C++ tool chain installed. I have C++ 12.0 from command line tools. Cheers.
Summary:
The issue arise when I try to add control in a model. While I can have rstan up and running, when I try to increase the delta with the command "control=list(adapt_delta=0.9)" it throws the error: "Error in unserialize(socklist[[n]]) : error reading from connection". I was wondering whether there might be an issue when pasting the controls to the model.
Description:
I have a Stan model that returns some divergence - 3 for 2000 iterations in four chains. I already used non-centric parametrisation but the only way to get ride of these divergence is to slightly increase the step size for the NUTS algorithm. While there was no issue to do so in the past, it was recently impossible to do. I install rstan on my Mac and my Window computer and the issues are persistent in both cases.
To be clear: the model runs as long as I don't specify the "control" parameter. If I specify a control parameter with an empty list the model still runs. As long as I try to specify any specifics in the control parameter - adapt_delta, max_treedepth, etc. - the sampling is not done and the error "Error in unserialize(socklist[[n]]) : error reading from connection". This issue did not exist in the past and is persistent across operating systems (Mac and windows).
Reproducible Steps:
Here is an example of the "eight school model"
RStan Version:
R Version:
R 4.1.0
Operating System:
OS X 11.4 but also on a window computer.