In: Statistics and Probability
Suppose the proportion of left-handed individuals in a population is θ. Based on a simple random sample of 20, you observe four left-handed individuals. Using R
a) Assuming the sample size is small relative to the population size, plot the loglikelihood function and determine the Maximum Likelihood Estimate.
b) If instead the population size is only 50, then plot the log-likelihood function and determine the MLE. (Hint: Remember that the number of left-handed individuals follows a hypergeometric distribution. This forces θ to be of the form i/50 for some integer i between 4 and 34. From a tabulation of the log-likelihood, you can obtain the MLE.)
a) When the sample size is small relative to the population size, the number of left-handed individuals
follows Binomial distribution.
The PMF of X is
The likelihood for observation is
Differentiating with respect to and equating to 0,
b) The probability of observing left-handed individuals is
. Where
Also
The loglikelihood is printed below:
[,1] [1,] -3.861436 [2,] -2.679442 [3,] -2.020196 [4,] -1.624883 [5,] -1.397099 [6,] -1.288886 [7,] -1.272756 [8,] -1.331597 [9,] -1.454199 [10,] -1.633018 [11,] -1.862941 [12,] -2.140573 [13,] -2.463800 [14,] -2.831525 [15,] -3.243505 [16,] -3.700263 [17,] -4.203057 [18,] -4.753888 [19,] -5.355563 [20,] -6.011806 [21,] -6.727426 [22,] -7.508584 [23,] -8.363181 [24,] -9.301451 [25,] -10.336884 [26,] -11.487747 [27,] -12.779731 [28,] -14.251018 [29,] -15.963314 [30,] -18.031327 [31,] -20.739377
The loglikelihood is plotted below.
:
The likelihood is maximized at . So the MLE is
R code below:
X <- 4:34
N <- 50
P <- choose(X,4)*choose(N-X,16)/choose(N,20)
L <- log(P)
ML <- matrix(L,nrow=31,ncol=1)
ML
plot(X, L, type="l", col="blue", main="Loglikelihood")