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

improve ABC sampler #3940

Merged
merged 5 commits into from
Jun 9, 2020
Merged

improve ABC sampler #3940

merged 5 commits into from
Jun 9, 2020

Conversation

aloctavodia
Copy link
Member

Simplify the specification of the abc sampler as previously we had a distance and a kernel with was redundant. Now we only have a gauss_kernel as the only one distance (in a future PR I will probably add more distances, but I need to do some reading and testing before that). This also adds more flexibility to define summary statistics, including user defined statistics. Finally this allows to define more complex models as the simulator can be feed with a subset of the prior parameters.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

Review Jupyter notebook visual diffs & provide feedback on notebooks.


Powered by ReviewNB

@aloctavodia aloctavodia changed the title Abc exp improve ABC sampler Jun 4, 2020
@aloctavodia aloctavodia requested review from AlexAndorra, ColCarroll and michaelosthege and removed request for AlexAndorra and ColCarroll June 8, 2020 12:29
Copy link
Contributor

@AlexAndorra AlexAndorra left a comment

Choose a reason for hiding this comment

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

I'm no expert on the sampler per se, so I'll defer to more experienced people on the guts of the sampler.
With that in mind, this looks good to me and will be useful when porting chapter 16 of Rethinking 2 😉
I just added some comments on the NB, with the goal of gradually standardizing our NBs galleries.

Copy link
Member

@michaelosthege michaelosthege left a comment

Choose a reason for hiding this comment

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

I'm not familiar with the sampler either, but I assume you've tested it thoroughly?

The breaking API changes should be mentioned in the release notes.

Distance function. The only available option is ``gaussian_kernel``
sum_stat: str or callable
Summary statistics. Available options are ``indentity``, ``sorted``, ``mean``, ``median``.
If a callable is based it should return a number or a 1d numpy array.
Copy link
Member

Choose a reason for hiding this comment

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

These breaking changes should be mentioned in the release notes

pymc3/distributions/simulator.py Outdated Show resolved Hide resolved
pymc3/smc/smc.py Show resolved Hide resolved
@michaelosthege michaelosthege added this to the 3.9.0 milestone Jun 8, 2020
@aloctavodia
Copy link
Member Author

I'm no expert on the sampler per se, so I'll defer to more experienced people on the guts of the sampler.
With that in mind, this looks good to me and will be useful when porting chapter 16 of Rethinking 2 wink
I just added some comments on the NB, with the goal of gradually standardizing our NBs galleries.

It should work, but I guess pm.ode will work better.

@aloctavodia
Copy link
Member Author

Thanks for the comments!

Copy link
Contributor

@AlexAndorra AlexAndorra left a comment

Choose a reason for hiding this comment

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

All good now, thanks @aloctavodia 👌
I'll let @michaelosthege merge once he approves the changes

@michaelosthege michaelosthege merged commit dc574b7 into pymc-devs:master Jun 9, 2020
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