Question 6. Using only a random number generator that simulates a random number between [0,1], simulate 1,000 iterations of the following random variables:
a) X ~ exp(5)
b) X such that f(x) = 3x2 , 0 ≤ x ≤ 1
For both (a) and (b), plot a histogram of your simulated random variable. Estimate ?̅ and s2. Compare these values to E(X) and Var(X).
GIVEN THAT
Using only a random number generator that simulates a random number between [0,1].
(a) exponential (5)
Inverse tranformation
U=
-5x=log(l-U)
x=
(b) we have
=
=3
The inverse transformation
U=
x=
We were unable to transcribe this image
R Graphics. Device 2 (ACTIVE) histogram of mean1 250 200 200 150 150 Frequency 100 BE 100 50 0 0.18 0.19 0.20 0.21 0.22 mean1 CS Scanned with CamScanner
R Graphics: Device 2 (ACTIVE) histogram of variance1 200 150 Frequency 100 0.030 0.035 0.040 0.045 0.050 variance 1 Scanned with CamScanner
> #b) > mean2=c0 > variance2-ci > for(i in 1:1000) 02-runit (1000, 0, 11 Biances t racta mean maz histogram of meat ) et ivarzarca 2, Lainhi stoguan of variance2"}
QR Graphics: Device 2 (ACTIVE) DX histogram of variance2 250 200 150 Frequency i 100 50 0.032 0.034 0.036 0.038 0.040 0.042 0.044 variance2 ES Scanned with CamScannen
CORR Graphics Device 2 (ACTIVE) histogram of mean2 300 250 200 Frequency 150 100 50 0.73 0.75 MM 0.76 0.77 cs Scanned with mean2 CamScanner
Get Answers For Free
Most questions answered within 1 hours.