Homework 10, Assigned 10/11/17, due 10/20, 6pm ============================================== 14 points NOTE DUE-DATE IS FRIDAY 10/20/17 (6PM) NOT 10/18 AS ORIGINALLY POSTED Consider the dataset "InsectSprays" discussed in class 10/11. (See the second part of Class Log at http://www.math.umd.edu/~slud/s705/Rlogs/ClassF17/ClassLog6F17.txt ) The data consist of 6 groups ("sprays" respectively "A",...,"F", the second column of "factor" type in the InsectSprays data-frame) in which "count" represents 12 observed counts of insects after applications of each type of insect-spray. We saw from exploratory plots that the different sprays had different means and variances. Consider two distinct models: MODEL 1. The counts within each group follow a Negative Binomial distribution with parameters r,p that may be different over different groups. The mean parameters r(1-p)/p are identical across groups with sprays = "A","B","F" and across groups with sprays = "C","D", and "E", but the variances r(1-p)/p^2 may all be different except that the variances (and therefore the (r,p) parameter pairs) must be identical across groups with sprays = "A" and "B". NOTE that the Negative Binomial probability mass function is dnbinom and is a standard function in the main "stats" R package (loaded automatically in each R session). MODEL 2. The counts X within each group follow the distribution of Normal(a,b) random variables X0 truncated to [0,Inf) and to be integers, so that for k>=0 P(X=k) = P(k<= X0 < k+1)/P(X0>=0) = (pnorm((k+1-a)/b)-pnorm((k-a)/b))/(1-pnorm(-a/b)). Again assume that the parameter pairs (alph,bet) may be different within each group, except that alph must be the same for sprays = "A","B","F" and must also be the same for sprays = "C","D","E", and bet must be the same for sprays "A" and "B". Note that both models are for nonnegative-integer count data falling into 6 distinct "spray" groups, and both models have 7 free parameters. (A) Find maximum likeihood estimators of the parameters in both models. (B) Simulate 1000 datasets of size 72 (falling into 6 spray-groups of 12 each) from each of your two fitted models in part (A), and by looking at the distributions of the 1000 Maximum Likelihood parameter vectors you would fit to each of the two models you from each of the (two sets of 1000) simulated models, see whether you can find evidence of lack of fit of either model. [This method being suggested for Part (B) is a kind of "parametric boostrap" analysis to find the reference distribution of each type of parameter MLE from each type of model.]