Does Stan support parameter blocks?

96 views
Skip to first unread message

Kenneth Moore

unread,
Dec 23, 2016, 1:35:02 PM12/23/16
to Stan users mailing list

I currently use the mcmc procedure in SAS and am interested in switching to Stan for GLM modeling. One of the features in sas which helped immensely with chain convergence was the ability to assign groups of parameters to individual parameter blocks, each block in its own Markov chain. I could not find any Stan documentation on blocking of parameters. 


Here's a description of the process currently implemented in sas:http://support.sas.com/documentation/cdl/en/statug/66859/HTML/default/viewer.htm#statug_mcmc_details05.htm


The Julia language has a similar implementation, below is an excerpt from their support site:

"Mamba holds other distinct advantages over existing offerings. In particular, it provides arbitrary blocking of model parameters and designation of block-specific samplers; samplers that can be used with the included simulation engine or apart from it"

http://mambajl.readthedocs.io/en/latest/intro.html



Ben Goodrich

unread,
Dec 23, 2016, 2:01:08 PM12/23/16
to Stan users mailing list
On Friday, December 23, 2016 at 1:35:02 PM UTC-5, Kenneth Moore wrote:

I currently use the mcmc procedure in SAS and am interested in switching to Stan for GLM modeling. One of the features in sas which helped immensely with chain convergence was the ability to assign groups of parameters to individual parameter blocks, each block in its own Markov chain. I could not find any Stan documentation on blocking of parameters. 


Depending on how you look at it, there are no blocks or all of your parameters go into one block. Either way, all the parameters are proposed jointly, which is why it converges very quickly if you define a posterior that has reasonable geometry.



Bob Carpenter

unread,
Dec 23, 2016, 2:43:00 PM12/23/16
to stan-...@googlegroups.com
The blocking algorithms provide a single Markov chain
that alternates sampling subsets of the parameters.
BUGS and JAGS, for example, block all of their multivariate
parameters.

As Ben says, we update all in one block.

To compare samplers, write the same model in each and
measure the effective sample sizes divided by time it
took to fit. And use our n_eff measure to keep a level
playing field---it's more conservative than other estimators
people use for n_eff.

NIMBLE is the closest tool in R to something like
Mamba.jl and PyMC3 lets you block HMC and NUTS in Python.
We're probably not going to add blocking to Stan any time
soon because with HMC, it tends to reduce mixing rather than
enhancing it (though see Radford Neal's overview of HMC where
he blocked hierarchical parameters---the best approach we've
found is to reparameterize).

- 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.

Michael Betancourt

unread,
Dec 23, 2016, 3:33:51 PM12/23/16
to stan-...@googlegroups.com
Yup — blocking is a hold-over from the Gibbs sampler days.
It does not improve performance when using HMC and its
variants except in a very few rare exceptions (essentially
circumstances where you can implement HMC analytically
for components of the model, but even then the model has
to be just write for the analytical speedup to be worth the
slow down from updating based on conditionals).

Kenneth Moore

unread,
Dec 24, 2016, 1:41:15 PM12/24/16
to Stan users mailing list
This is really helpful. Sas only implemented HMC/NUTS in the last year.  I was very excited when it was released but when we tested any samplers outside of Gibbs we got unexpected results. I suspect now that the blocking schema we use may not work well with HMC/NUTS.  

This actually makes implementation much easier.  Thanks guys!

Sent from BlueMail
Reply all
Reply to author
Forward
0 new messages