Use R statistical software to answer the following:
Let X1, ..., X6 be a random sample of size n = 6 from the distribution with pdf
f(x) = x / 8 , 0 < x < 4 and 0 otherwise.
(a) Use Monte Carlo to calculate Var(Xbar), and knowing that Var(Xbar) = sigma^2 / n, what is the true value of Var(Xbar)?
## use runif() to generate samples
set.seed(9999)
n=10000
m={}
for(i in 1:n){
x=(16*runif(6))^0.5
m[i]=mean(x)}
var(m)*(n-1)/n
[1] 0.1483157
Get Answers For Free
Most questions answered within 1 hours.