On 7/21/12 3:44 AM, Andrew Gelman wrote:> I got the 8 schools working (pretty much, if not perfect) by randomizing
epsilon and L at each step.
> Not to stop periodicity but to allow HMC to get stuck from places where big steps or long
> chains will invariably get rejected.
What I don't understand is that there's almost no
rejection.
Currently I'm setting epsilon and L independent:
> epsilon <- runif (1, 0, 2*epsilon.0)
> L <- ceiling (2*L.0*runif(1))
> But now I'm thinking it could be logical to have them be positively correlated.
What's epsilon.0?
Hmm. The BDA report from R2WinBUGS (p. 594) has:
sigma.theta = 6.5, sd = 5.7, n.eff = 23
With MCMC error = sd / sqrt(n.eff) = 1, that's
a pretty fat target. Do we have a better idea of what it should
really be? I'm not sure I trust the n.eff enough
to trust the MCMC se.
Here's Stan's vanilla HMC fit with epsilon = 0.05, L = 128, run
for 2K iterations with random inits in [-2,2]:
fit using Stan 1.0.0,
3 chains, each with 2000 iterations (first 1000 discarded)
n.sims = 3000 iterations saved
mean sd 2.5% 25% 50% 75% 97.5% Rhat n.eff
lp__ -15.8 7.9 -26.9 -21.5 -17.5 -11.9 4.8 1 350
theta[1] 11.2 8.7 -2.6 5.6 9.9 15.3 32.6 1 3000
theta[2] 7.6 6.1 -4.6 3.9 7.7 11.4 19.5 1 390
theta[3] 5.8 7.3 -10.9 1.9 6.4 10.3 19.3 1 260
theta[4] 7.6 6.2 -4.9 3.7 7.5 11.5 19.9 1 1100
theta[5] 5.1 6.1 -8.6 1.6 5.6 9.2 16.3 1 780
theta[6] 6.2 6.3 -7.9 2.5 6.3 10.2 18.1 1 610
theta[7] 10.5 6.9 -1.5 5.7 9.9 14.2 26.3 1 460
theta[8] 8.6 7.4 -5.7 4.1 8.3 12.8 25.0 1 370
mu_theta 7.8 4.9 -2.0 4.6 7.8 10.9 17.7 1 330
sigma_theta 6.3 5.4 0.2 2.2 5.1 8.9 19.4 1 350
NUTS is similar, but seems to systematically give higher estimates
for sigma_theta and a wider range of parameters (but roughly the
same mu_theta). For example, here's a run of 50K iterations
with default NUTS settings:
3 chains, each with 50000 iterations (first 25000 discarded), n.thin = 25
n.sims = 3000 iterations saved
mean sd 2.5% 25% 50% 75% 97.5% Rhat n.eff
lp__ -19.4 4.4 -27.8 -22.5 -19.3 -16.2 -11.5 1 840
treedepth__ 2.4 0.9 1.0 2.0 3.0 3.0 4.0 1 2300
stepsize__ 4.0 0.1 3.8 3.8 4.0 4.1 4.1 1 1
theta[1] 12.2 8.8 -3.0 6.4 11.1 17.1 32.1 1 3000
theta[2] 8.1 6.7 -4.9 3.7 8.0 12.2 21.2 1 3000
theta[3] 5.8 8.2 -11.8 1.1 6.0 10.8 21.3 1 3000
theta[4] 7.5 7.1 -6.7 2.9 7.5 12.0 21.9 1 660
theta[5] 4.4 6.7 -9.5 0.2 5.0 8.8 16.7 1 1000
theta[6] 5.6 7.1 -9.4 1.5 5.8 10.2 19.5 1 3000
theta[7] 11.3 7.1 -1.4 6.4 10.7 15.7 26.4 1 2500
theta[8] 8.6 8.6 -7.5 3.5 8.3 13.7 26.9 1 3000
mu_theta 8.0 5.4 -2.6 4.6 7.8 11.3 19.0 1 2700
sigma_theta 7.9 5.3 2.3 4.1 6.5 10.3 20.9 1 1300
- Bob