Skip to content

Conversation

@twiecki
Copy link
Member

@twiecki twiecki commented Jan 31, 2017

I started experimenting with better NUTS initialization. What stan does is to run a NUTS chain and then estimate the posterior covariance from that run. This cov matrix is used as the mass matrix for the actual NUTS run.

This PR removes some options of initialization (like MAP) which I think are useless but adds a single path. We also use LedoitWolf regularization here like STAN does. I get better sampling for the tricky hierarchical GLM model.

This PR also makes obvious that NUTS' hyperparameters can't be properly set, as internally we only compute the integration times in log-space, but allow passing in non-log, so this setting of NUTS parameters externally is a bit clunky.

Suggestions welcome.

@twiecki
Copy link
Member Author

twiecki commented Jan 31, 2017

Without NUTS init:
image

With NUTS init:
image

Still problematic, might require RMHMC.



def sample(draws, step=None, init='advi', n_init=200000, start=None,
def sample(draws, step=None, n_advi=200000, n_nuts=2000, start=None,
Copy link
Member

@fonnesbeck fonnesbeck Feb 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little uncomfortable encoding particular algorithm names in the arguments of sample. Can we just not condition internally depending on which step is used?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I'm starting to think about this as init-programs. This new one uses ADVI+NUTS. Perhaps just an init_kwargs dict that can get passed is most general?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so. It limits what we can provide in terms of a docstring, but keeps things general. Another option would be a more explicit init_params argument that could vary depending on the init method chosen.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep exactly. There could be different init-functions and we always forward **init_params.

@junpenglao
Copy link
Member

@twiecki I think this can be close now?

@junpenglao
Copy link
Member

close in favor of #2327

@junpenglao junpenglao closed this Jul 16, 2017
@junpenglao junpenglao deleted the nuts_tuning branch January 6, 2018 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants