Question
In this Python exercise we generate independent 1000 exponential random variables with mean 2 from independent 1000 uniform random variables on (0, 1) by the
In this Python exercise we generate independent 1000 exponential random variables with mean 2 from independent 1000 uniform random variables on (0, 1) by the following steps.
(a) Use Python to generate the independent 1000 uniform random variables (say U1, . . . , U1000) on (0,1).
(b) Find the inverse function F 1 () of the cumulative distribution function F (x) = 1 exp((1/2)x) , x > 0 of exponential distribution with mean 2 , that is, F 1 (F (x)) = x for x > 0 .
(c) Using the result of the previous problem, generate exponential random variables (e1, . . . , e1000) in Python by
ek := F1(Uk); k = 1,...,1000.
This method is called the inversion method. (Hint: Read section 11.2.1). (d) Using Python compute mean and variance of (e1, . . . , e1000) , and then plot its histogram.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started