Hierarchical model that was supposedly difficult to fit in Stan

204 views
Skip to first unread message

Andrew Gelman

unread,
Oct 26, 2016, 4:14:42 PM10/26/16
to stan development mailing list, Stan users mailing list
Hi--I think this came up before on the Stan list, but I'm not sure. What I remember is that we asked what this model was that was supposedly so hard to fit in Stan, and it turned out it was very easy to fit in Stan, it did not require any "clever programming contrivances."

If someone can remind me what this model is, I could post something on it on the blog, as I'd like to dispel this confusion. If people remain confused on this point, we could write a program to have the post reappear on the blog and on other social media until eventually everyone understands.

A

> On Oct 26, 2016, at 11:42 AM, Michael Betancourt <notifi...@github.com> wrote:
>
> Easy to specify does not mean that the resulting fit will
> be fast or even right. Gibbs samplers that are easily
> implemented for models with discrete parameters can
> be very slow and and in many cases do not even explore
> sufficiently well, causing biased expectation estimation.
> Kruschke�s comment here is statistically naive and when
> taken seriously quite dangerous.
>
> When coupled with the technical difficultly of calculating
> the terms necessary for implementing Gibbs sampling or
> Random Walk Metropolis with models featuring both
> discrete and continuous parameters, we are not eager
> to support discrete parameters. Especially when with
> a little work most of these models can be implemented
> with marginalization in Stan.
>
> Of course we are actively researching and in contact
> with the vanguard of the statistical community, and
> if a robust sampler for discrete parameters is introduced
> it will be considered for Stan as soon as possible.
>
> On Oct 25, 2016, at 6:36 PM, skanskan <notifi...@github.com> wrote:
>
> > I don't speak well English but I can quote some words from the book Doing Bayesian Data Analysis:
> > "The lack of discrete parameters in Stan means that we cannot do model comparison as a hierarchical model with an indexical parameter at the top level. There might be ways to work around this restriction by using clever programming contrivances, but presently there is nothing as straight forward as the model specification in JAGS.
> >

Bob Carpenter

unread,
Oct 26, 2016, 4:52:18 PM10/26/16
to stan-...@googlegroups.com, stan development mailing list
What's "very easy" for one person is a "contrivance" for another.
We regularly get requests to add discrete sampling
because users find the marginalizations both difficult and error prone.
As Michael and I are pointing out, there are huge advantages in
efficiency from marginalization, and in some cases it allows us to do
inference in models where discrete sampling gets stuck. In other cases,
discrete sampling is challenging if not impossible, as in Ising models
or the combinatorially similar variable selection models.

It's come up with mixtures, the Cormack-Jolly-Seber model in
ecology, and change-point models, all of which are explained in
the manual. All of Kery and Straub's book has been translated and
also Wagenmakers and Lee, both of which contain quite a few BUGS/JAGS
models with discrete parameters.

PyMC3 is a directed graphical modeling building language, so they were
able to combine HMC and discrete sampling. I think there's a lot of work
to do on efficiency, but if we were to look into it seriously, we'd
probably start there. But given that it doesn't really expand the models
we can fit reliably, it's not a high priority for us.

- Bob
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
> To post to this group, send email to stan-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>

Avraham Adler

unread,
Oct 26, 2016, 5:50:41 PM10/26/16
to stan development mailing list, stan-...@googlegroups.com, gel...@stat.columbia.edu
On Wednesday, October 26, 2016 at 4:14:42 PM UTC-4, Andrew Gelman wrote:
> Hi--I think this came up before on the Stan list, but I'm not sure. What I

Did you mean this thread?

https://groups.google.com/d/msg/stan-users/OkBQ5AaQQFw/PCylEl5GAQAJ

Avi

Reply all
Reply to author
Forward
0 new messages