Question: (2) The negative binomial distribution can be generalised for r E (0, co) (ie. non- integer values) by expressing the choose function in terms of

 (2) The negative binomial distribution can be generalised for r E

(2) The negative binomial distribution can be generalised for r E (0, co) (ie. non- integer values) by expressing the choose function in terms of gamma functions: r(k +r) f (k |r, P) = r(k + 1)I(r) p* (1 - p)". Here k is a non-negative integer. Consider iid X1, ..., X100 ~ NBin(r, p). There is no closed-form expression for the MLE of (r, p). (a) Write R code to calculate the negative log-likelihood for (r, p), given values of X1, ..., X100. (Hint: Use the R function debinom with size = r and prob = 1 - p.) (b) Write R code to generate values of X1, ..., Xion with r = 2 and p = 0.8. Evaluate MLE estimates (r, p) numerically using the mle function in the stats4 package. (c) Simulate 1000 such data sets and evaluate MLE estimates of (r, p) for each one. Summarize your results with a scatterplot of points (r, p) and separate histograms for r and p

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!