Question 2
Please submit worked solutions, including a copy of Stata commands and graphs to the following questions.
(a) Suppose a random variable X has pdf f(x) = 2xe−x2, where x
> 0. Draw a random sample of size 10000 from this distribution.
Draw a histogram of the 10000 sampled values and obtain the sample
mean and standard deviation.
(b) Using your sample obtained above, draw a histogram and
calculate mean and variance for 10000 sampled values for the random
variable Y = X2.
(c) From the pdf f(x) = 2xe−x2, where x > 0, find the
distribution of Y = X2. The distribution of Y is a special case of
which distribution? Hence, what are E(Y ) and Var(Y)? [Hint: look
inside back cover of WMS!] Compare these values with your sample
results above.
a)
f(x) = 2xe−x2, where x > 0 it is the pdf of Weibull distribution with parameter ( =1, k=2) the pdf of weibull distribution is
command of r software
sample=rweibull(10000,2,1)
histo=hist(sample)
histo
> mean=mean(sample)
> std=sd(sample)
> mean
[1] 0.8845851
> std
[1] 0.4665082
b)
> y=sample^2
> mean(y)
[1] 1.000099
> sd(y)
[1] 1.011358
> histo2=hist(y)
c)
E(Y)=1
Var(Y)=1
Get Answers For Free
Most questions answered within 1 hours.