变量替换推导Beta分布密度函数的技术求助
Hey James, let's break this down step by step to fix the gaps in your derivation—you're already so close to getting it right!
First, let's clear up your confusion about the Jacobian: since we're working with a conditional density $f(y|\bar{x}, S)$, $\bar{x}$ and $S$ are treated as fixed constants here. That means we're only doing a univariate transformation from $y$ to $z$, not a 3-to-1 dimensional change. The Jacobian is just the absolute value of the derivative of $y$ with respect to $z$, which simplifies things a lot.
Step 1: Calculate the Jacobian of the transformation
Start by rearranging the $z$ definition to solve for $y$:
$$
z = \frac{1}{2} + \frac{1}{2} \cdot \frac{\bar{x} - y}{S} \sqrt{\frac{n}{n-1}}
$$
Multiply both sides by 2, rearrange terms, and solve for $y$:
$$
2(z - \frac{1}{2}) = \frac{\bar{x} - y}{S} \sqrt{\frac{n}{n-1}} \
y = \bar{x} - 2S \sqrt{\frac{n-1}{n}} \left(z - \frac{1}{2}\right)
$$
Now take the absolute value of the derivative $\frac{dy}{dz}$:
$$
\left|\frac{dy}{dz}\right| = 2S \sqrt{\frac{n-1}{n}}
$$
This is the Jacobian we need for the density transformation rule: $g(z) = f(y|\bar{x}, S) \cdot \left|\frac{dy}{dz}\right|$ (with $y$ substituted using the $z$ expression).
Step 2: Combine your existing result with the Jacobian
You already derived this simplified form of $f(y|\bar{x}, S)$:
$$
\sqrt{\frac{n}{n-1}} \cdot \frac{\Gamma\left(\frac{n-1}{2}\right)}{\sqrt{\pi}\Gamma\left(\frac{n-2}{2}\right)} \cdot 2^{n-4} \cdot \frac{1}{S} \cdot z^{(n-2)/2 -1} (1-z)^{(n-2)/2 -1}
$$
Multiply this by the Jacobian we found:
$$
\sqrt{\frac{n}{n-1}} \cdot \frac{\Gamma\left(\frac{n-1}{2}\right)}{\sqrt{\pi}\Gamma\left(\frac{n-2}{2}\right)} \cdot 2^{n-4} \cdot \frac{1}{S} \cdot 2S \sqrt{\frac{n-1}{n}} \cdot z^{(n-2)/2 -1} (1-z)^{(n-2)/2 -1}
$$
Let's cancel out the terms first:
- $\sqrt{\frac{n}{n-1}}$ and $\sqrt{\frac{n-1}{n}}$ cancel each other
- $\frac{1}{S}$ and $S$ cancel each other
- $2^{n-4} \times 2 = 2^{n-3}$
This leaves us with:
$$
\frac{\Gamma\left(\frac{n-1}{2}\right)}{\sqrt{\pi}\Gamma\left(\frac{n-2}{2}\right)} \cdot 2^{n-3} \cdot z^{(n-2)/2 -1} (1-z)^{(n-2)/2 -1}
$$
Step 3: Simplify the constant using Gamma function properties
We need to match this constant to the Beta distribution's normalization term $\frac{\Gamma(n-2)}{\left[\Gamma\left(\frac{n-2}{2}\right)\right]^2}$. Use the Legendre doubling formula for Gamma functions:
$$
\Gamma(2a) = \frac{2^{2a-1}}{\sqrt{\pi}} \Gamma(a) \Gamma(a + \frac{1}{2})
$$
Let $a = \frac{n-2}{2}$, so $2a = n-2$, and $a + \frac{1}{2} = \frac{n-1}{2}$. Substitute into the formula:
$$
\Gamma(n-2) = \frac{2^{n-3}}{\sqrt{\pi}} \Gamma\left(\frac{n-2}{2}\right) \Gamma\left(\frac{n-1}{2}\right)
$$
Rearrange this to solve for our constant term:
$$
\frac{\Gamma\left(\frac{n-1}{2}\right)}{\sqrt{\pi}\Gamma\left(\frac{n-2}{2}\right)} \cdot 2^{n-3} = \frac{\Gamma(n-2)}{\left[\Gamma\left(\frac{n-2}{2}\right)\right]^2}
$$
Step 4: Final result
Substitute this back into our expression, and we get exactly the Beta density the authors presented:
$$
g(z) = \frac{\Gamma(n-2)}{\Gamma\left(\frac{n-2}{2}\right)\Gamma\left(\frac{n-2}{2}\right)} z{(n/2-1)-1}(1-z){(n/2-1)-1}
$$
Which is a $Beta\left(\frac{n-2}{2}, \frac{n-2}{2}\right)$ distribution, as expected.
The key mistake you made earlier was overcomplicating the Jacobian by treating $\bar{x}$ and $S$ as variables to transform—since we're working with a conditional density, those values are fixed, so it's just a simple univariate change of variables.
备注:内容来源于stack exchange,提问作者James

