Este artículo proviene del artículo anterior de Zhihu sobre la derivación de la distribución normal . Estaba iluminado, así que tomé notas.
Supongamos que existe una función de densidad de probabilidad de error f (t) f(t)f ( t ) , ahora tenemosnnValores de n observaciones independientesx 1 x_1X1, x 2 x_2X2,⋯ \cdots⋯,xn x_nXnorte, asumiendo que el valor verdadero es μ \muμ , entonces el error es:
ε 1 = x 1 − μ ε 2 = x 2 − μ ⋮ ε n = xn − μ \begin{aligned} \varepsilon_{1} & =x_{1}-\mu \\ \varepsilon_{2} & =x_ {2}-\mu \\ & \vdots \\ \varepsilon_{n} & =x_{n}-\mu \end{aligned}mi1mi2minorte=X1−metro=X2−metro⋮=Xnorte−metro
Según la experiencia de vida, este error ε \varepsilonε , con una gran cantidad de observaciones, la mayoría de sus valores deberían ser0 0El rango fluctúa alrededor de 0 y aparece con más frecuencia. Para observaciones con grandes errores, el correspondiente∣ ε ∣ |\varepsilon|∣ ε ∣ también debe ser grande y la frecuencia de aparición también debe ser pequeña. Haga la función de máxima verosimilitud:
L ( μ ) = ∏ i = 1 nf ( ε i ) = f ( x 1 − μ ) f ( x 2 − μ ) ⋯ f ( xn − μ ) \begin{aligned} L(\mu) & =\prod_ {i=1}^{n} f\left(\varepsilon_{i}\right) \\ & =f\left(x_{1}-\mu\right) f\left(x_{2}-\mu \right) \cdots f\left(x_{n}-\mu\right) \end{alineado}L ( μ )=yo = 1∏norteF( miyo)=F( x1−metro )F( x2−metro )⋯F( xnorte−m ).
对L ( μ ) L(\mu)L ( μ ) toma el logaritmo natural:
ln [ L ( μ ) ] = ln [ ∏ i = 1 nf ( ε i ) ] = ln [ f ( x 1 − μ ) f ( x 2 − μ ) ⋯ f ( xn − μ ) ] = ln [ f ( x 1 − μ ) ] + ln [ f ( x 2 − μ ) ] + ⋯ + ln [ f ( xn − μ ) ] = ∑ i = 1 n ln [ f ( xi − μ ) ] \begin{alineado} \ln [L(\mu)] & =\ln \left[\prod_{i=1}^{n} f\left(\varepsilon_{i}\right)\right] \\ & =\ln \left[f\left(x_{1}-\mu\right) f\left(x_{2}-\mu\right) \cdots f\left(x_{n}-\mu\right) )\right] \\ & =\ln \left[f\left(x_{1}-\mu\right)\right]+\ln \left[f\left(x_{2}-\mu\right) \right]+\cdots+\ln \left[f\left(x_{n}-\mu\right)\right] \\ & =\sum_{i=1}^{n} \ln \left[f\ izquierda(x_{i}-\mu\right)\right] \end{alineado}en [ L ( μ )]=en[yo = 1∏norteF( miyo) ]=en[ f( x1−metro )F( x2−metro )⋯F( xnorte−m ) ]=en[ f( x1−m ) ]+en[ f( x2−m ) ]+⋯+en[ f( xnorte−m ) ]=yo = 1∑norteen[ f( xyo−m ) ]
Para obtener ln [ L ( μ ) ] \ln [L(\mu)]El valor máximo de ln [ L ( μ )] , para el cualln [ L ( μ ) ] \ln [L(\mu)]Encuentre la derivada parcial de ln [ L ( μ )] e iguale a 0 00
∂ ln [ L ( μ ) ] ∂ μ = ∂ ∑ i = 1 n ln [ f ( xi − μ ) ] ∂ μ = − ∑ i = 1 nf ′ ( xi − μ ) f ( xi − μ ) = 0 \begin{aligned} \frac{\partial \ln [L(\mu)]}{\partial \mu} & =\frac{\partial \sum_{i=1}^{n} \ln \left[ f\left(x_{i}-\mu\right)\right]}{\partial \mu} \\ & =-\sum_{i=1}^{n} \frac{f^{\prime}\ left(x_{i}-\mu\right)}{f\left(x_{i}-\mu\right)} \\ & =0 \end{aligned}∂ µ∂en [ L ( μ ) ]=∂ µ∂∑yo = 1norteen[ f( xyo−m ) ]=−yo = 1∑norteF( xyo−metro )F′( xyo−m ).=0
令g ( t ) = f ′ ( t ) f ( t ) g(t)=\frac{f^{\prime}(t)}{f(t)}g ( t )=f ( t )F′ (t), entonces la fórmula anterior se convierte en:
∑ i = 1 ng ( xi − μ ) = 0 \sum_{i=1}^{n} g\left(x_{i}-\mu\right)=0yo = 1∑nortegramo( xyo−metro )=0
Después de llegar a este paso, comienza la parte emocionante. Esta es también la brillantez de Gauss. Él cree que μ \muLa estimación insesgada de μ debería ser x ˉ \bar{x}Xˉ , entonces la fórmula original se convierte en
∑ i = 1 ng ( xi − x ˉ ) = 0 \sum_{i=1}^{n} g\left(x_{i}-\bar{x}\right)=0yo = 1∑nortegramo( xyo−Xˉ )=0
en,
x ˉ = 1 n ∑ i = 1 nxi \bar{x}=\frac{1}{n} \sum_{i=1}^{n} x_{i}Xˉ=norte1yo = 1∑norteXyo
Resuelve la ecuación anterior para cada xi x_iXyoEncuentre la derivada parcial, por ejemplo, x 1 x_1X1Hallando la derivada parcial, podemos obtener la siguiente ecuación:
∂ ∑ i = 1 ng ( xi − x ˉ ) ∂ x 1 = ∂ ∑ i = 1 ng ( xi − 1 n ∑ i = 1 nxi ) ∂ x 1 = g ′ ( x 1 − x ˉ ) ( 1 − 1 n ) + g ′ ( x 2 − x ˉ ) ( − 1 n ) + ⋯ + g ′ ( xn − x ˉ ) ( − 1 n ) = 0 \begin{aligned} \frac{\partial \sum_{i= 1}^{n} g\left(x_{i}-\bar{x}\right)}{\partial x_{1}} & =\frac{\partial \sum_{i=1}^{n} g\left(x_{i}-\frac{1}{n} \sum_{i=1}^{n} x_{i}\right)}{\partial x_{1}} \\ & =g^ {\prime}\left(x_{1}-\bar{x}\right)\left(1-\frac{1}{n}\right)+g^{\prime}\left(x_{2} -\bar{x}\right)\left(-\frac{1}{n}\right)+\cdots+g^{\prime}\left(x_{n}-\bar{x}\right) \left(-\frac{1}{n}\right) \\ & =0 \end{aligned}∂ x1∂∑yo = 1nortegramo( xyo−Xˉ )=∂ x1∂∑yo = 1nortegramo( xyo−norte1∑yo = 1norteXyo)=gramo′( x1−Xˉ )( 1−norte1)+gramo′( x2−Xˉ )( -norte1)+⋯+gramo′( xnorte−Xˉ )( -norte1)=0
将g ′ ( xi − x ˉ ) g^{\prime}\left(x_{i}-\bar{x}\right)gramo′( xyo−Xˉ )se considera un número desconocido, y las ecuaciones lineales homogéneas anteriores se escriben como una ecuación matricialA x = 0 \boldsymbol{A x}=\mathbf{0}Hacha=0 forma:
( 1 − 1 n − 1 n ⋯ − 1 n − 1 n 1 − 1 n ⋯ − 1 n ⋮ ⋮ ⋮ ⋮ − 1 n − 1 n − 1 n 1 − 1 n ) ( g ′ ( x 1 − x ˉ ) g ′ ( x 2 − x ˉ ) ⋮ g ′ ( xn − x ˉ ) ) = ( 0 0 ⋮ 0 ) \left(\begin{array}{cccc} 1-\frac{1}{n} & - \frac{1}{n} & \cdots & -\frac{1}{n} \\ -\frac{1}{n} & 1-\frac{1}{n} & \cdots & -\frac {1}{n} \\ \vdots & \vdots & \vdots & \vdots \\ -\frac{1}{n} & -\frac{1}{n} & -\frac{1}{n} & 1-\frac{1}{n} \end{array}\right)\left(\begin{array}{c} g^{\prime}\left(x_{1}-\bar{x}\ derecha) \\ g^{\prime}\left(x_{2}-\bar{x}\right) \\ \vdots \\ g^{\prime}\left(x_{n}-\bar{x }\right) \end{array}\right)=\left(\begin{array}{c} 0 \\ 0 \\ \vdots \\ 0 \end{array}\right) 1−norte1−norte1⋮−norte1−norte11−norte1⋮−norte1⋯⋯⋮−norte1−norte1−norte1⋮1−norte1 gramo′( x1−Xˉ )gramo′( x2−Xˉ )⋮gramo′( xnorte−Xˉ ) = 00⋮0
Para la matriz de coeficientes M \mathbf{M} del sistema de ecuaciones anteriorM , pon el 1º, 2º, 3º ⋯, n 1,2,3 \cdots,n1 ,2 ,3⋯,Se agregan n líneas secuencialmente al No. 1 11 fila, se puede obtener la siguiente matriz:
METRO = ( 1 − 1 norte − 1 norte ⋯ − 1 norte − 1 norte 1 − 1 norte ⋯ − 1 norte ⋮ ⋮ ⋮ ⋮ − 1 norte − 1 norte − 1 norte 1 − 1 norte ) → ( 0 0 ⋯ 0 − 1 norte 1 − 1 norte ⋯ − 1 norte ⋮ ⋮ ⋮ ⋮ − 1 norte − 1 norte − 1 norte 1 − 1 n ) \boldsymbol{M}=\left(\begin{array}{cccc} 1-\frac{ 1}{n} & -\frac{1}{n} & \cdots & -\frac{1}{n} \\ -\frac{1}{n} & 1-\frac{1}{n} & \cdots & -\frac{1}{n} \\ \vdots & \vdots & \vdots & \vdots \\ -\frac{1}{n} & -\frac{1}{n} & -\ frac{1}{n} & 1-\frac{1}{n} \end{array}\right) \rightarrow\left(\begin{array}{cccc} 0 & 0 & \cdots & 0 \\ - \frac{1}{n} & 1-\frac{1}{n} & \cdots & -\frac{1}{n} \\ \vdots & \vdots & \vdots & \vdots \\ -\frac {1}{n} & -\frac{1}{n} & -\frac{1}{n} & 1-\frac{1}{n} \end{array}\right)METRO= 1−norte1−norte1⋮−norte1−norte11−norte1⋮−norte1⋯⋯⋮−norte1−norte1−norte1⋮1−norte1 → 0−norte1⋮−norte101−norte1⋮−norte1⋯⋯⋮−norte10−norte1⋮1−norte1
La primera línea es toda 0, entonces det M = 0 \det{M}=0elMETRO=0 , esto solo muestra que el sistema de ecuaciones tiene infinitas soluciones, y específicamente necesitamos calcularel rango ( M ) \operatorname{rank}(\boldsymbol{M})rango ( M ) . En última instancia, la solución al sistema de ecuaciones anterior se puede escribir como
X = k ( g ′ ( x 1 − x ˉ ) g ′ ( x 2 − x ˉ ) ⋮ g ′ ( xn − x ˉ ) ) = k ( 1 1 ⋮ 1 ) \boldsymbol{X}=k\left( \begin{array}{c} g^{\prime}\left(x_{1}-\bar{x}\right) \\ g^{\prime}\left(x_{2}-\bar{x }\right) \\ \vdots \\ g^{\prime}\left(x_{n}-\bar{x}\right) \end{array}\right)=k\left(\begin{array} {c} 1 \\ 1 \\ \vdots \\ 1 \end{array}\right)X=k gramo′( x1−Xˉ )gramo′( x2−Xˉ )⋮gramo′( xnorte−Xˉ ) =k 11⋮1
即g ′ ( x 1 − x ˉ ) = g ′ ( x 2 − x ˉ ) = ⋯ = g ′ ( xn − x ˉ ) = kg^{\prime}\left(x_{1}-\bar{x }\right)=g^{\prime}\left(x_{2}-\bar{x}\right)=\cdots=g^{\prime}\left(x_{n}-\bar{x} \derecha)=kgramo′( x1−Xˉ )=gramo′( x2−Xˉ )=⋯=gramo′( xnorte−Xˉ )=k , resolviendo la ecuación diferencial, podemos obtener:
gramo ( t ) = kt + bg(t)=k t+bg ( t )=kt _+b
Resuelve esta ecuación diferencial:
∫ f ′ ( t ) f ( t ) dt = ∫ kt dt ⇔ ∫ d [ f ( t ) ] f ( t ) = 1 2 kt 2 + c ⇔ ln [ f ( t ) ] = 1 2 kt 2 + c ⇔ f ( t ) = K e 1 2 kt 2 \begin{aligned} \int \frac{f^{\prime}(t)}{f(t)} \mathrm{d} t=\int kt \ mathrm{~d} t & \Leftrightarrow \int \frac{\mathrm{d}[f(t)]}{f(t)}=\frac{1}{2} kt^{2}+c \\ & \Leftrightarrow \ln [f(t)]=\frac{1}{2} kt^{2}+c \\ & \Leftrightarrow f(t)=K \mathrm{e}^{\frac{1} {2}kt^{2}} \end{alineado}∫f ( t )F′ (t)d t=∫k t d t ⇔∫f ( t )d [ f ( t ) ]=21kt _2+C⇔en [ f ( t )]=21kt _2+C⇔f ( t )=k e21kt _2
Al mismo tiempo, f (t) f(t)f ( t ) es la función de densidad de probabilidad, entonces comienza desde− ∞ -\infty− ∞ a∞ \inftyLa integral de ∞ es1 11 (regularidad de la densidad de probabilidad)
∫ − ∞ + ∞ f ( t ) dt = ∫ − ∞ + ∞ K y 1 2 kt 2 dt = K ∫ − ∞ + ∞ e − t 2 2 σ 2 dt = K 2 σ [ ∫ − ∞ + ∞ e − ( t 2 σ ) 2 re ( 1 2 σ t ) ] [ 2 σ ∫ − ∞ + ∞ e − ( s 2 σ ) 2 re ( 1 2 σ s ) ] = K 2 σ ∫ − ∞ + ∞ ∫ − ∞ + ∞ e − ( u 2 + v 2 ) du dv = K 2 σ ∫ 0 2 π d θ ∫ 0 + ∞ e − r 2 r dr = K 2 σ π = 1 \begin{aligned} \int_{-\ infty}^{+\infty} f(t) \mathrm{d}t & =\int_{-\infty}^{+\infty} K \mathrm{e}^{\frac{1}{2} kt ^{2}} \mathrm{~d}t \\ & =K \int_{-\infty}^{+\infty} \mathrm{e}^{-\frac{t^{2}}{2\ sigma^{2}}}\mathrm{~d}t \\ & =K \sqrt{\sqrt{2} \sigma\left[\int_{-\infty}^{+\infty}\mathrm{e} ^{-\left(\frac{t}{\sqrt{2}\sigma}\right)^{2}}\mathrm{~d}\left(\frac{1}{\sqrt{2}\sigma } t\right)\right]\left[\sqrt{2}\sigma \int_{-\infty}^{+\infty} \mathrm{e}^{-\left(\frac{s}{\sqrt {2}\sigma}\right)^{2}}\mathrm{~d}\left(\frac{1}{\sqrt{2}\sigma}s\right)\right]}\\& =K\sqrt{2}\sigma\sqrt{\int_{-\infty}^{+\infty}\int_{-\infty}^{+\ infty} \mathrm{e}^{-\left(u^{2}+v^{2}\right)} \mathrm{d}u \mathrm{~d}v} \\ & =K \sqrt{ 2} \sigma \sqrt{\int_{0}^{2\pi}\mathrm{d}\theta\int_{0}^{+\infty}\mathrm{e}^{-r^{2}} r \mathrm{~d} r} \\ & =K \sqrt{2} \sigma \sqrt{\pi} \\ & =1 \end{aligned}∫− ∞+ ∞f ( t ) dt _=∫− ∞+ ∞k e21kt _2dt __ =k∫− ∞+ ∞mi−2p _2t2 d t=k2pag[ ∫− ∞+ ∞mi− (2pagt)2 días (2pag1t ) ][2pag∫− ∞+ ∞mi− (2pags)2 días (2pag1s ) ]=k2pag∫− ∞+ ∞∫− ∞+ ∞mi− ( tú2 +v2 )dudv =k2pag∫02 p.m.yo _∫0+ ∞mi−r _2 rdr =k2pagPi=1
Finalmente se obtiene la función de densidad de probabilidad:
f ( t ) = 1 2 π σ e − 1 2 ( t σ ) 2 f(t)=\frac{1}{\sqrt{2 \pi} \sigma} \mathrm{e}^{-\frac{ 1}{2}\left(\frac{t}{\sigma}\right)^{2}}f ( t )=2 p.m.pag1mi−21(pagt)2