Biology, asked by Vivekkandel654, 1 year ago

Composition method for generating random variables examples

Answers

Answered by sanj33v
0
METHOD: The Composition Method can be summarized as follows.
1. Generate the discrete random variable K, following the distribution Prob[K=j] = pj.
2. Generate Yj ~ Fj
3. Set X(U) = Yj
To see why this works, evaluate Prob[X < x] by conditioning on the random variable K.
EXAMPLES: In many simulations, the problem renders itself to conditioning on certain events for a particular outcome of a random variable. In these cases, the composition method is the most natural one to implement.
Hyperexponential


Generate the discrete random variable K P[K=k] = pk, via any of the methods for a discrete random variable.
Generate U ~ U[0,1] independent of K and generate X as an exponential random variable.
Attachments:
Similar questions