Give an algorithm to generate random variates from the following probability density function.
f(x) = 2x/3 if 0<=x<=1
=1-x/3 if 1<=x<=3
To generate an algorithm to generate a random variate, we compute the cumulative distributive function here as:
F(1) = 1/3
For x > 1,
Therefore the CDF for X here is obtained as:
Now to create a random variable,
First step is to select a number from the uniform distribution (0,1)
Let it be 0.2 for example.
Now for 0.2, we obtain the random number from the distribution as:
Therefore 0.7746 is one of the random number here.
This is how we can obtain any random variate from the given uniform distribution (0,1)
Get Answers For Free
Most questions answered within 1 hours.