## This lab will attempt to fit the normal distribuition, instead of
## the Gamma distribution, to the data used in Homework 10. Any time
## your want more details than provided here, go look at HW10 and keep
## in mind the normal distribution.
## Use the dataset found at the following link:
## https://vincentarelbundock.github.io/Rdatasets/csv/DAAG/droughts.csv
## Read the data into R and store it in a dataframe named df. Assume
## the data under the variable named length are X_1, . . . , X_N ∼ iid
## Normal(mu, sigma^2).
## Estimate the parameters mu and sigma using the likelihood method and the data
## x. Let’s call the estimates mu_hat and sigma_hat.
## Make a histogram of the original data, where the y-axis has the
## density (not counts) on it.
## Overlay a plot of the density function for the Normal distribution
## evaluated using mu_hat and sigma_hat.
## Overlay a plot of the density function for the Gamma distribution
## evaluated using the estimates from HW10 alpha_hat and beta_hat.
## Compare the two density functions to the original data. Does one
## distribuition function seem to be a more realistic interpretation
## of the data? Hint: you should think about what these data
## represent.
## Provide R = 999 estimates of mu, by sampling uniformly and with
## replacement from the original data X_1, . . . , X_N. Don’t forget
## to pre-allocate.
## Make a plot for mu based on the R estimates.
## Provide an 80% interval estimate for mu, by calculating (q10, q90)
## from the R estimates.
## Compare the intervals (q10, q90) from this lab to the interval
## (q10, q90) for the expected value of the Gamma distribution from
## HW10. Is one interval wider/narrower than the other?
## If all you were interested in was the mean of the data, would it
## matter which distribution you use?
## If you were interested in estimating probabilities of the length
## between rain events, would it matter which distribution you use?
## Hint: look at your plot above to better evaluate the answer to this
## question.