Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Turing MH sampler #324

Merged
merged 1 commit into from
Sep 24, 2022
Merged

Fix Turing MH sampler #324

merged 1 commit into from
Sep 24, 2022

Conversation

devmotion
Copy link
Member

I noticed that I had used the wrong syntax for the MH sampler in Turing in #323. I wanted to use the same random walk proposal as for the mini turing example but currently it uses static Normal(0, 1) proposals. This explains also the low ESS.

It seemed easiest (and probably it's one of the most efficient approaches) to just specify the covariance matrix of the random walk proposals, and it should be more efficient to specify explicitly that it is an identity matrix. Alternatively, but IMO less concise and/or efficient, one could use MH(:a => x -> Normal(x, 1), :b => x -> Normal(x, 1)) or MH(:a => AdvancedMH.RandomWalkProposal(Normal()), :b => AdvancedMH.RandomWalkProposal(Normal())).

@yebai
Copy link
Member

yebai commented Sep 24, 2022

It seemed easiest (and probably it's one of the most efficient approaches) to just specify the covariance matrix of the random walk proposals

That is true for this simple example, which is indeed a two-dimensional Gaussian. However, I don't think we need to be optimal with the sampler here -- the main purpose is to illustrate how the DSL works.

Many thanks for the quick fixes and sorry that I didn't catch it in #323.

@devmotion devmotion merged commit 3cd94dd into master Sep 24, 2022
@delete-merged-branch delete-merged-branch bot deleted the dw/fix_minituring branch September 24, 2022 18:50
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.

2 participants