Question: Please provide the python code 4. (Coding) Let X be an exponential random variable Exp(a), so that the probability density function is f(x) = leds,

Please provide the python code 4. (Coding) Let X be an exponentialPlease provide the python code

4. (Coding) Let X be an exponential random variable Exp(a), so that the probability density function is f(x) = leds, for 2 > 0. Recall that the mean is p = 1/2 and the standard deviation is o= = 1/1 = 1. (See Slide 36 of T2.) Suppose that we do not know the true value of the population mean u and want to estimate it from observed data {X1, X2,...,x,}. There are two possible ways to estimate : (1) use the sample mean X = 1 + X. and (2) use the sample standard deviation - VEZ(X; - ). a. Generaten = 20 independent E-p() random variables, calculate the sample mean. Repeat the above for 1000 times, then you have 1000 i.i.d. observations of the sample mean (each of them is calculated from n = 20 independent Exp(1) random variables.) Generate the boxplot and histogram of the 1000 observation of sample means. b. For n = 20, repeat Part 1 with the sample standard deviation. C. Compare the boxplot and histogram you obtained from Part 1 and 2. Comment on the difference between them. (Hint: range? skewness? IQR? etc.) d. For n=100, using the central limit theorem, find an appropriate normal pdf to approximate the histogram for 1000 sample means. Overlay the normal pdf you choose onto the histogram of the 1000 sample means. S= 4. (Coding) Let X be an exponential random variable Exp(a), so that the probability density function is f(x) = leds, for 2 > 0. Recall that the mean is p = 1/2 and the standard deviation is o= = 1/1 = 1. (See Slide 36 of T2.) Suppose that we do not know the true value of the population mean u and want to estimate it from observed data {X1, X2,...,x,}. There are two possible ways to estimate : (1) use the sample mean X = 1 + X. and (2) use the sample standard deviation - VEZ(X; - ). a. Generaten = 20 independent E-p() random variables, calculate the sample mean. Repeat the above for 1000 times, then you have 1000 i.i.d. observations of the sample mean (each of them is calculated from n = 20 independent Exp(1) random variables.) Generate the boxplot and histogram of the 1000 observation of sample means. b. For n = 20, repeat Part 1 with the sample standard deviation. C. Compare the boxplot and histogram you obtained from Part 1 and 2. Comment on the difference between them. (Hint: range? skewness? IQR? etc.) d. For n=100, using the central limit theorem, find an appropriate normal pdf to approximate the histogram for 1000 sample means. Overlay the normal pdf you choose onto the histogram of the 1000 sample means. S=

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!