All Notes Flashcards
What two words sum up Monte Carlo?
Random Simulation
What is Monte Carlo?
Studying the behaviour of a random system by stimulating the outcome many times rather than by applying math theory.
What is a fundamental building block for everything in Monte Carlo?
Assuming we have an inexchaustible supply of independent random values which are uniformly distributed on (0,1)
What are three properties of the uniformly distrubtued independent random values we use in Monte Carlo?
What is the c.d.f of U?
Draw the p.d.f of U
Draw the c.d.f of U
What is the algortithm for simulating a fair coin toss?
- Take one U
- The coin toss outcome is
- Head if U ≤ ½
- Tails if U > ½
Describe the Bernoulli distribution.
The Bernoulli distribution with probability p of “success” has two possible outcomes 0 and 1, and probability of 1 is p ∈ [0,1].
What is the algorithm for simulating the Bernoulli distribution?
- Take one U
- Set B =
- 1 if u ≤ p
- 0 if u > p
Prove that the algorithm for simulating the Bernoulli distribution is the following.
- Take one U
- Set B =
- 1 if u ≤ p
- 0 if u > p
How do you simulate from any discrete distribution?
* Let Y be a discrete random variable with possible values x1, …, xm (possibly no finite m)
- ℙ[Y = xi] = pi with pi ≥ 0 and ∑pi = 1
- Set Qj = ∑i=1jpi for j = 1, 2, …., m such that
- Qo ≤ Q1 ≤ Q2 ≤ ….
- Define Q0 = 0, and note than pi = Qi - Qi-1 for all i and that Qm = 1 when m is finite
- And use the following algorithm:
- Take one U
- Set Y٭= xi if Qj-1 < u < Qi
What is the algorithm for simulating any discrete distribution?
- Take one U
- Set Y٭= xi if Qj-1 < u < Qi
Prove that the algorithm for simulating any discrete distribution is:
- Take one U
- Set Y٭= xi if Qj-1 < u < Qi
Why do we distinguish Y and Y٭?
- Y٭ is the value from MC sampling
- Y may be a different “real world” quantity
What are the two ways to simulatie the binomial distribution?
- Binomal is discrete so apply the discrete algorithm
- Each trial corresponds to n Bernoulli random varibles so use the Bernoulli
Describe how you can use the Bernoulli random variable to simulate a Binomial trial.
- Use the Bernoulli algortithm (bern(p)) to generate B1, …, Bn
- Set Y = B1 + … + Bn (couting how many 1’s there are)
- Y is the number of successes in n independent trials with probability p of sucess in each trial
What are three properties of a c.d.f F(x)?
What is the cdf for a discrete distribution with possible values x1 < x2 < … < xm with corresponding probabilites p1, …, pm?
What is the c.d.f for an absolutely continuous distribution?
What is the definition of the generalised inverse of a c.d.f.?
For any c.d.f F, define F-1:(0,1) ➝ ℝ by
F-1(u) = min {x∈ℝ: F(x) ≥ u}
“The lowest value of x for which F(x) is at least u”
Why do we need a generalsied definition for the inverse of cdf?
Because the true inverse does not always exist
Finish this theorm: For any c.d.f F, any u ∈ (0,1) and any y ∈ ℝ:
F-1(u) ≤ y ⟺ … ?
F-1(u) ≤ y ⟺ F(y) ≥ u
Prove this theorem: For any c.d.f F, any u ∈ (0,1) and any y ∈ ℝ:
F-1(u) ≤ y ⟺ F(y) ≥ u.
What is the algorithm to sample from X with cdf FX using the inverse transform method?
- Take one U
- Set x٭ = FX-1(u)
Finish this theorm about the inverse transform method: The cdf of X٭ is … ?
FX
Prove the following theorem: The cdf of X٭ is FX.
What is the algorithm for sampling from Exp(λ) using the inverse transform method?
- Take one U
- Set X = -1/λ log(u)
How do you find the inverse transform function?
- Change x in the cdf to x٭
- Set the cdf equal to U
- Rearrange to make equal to x٭
Give two reasons why you might not want to use the inverse transform method?
- Difficult
- Computationally expensive to apply
In what scenario do yo use the acceptance-rejecting?
We want to sample from a pdf f(x) and we have another pdf h(x) for which we already know how to sample from h and ∃ c ∈ ℝ such that ch(x) ≥ f(x) ∀ x ∈ ℝ.
What is the algorithm for sampling using the acceptance-rejction method?
Draw a picture of the two pdfs for the acceptance-rejection method.
Finish this theorem: the pdf of x from the acceptance-rejection algorithm is .. ?
f
Prove the following theorem: The pdf of x from the acceptance-rejection algorithm is f.
In the acceptane-rejection sampling what is 1/c known as?
The “acceptance rate”.
What s the P[accept X∼] in acceptance-rejection sampling?