In: Statistics and Probability
Using newer versions of MATLAB, please write the complete code for:
1. Assume Y is an exponential random variable with rate parameter λ=2. (1) Generate 1000 samples from this exponential distribution using inverse transform method (2) Compare the histogram of your samples with the true density of Y.
Attached is the R code
Now the plot of pdf
The shape of the simulated plot vs actual plot is smilar