Algorithms Flashcards

1
Q

Inversion algorithm

A
  • generate U

- set X = F-1(U)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Rejection algorithm

A
  • Find eneveloppe g
  • Find M = sup f/g
  • Generate Y from g (inversion)
  • Generate U
  • if u <= f/gM, set X=y
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Box-Muller to generate (X,Y) from N(0,1)

A
  • Generate U1 and U2
  • Set R=(-2log(U2))^(1/2) and A = 2piU1
  • Set X=Rcos(A) and Y=Rsin(A)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Polar Marsaglia to generate (X,Y) from N(0,1)

A
  • Generate U1 and U2
  • Set V1 = 2U1 - 1 and V2 = 2U2 - 1
  • if S = V1^2 + V2^2 <= 1,
    X = (-2/S log(S))^(1/2) V1 = R cos(A) = R V1 / S^(1/2)
    Y = (-2/S log(S))^(1/2) V2 = R sin(A) = R V2 / S^(1/2)
  • otherwise GO TO 1.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Composition f = pi_1 f_1 + … + pi_k f_k

where sum pi_i = 1

A
  • pick i with probability pi_i (using uniform)

- Generate from f_i using rejection

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How to prove Box-Muller and Polar Marsaglia

A

using Jacobian matrix wrt

  • U1 and U2 for Box-Muller
  • V1 and V2 for Polar Marsaglia
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Generate from Poisson from a to b (homogeneous and non-homogeneous)

A

homogeneous:
- draw N from Poi(lambda (b-a))
- generate Xi from U(a,b) for i=1,…,N

non-homogeneous:

  • draw N from Poi(m(b-a)) where m is integral of lambda(t) from a to b
  • generate Xi from U(a,b) for i=1,…,N
  • accept if u <= lambda(xi) / sup lambda
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Generate ordered uniform (to then generate ordered X from inversion)

A
  • U(n) = Un^(1/n)
  • U(k) = U(k+1) Uk^(1/k) for k < n
    think of proof this is ordered
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Generate from discrete

A
  • using rejection : with F-1x(u) = min{x : Fx(x) >=u}

- using RL method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Pros and cons of rejection

A

cf. revision

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Pros and cons of inversion

A

cf. revision

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Pros and cons of Polar-Marsaglia

A

cf. revision

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Pros and cons of Box-Muller

A

cf. revision

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Proof of Box-Muller

A

cf. revision

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Proof of Polar-Marsaglia

A

cf. revision

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

RL method to generate discrete

A

cf. lecture notes