You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

θ的极大似然估计:对θ求偏导时负号的处理方法

Let's break this down step by step to see how to handle that tricky negative sign when computing the maximum likelihood estimator (MLE) of θ.

Step 1: Start by Clarifying the Probability Density Function (PDF)

First, notice that for (x \in (-1, 0)), (x) is negative. So we can rewrite the PDF to explicitly show all positive terms (since PDFs must be non-negative):

f(x|θ) = (θ + θ²)(1+x)^{θ-1}(-x)

This makes it clear: (\theta > 0) so (\theta + \theta² > 0), (1+x > 0) (because (x > -1)), and (-x > 0) (because (x < 0)). All terms are positive, so the PDF is valid.

Step 2: Construct the Likelihood Function

For a random sample (X_1, X_2, ..., X_n), the likelihood function is the product of individual PDFs:

L(θ) = \prod_{i=1}^n \left[ (θ + θ²)(1+x_i)^{θ-1}(-x_i) \right]

We can split this into terms involving θ and constant terms (with respect to θ):

L(θ) = (θ + θ²)^n \cdot \left( \prod_{i=1}^n (-x_i) \right) \cdot \prod_{i=1}^n (1+x_i)^{θ-1}

Step 3: Compute the Log-Likelihood

Taking the natural log simplifies differentiation (products become sums). The constant term (\ln\left(\prod_{i=1}^n (-x_i)\right)) will vanish when we take the derivative, so we can focus on the θ-dependent terms:

ℓ(θ) = n \ln(θ + θ²) + (θ-1)\sum_{i=1}^n \ln(1+x_i) + \text{constant}

What if we didn't rewrite the PDF first?

If we used the original PDF with the negative sign directly, we still know the likelihood is positive (since it's a product of valid PDFs). So taking the log of the absolute value gives the same result:

ℓ(θ) = n \ln\left( |-(θ + θ²)(1+x_i)^{θ-1}x_i| \right) + ... = n \ln(θ + θ²) + ...

The negative sign disappears in the absolute value, so we end up with the same log-likelihood.

Step 4: Take the Partial Derivative with Respect to θ

Now differentiate the log-likelihood. The constant term drops out, and we use the chain rule for (\ln(θ + θ²)):

\frac{\partial ℓ}{\partial θ} = n \cdot \frac{1 + 2θ}{θ + θ²} + \sum_{i=1}^n \ln(1+x_i)

What if we mistakenly kept the negative sign in the log?

Suppose we wrote (\ℓ(θ) = n \ln(-(θ + θ²)) + ...) (even though this is technically the log of a negative number, but since we know the likelihood is positive, we're implicitly taking the log of the absolute value). Differentiating this gives:

\frac{\partial}{\partial θ} \ln(-(θ + θ²)) = \frac{-(1 + 2θ)}{-(θ + θ²)} = \frac{1 + 2θ}{θ + θ²}

The negative signs cancel out, so we get the exact same derivative as before! That's the key: the negative sign either gets eliminated upfront (via rewriting the PDF or absolute value) or cancels out during differentiation.

Step 5: Solve for θ by Setting the Derivative to Zero

Set (\frac{\partial ℓ}{\partial θ} = 0):

n \cdot \frac{1 + 2θ}{θ(1 + θ)} = -\sum_{i=1}^n \ln(1+x_i)

Let (S = \sum_{i=1}^n \ln(1+x_i)) (note (S < 0) because (1+x_i \in (0,1)) for (x_i \in (-1,0))). Rearranging gives a quadratic equation in θ:

Sθ² + (2n + S)θ + n = 0

Using the quadratic formula, we only keep the positive root (since (\theta > 0)):

θ = \frac{-(2n + S) - \sqrt{(2n + S)^2 - 4Sn}}{2S}

(The other root is negative, so we discard it.)

Key Takeaway

The negative sign in the original PDF is just there to make the overall density positive (since (x) is negative). When building the likelihood and taking derivatives, it either:

  • Gets combined with (x) to form a positive term upfront, or
  • Cancels out automatically when differentiating the log-likelihood.

You don't need to overcomplicate it—just ensure you're always working with positive terms when taking logs, and the negative sign will resolve itself without affecting the final derivative or MLE solution.

内容的提问来源于stack exchange,提问作者sopcharts

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 08:45:38