Use r statistical software to
Pick a population with a particular distribution.
From the population use software to obtain k random samples (for example k = 10) each containing n elements (for example n = 30.)
Give the distributions of X̄
For each sample, calculate the value of the statistic and construct a histogram of the k values. This histogram gives the approximate sampling distribution of the statistic. The statics of interest are X̄ and V (X̄ )
Calculate E(X̄) and V (X̄)
We choose a exponential distribution with rate parameter . Thus . The distribution of the sample mean is
The histogram of sampling distribution is plotted below for n= 30, k= 100.
The histogram is approximately normal.
The empirical values of mean and variance are
The theoretical values are,
R code below:
set.seed(47757)
lambda <- 0.2
n <- 30
k <- 100
Xbar <- array(dim=k)
for (i in 1:k)
{
X <- rexp(n,lambda )
Xbar[i] <- mean(X)
}
plot(1:1)
dev.new()
hist(Xbar, freq=FALSE, main= "Histogram of sample means of
Exponential distribution", lwd=2, col = "sky blue",
xlab=expression(bar(X)), ylab = "Density")
mean(Xbar)
var(Xbar)
Get Answers For Free
Most questions answered within 1 hours.