Slice Sampler Settings for Constrained Random Variables

15 views
Skip to first unread message

Maryclare Griffin

unread,
Apr 28, 2026, 11:34:52 AMApr 28
to nimble-users
Hi - 

Before I delve deeper into nimble options - is it possible to set the slice sampler settings to obtain a fixed interval, basically implementing the original slice sampling procedure for constrained random variables? I'm simulating constrained random variables, so the stepping out procedure isn't really necessary. It kind of seems to me like this might be possible by setting adjustWidth=FALSE but I'm unsure.

If this is hard to answer no worries if it's better that I keep digging and trying things before anyone tries to provide more guidance! I just wanted to ask though in the meantime.

Thanks in advance!
Maryclare

Daniel Turek

unread,
Apr 28, 2026, 12:02:00 PMApr 28
to Maryclare Griffin, nimble-users
Maryclare, good question, and thanks for using the nimble system.  I have a few comments.

I'm not certain what you meant when you mentioned the "adjustWidth" option.  The slice sampler doesn't appear to have that.  Did you perhaps mean "adaptInterval" instead?

No there isn't a way to always use a fixed interval for the slice sampler.  The "adaptInterval" option I mentioned, when set to FALSE, will prevent the sampler from adapting the *width of the increments* used during the "stepping out" procedure.  As it's implemented, the slice sampler always operates by using this "stepping out" - originating from the location of the current parameter value - to determine the "slice" from which to sample the next value.

This said, it's fairly straightforward to copy the source code of the slice sampler, name the sampler something different, and make any changes you're after.  Then, the modified version of the sampler (with a different name) can be manually added to the MCMC configuration, and will be used in the MCMC.  Does that make sense?  If you'd like to try that path, I'd be happy to help you get started, or to take a look at your modified version of the sampler.

Cheers,
Daniel



--
You received this message because you are subscribed to the Google Groups "nimble-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nimble-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/nimble-users/d33425a1-44f1-45c3-b42c-87752a18c809n%40googlegroups.com.

Maryclare Griffin

unread,
Apr 28, 2026, 12:55:59 PMApr 28
to nimble-users
Thanks for your quick response! You were right that I meant "adaptInterval" and wrote too quickly. I'll give copying and modifying the source code a shot when I get a chance, and ask for help if I need it! Thanks again.
Reply all
Reply to author
Forward
0 new messages