I also realized why I was seeing so many rejections.
The simple models I've been looking at have had
median tree depth of one, so rejection rate is roughly
equal to average rejection rate on the second half of
the trees.
Now onto the real issue.
On 9/5/12 1:24 PM, Matt Hoffman wrote:
> Odd, I got perfectly reasonable results when I ran this model�samples
> for mu in the range of about (-0.5, 1.5) and samples for sigma in the
> range of about (0.8, 1.5).
I like that answer better than mine :-)
Maybe I messed up the data simulation, but it looks
OK to me plotted in R. I checked the model and data
in at:
src/models/basic_estimators/truncated_normal.stan
/truncated_normal.Rdata
Would you (Matt) mind running the checked in version to see
if it gives you OK results?
Here's what I get after 50K samples in a single
chain (though running longer or more chains
doesn't matter -- it settles on this answer
pretty quickly). Here's what the output looks
like, with simulated mu = 0, sigma = 1:
> quantile(tns$mu)
0% 25% 50% 75% 100%
-0.1016810 0.5404598 0.8620630 1.2935150 3.7038100
> quantile(tns$sigma)
0% 25% 50% 75% 100%
0.961492 1.225290 1.332955 1.457465 1.974080
> colMeans(tns)
lp__ treedepth__ stepsize__ mu sigma
80.4058466 1.3740000 0.1573470 0.9808178 1.3553201
I have switched to the latest compilers on Mountain
Lion. I never used to question the compiler or system
before I moved to C++!
- Bob