Monte Carlo Method
Definition
Monte carlo method is a stochastic approximation based on sampling.
Application
An important application of this method is the intergral calculation.
For
Then a question comes along: How to know the posterior? How to sample from the posterior?
Sampling Methods
There are several sampling methods.
Sampling via CDF
Ideally, if one samples
This method only works for very simple PDF/CDF forms, e.g. normal distributions.
Rejection sampling
Rejection sampling means that for the probability of
then we define
Rejection sampling steps:
- sample
- sample
- decision:
- if
, accept ; - else, reject
- if
Importance sampling
Importance sampling samples from the expectations
where the