close
Warning:
Can't synchronize with repository "(default)" (/var/svn/mms does not appear to be a Subversion repository.). Look in the Trac log for more information.
- Timestamp:
-
Aug 7, 2014, 10:40:11 AM (10 years ago)
- Author:
-
Pedro Gea
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v1
|
v2
|
|
20 | 20 | y su inversa: |
21 | 21 | {{{ |
22 | | InvLogit(z) = 1/(1+Exp(-z)) |
| 22 | InvLogit(z) = 1/(1+Exp(-z)) = Exp(z)/(Exp(z)+1) |
23 | 23 | }}} |
24 | 24 | |
25 | 25 | === Verosimilitud y derivadas === |
| 26 | |
| 27 | ==== Log-Likelihood ==== |
| 28 | |
| 29 | El logaritmo de la verosimilitud (''log-likelihood'') es: |
| 30 | {{{ |
| 31 | LogL = Sum_i( Y_i*Log(P_i) + (1-Y_i)*Log(1-P_i) ) |
| 32 | }}} |
| 33 | donde el subíndice {{{i}}} hace referencia a la {{{i}}}-ésima observación. |
| 34 | |
| 35 | Teniendo en cuenta que la probabilidad de la {{{i}}}-ésima observación viene dada por: |
| 36 | {{{ |
| 37 | P_i = InvLogit(B'X_i) = 1/(1+Exp(-B'X_i)) |
| 38 | }}} |
| 39 | podemos escribir: |
| 40 | {{{ |
| 41 | LogL = Sum_i( Y_i*Log(1/(1+Exp(-B'X_i))) + (1-Y_i)*Log(1-1/(1+Exp(-B'X_i))) ) = |
| 42 | |
| 43 | = - Sum_i( Y_i*Log(1+Exp(-B'X_i)) + (1-Y_i)*Log(1+Exp(B'X_i)) ) |
| 44 | }}} |
| 45 | |
| 46 | ==== Gradient ==== |
| 47 | |
| 48 | La primera derivada respecto a la matriz de parámetros ({{{B}}}) es el gradiente del logaritmo de la verosimilitud: |
| 49 | |
| 50 | {{{ |
| 51 | Grad = d(LogL(B))/dB = - Sum_i( Y_i*Exp(-B'X)*(-X_i)/(1+Exp(-B'X)) + (1-Y_i)*Exp(B'X)*X_i/(1+Exp(B'X)) ) |
| 52 | |
| 53 | }}} |