Skip to content

Write notebook with hit-and-miss exampleΒ #2

@redeboer

Description

@redeboer

As a follow-up to #1, it would be cool to have a small example of hit-and-miss (accept-reject) sampling in Python (NumPy). I think the two examples that @H178561 worked out are nice:

  1. $\sqrt{1-x^2}$, where you know the maximum is just 1, and you can apply a uniform sampling strategy.
  2. Some function where (ideally) you do not know what the maximum is, so that you have to use a smart strategy to find that maximum numerically as you are sampling.
    It's a bit hard to come up with a simple example where it is hard to find the maximum, but you can also just take two Gaussians and pretend that you don't know the maximum. The idea is the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    πŸ“ DocsImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions