Hi all,
Thank you for building such a great tool. I’ve been using rstan with great success over the past year, and until now have been able to sort out my problems on my own. However, I’m now having an issue with something that seems simple, but I can’t figure out what’s going on.
The model is a hierarchical probit model, with simulated data of individuals purchasing a given product. Individuals are simulated to have 20 observations each, where the person either buys or does not buy at each occassion, and the covariates are the price and an indicator for coupon, all set randomly. The simulation is included in the attached code.
I am having problems with the initialization: regardless of whether I set the inits, or let stan do it, I get the same error:
“SAMPLING FOR MODEL 'probit' NOW (CHAIN 1).
Error :
Initialization between (-2, 2) failed after 100 attempts.
Try specifying initial values, reducing ranges of constrained values, or reparameterizing the model.
error occurred during calling the sampler; sampling not done”I have tried initializing at exactly the simulated values and get the error. There are a few other things I’ve investigated.
- The non-hierarchical equivalent has no issues, with the parameter set at the prior mean from the hierarchical version
- The same error presents regardless of the hyperprior specification. I have tried not specifying a hyper prior, set it to be Wishart, Inverse Wishart, and as you can see in the attached, the recommended LKJ formulation from the stan reference manual. Regardless, I get this error.
- I have tried specifying the model in a vectorized form (beta and y vectorized), and nothing changes.
- I’ve tried varying the simulation parameters and the initialization, and nothing changes the error.
I believe I’ve set the constraints correctly, and I don’t think there is anything noteworthy (bad or good) about the parametrization, but undoubtedly I'm wrong on one of these. Please let me know if you have any insight!
Thanks for your help!
Ryan
In case needed, the sessionInfo():
R version 3.1.3 (2015-03-09)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.1 (Yosemite)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base
other attached packages:
[1] rstan_2.6.0 inline_0.3.13 Rcpp_0.11.5 MASS_7.3-39
loaded via a namespace (and not attached):
[1] codetools_0.2-10 stats4_3.1.3 tools_3.1.3