Generate a data set from a normal distribution. Then you can apply bootstrap method to the generated data to obtain the empirical distribution of the coefficient of variation: sample standard deviation over sample mean, that is cv = s/¯ x. Describe this distribution. Also please describe the algorithm and attach the R code
We have done this problem in R
we have generated 500 samples from normal(0,1)
then we picked 2000 bootstrap from this and make the plot of CV as
The R code is
data=rnorm(500)
library(boot)
cv <- function( data, indices) {
d <- data[indices] # allows boot to select sample
fit <- sd(d)/mean(d)
return(fit)
}
# bootstrapping with 1000 replications
results <- boot(data=data, statistic=cv,
R=2000)
plot(results)
# the plot is
so the distribution CV concentrated at zero and it is symmetric, we can say that the distribution of CV is t-distribution but not normal since it has outliers
Get Answers For Free
Most questions answered within 1 hours.