DESCRIPTION Please keep in mind the OMSI rules. Save your files often. Submit each answer individually and make sure you receive the notification of successful submission. Don't wait till the last moment to submit all answers, as there might be network traffic in the last 5 minutes causing unexpected delay and failure. Remember that clicking CopyQtoA will copy the entire question box to the answer box. In questions involving code which will PARTIALLY be given to you in the question specs, you may need to add new lines. There may not be information given as to where the lines should be inserted. MAKE SURE TO RUN THE R CODE ANSWER IN PROBLEMS THAT INVOLVE R CODE! QUESTION (Text answer - 25 pts) The R function predict() is not a real function, but rather is a placeholder. The R interpreter will then dispatch the call to the real function for the situation, based on the class of the object on which it's called. We say that predict() is an example of ______________ functions in R. QUESTION -ext .R -run 'Rscript ./omsi_answer2.R' (R code answer - 25 pts) The R function var() computes the sample variance in the classical, "divide by n-1" way. Write a function that calls var() and converts the result to our "divide by n" way. (You must call var().) varDivByN <- function(x) # x is vector of sample { } print(varDivByN(c(5,12,13,8.88))) QUESTION -ext .R -run 'Rscript ./omsi_answer3.R' x. (R code answer.) Say we have a random sample, X_1, X_2, ... , X_n from some population in which X has unknown density f_X. We will form a histogram, but with freq = TRUE so we get actual bin counts. Say our bins are (i-1,i] for i = 1,2,...,25, with an extra bin (25,infinity). Suppose, unknown to us, f_X is exponential with mean 2.0. Let N_i be the count for bin i, i = 1,2,...,25. Find Var(N_i). varHist <- function(n,i) { } print(varHist(100,2)) QUESTION -ext .R -run 'Rscript ./omsi_answer4.R' (R code answer - 25 pts) Write a function that computes the Method of Moments estimates of r and lambda for a Gamma distribution (Sec. 7.6.4.1). Here x will be a vector consisting of our sample data X_i, i = 1,2,...,n. mmGamma <- function(x) { estR <- estLambda <- return(c(estR,estLambda)) } print(mmGamma(c(5,12,13,8.88)))