基于表格数据的几何分布参数p的MLE求解及应用疑问
Hey there! Let's walk through how to handle this geometric distribution MLE problem when you don't have the exact frequencies for the final groups. I know you already get the basic approach with the sample mean, so let's focus on the grouped data twist.
First, let's clarify the geometric distribution definition we're using here (since there are two common ones): we'll go with the "number of trials until the first success" version, where ( X = 1, 2, 3, ... ) and the probability function is:P(X=k) = (1-p)^(k-1)p
For full, ungrouped data, the MLE of ( p ) is indeed the reciprocal of the sample mean:\hat{p} = 1/\bar{X}
Where ( \bar{X} = (\sum x_i)/n ), and ( n ) is the total number of observations. This is what you referred to as multiplying frequencies by their values, summing, dividing by ( n ), then taking the reciprocal.
When you only have frequencies for ( X=1 ) to ( X=m ), and know the total sample size ( n ) (but not the exact counts for ( X \geq m+1 )), here's how to adapt the MLE:
Key Setup
- Let ( f_1, f_2, ..., f_m ) be the known frequencies for ( X=1 ) to ( X=m )
- Let ( f_+ = n - (f_1 + f_2 + ... + f_m) ): this is the total number of observations in the final grouped category (( X \geq m+1 ))—we don't need individual counts, just this total.
- The tail probability for ( X \geq m+1 ) is ( P(X \geq m+1) = (1-p)^m ) (this comes from summing the infinite geometric series for ( k=m+1 ) to ( \infty )).
Step 1: Build the Likelihood Function
For grouped data, the likelihood accounts for both the known individual groups and the final tail group:
L(p) = [product from k=1 to m of P(X=k)^f_k] * P(X≥m+1)^f_+
Substitute the probability expressions:
L(p) = [product from k=1 to m of ((1-p)^(k-1)p)^f_k] * [(1-p)^m]^f_+
Step 2: Log-Likelihood & Derivative
Take the natural log to simplify differentiation (log-likelihood is easier to work with):
lnL(p) = sum from k=1 to m of f_k [lnp + (k-1)ln(1-p)] + f_+ * m * ln(1-p) = (sum f_k) * lnp + ln(1-p) * [sum f_k(k-1) + m*f_+]
Take the derivative with respect to ( p ), set it to zero (to find the maximum):
d(lnL)/dp = (sum f_k)/p - [sum f_k(k-1) + m*f_+]/(1-p) = 0
Step 3: Solve for (\hat{p})
Rearrange the equation to isolate ( p ):
(sum f_k)(1-p) = p * [sum f_k(k-1) + m*f_+]
After expanding and rearranging terms, you'll get:
\hat{p} = (sum_{k=1}^m f_k) / [ sum_{k=1}^m f_k*k + m*f_+ ]
If you substitute ( f_+ = n - sum f_k ), you can also write this as:
\hat{p} = (sum f_k) / [ m*n + sum_{k=1}^m f_k*(k - m) ]
Let's say your data looks like this:
- X=1: 20 observations
- X=2: 15 observations
- X=3: 10 observations
- Total sample size ( n = 50 )
First, calculate ( f_+ = 50 - (20+15+10) = 5 ), and ( m=3 ).
Compute the numerator: ( sum f_k = 20+15+10 = 45 )
Compute the denominator: ( sum f_kk + mf_+ = (120)+(215)+(310) + 35 = 20+30+30+15 = 95 )
Then the MLE is:\hat{p} = 45/95 ≈ 0.474
Perfect—no need to know exactly how many observations are in X=4, X=5, etc., just the total count for that tail group!
内容的提问来源于stack exchange,提问作者Kev

