Gibbs on funnel

36 views
Skip to first unread message

Bob Carpenter

unread,
Jul 24, 2015, 5:29:59 PM7/24/15
to stan...@googlegroups.com
So I ran the funnel in JAGS

model {
log_sigma_times_two ~ dnorm(0.0, 1.0 / 9.0)
sigma <- exp(log_sigma_times_two / 2.0)
tau <- pow(sigma, -2.0)
for (i in 1:9) {
beta[i] ~ dnorm(0.0, tau)
}
}G

and Gibbs just crushes it:

mu.vect sd.vect 2.5% 25% 50% 75% 97.5% Rhat n.eff
beta[1] 0.02 8.09 -9.15 -0.59 0.00 0.57 10.19 1.02 14000
beta[2] 0.01 8.32 -9.34 -0.58 0.00 0.57 9.68 1.01 20000
beta[3] 0.03 9.13 -9.95 -0.57 0.00 0.59 10.30 1.02 11000
beta[4] -0.01 9.69 -9.35 -0.57 0.00 0.58 10.01 1.05 16000
beta[5] 0.08 10.11 -9.30 -0.56 0.00 0.59 9.93 1.01 7800
beta[6] 0.08 10.16 -9.38 -0.57 0.00 0.61 9.86 1.04 20000
beta[7] -0.03 8.13 -9.64 -0.60 0.00 0.57 9.18 1.02 8100
beta[8] 0.09 7.89 -9.15 -0.60 0.00 0.57 10.19 1.00 20000
beta[9] 0.00 9.18 -9.43 -0.56 0.00 0.58 9.60 1.02 12000
log_sigma_times_two 0.01 2.98 -5.80 -1.99 -0.02 2.03 5.83 1.00 10000
sigma 3.07 8.39 0.05 0.37 0.99 2.75 18.45 1.00 10000

It worked on 100 dimensions just as easily, at which point
I had to conclude that JAGS is able to figure out for this model
that it can sample log_sigma_times_two independently and then just
generate beta. That is, I don't think it can be doing the usual
Gibbs updating using the Markov blanket, which would have it
alternating

p(log_sigma_times_two | beta)

and

p(beta | log_sigma_times_two)

I believe the first would prevent it from going into the neck easily. So I'm
guessing it's just drawing

p(log_sigma_times_two)

- Bob

Michael Betancourt

unread,
Jul 25, 2015, 4:45:23 AM7/25/15
to stan...@googlegroups.com
Well technically the Markov blanket for the
latent variance is just itself, right? Which
is why it can be sampled independently of
the top-level parameters?
> --
> You received this message because you are subscribed to the Google Groups "stan development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Bob Carpenter

unread,
Jul 25, 2015, 4:26:04 PM7/25/15
to stan...@googlegroups.com
The blanket includes parents, children, and children's other parents.
And log_sigma_times_two goes down to beta through the path where tau
is just a deterministic node:

(0, 1/9) --> log_sigma_times_two (--> tau) --> beta

- Bob
Reply all
Reply to author
Forward
0 new messages