Especificación del modelo: \[ y=g\left(x_1, \ldots, x_p ; \beta_1, \ldots, \beta_p\right)+\epsilon, \quad \epsilon \sim f \]
Estimación de los parámetros: Maxima Verosimilitud, Minimos cuadrados… \[\widehat{\beta}_1, \ldots, \widehat{\beta}_p\].
Evaluación del modelo estimado: \[\widehat{y}=g\left(x_1, \ldots, x_p ; \widehat{\beta}_1, \ldots, \widehat{\beta}_p\right), \quad \widehat{\epsilon} \sim f \] Supuestos, Observaciones influenciales, Bondad de ajuste.
Inferencia: Eliminar/agregar una variable, Intervalos de confianza, Interpretación.
\[ \begin{array}{lll} \hline \text { V Respuesta } & \text { V Independiente } & \text { Método } \\ \hline \text { Continua } & \text { Binaria } & \text { Prueba t } \\ & \text { Nominal + } \text { categorias } & \text { Análisis de varianza } \\ & \text { Ordinal }+2 \text { categorias } & \text { Análisis de varianza } \\ & \text { Nominal y/o continuas } & \text { Análisis de covarianza } \\ & \text { Categóricas y/o continuas } & \text { Regresión multiple } \\ \hline \text { Binaria } & \text { Categóricas } & \text { Tablas de contingencia } \\ & \text { Categóricas y/o continuas } & \text { Regresión logística, probit } \\ & & \text { Regresión log-log-complementaria } \\ \hline \text { Nominal con } & \text { Nominal } & \text { Tablas de contingencia } \\ +2 \text { categorías } & \text { Categóricas y/o continuas } & \text { Regresión logística nominal } \\ \hline \text { Ordinal } & \text { Categóricas y/o continuas } & \text { Regresión logística ordinal } \\ \hline \text { Frecuencias } & \text { Categóricas } & \text { Modelos log-lineales } \\ & \text { Categóricas y/o continuas } & \text { Regresión Poisson } \\ \hline \text { Tiempo de falla } & \text { Categóricas y/o continuas } & \text { Análisis de supervivencia (parám.) } \\ \hline \text { Correlaciondas } & \text { Categóricas y continuas } & \text { Ec. de estimación generalizadas } \\ & & \text { Modelos multinivel } \\ \hline \end{array} \]
Asuma que la variable aleatoria \(Y\) tiene una distribución con un sólo parámetro \(\theta\). La densidad de \(Y\), \(f(y ; \theta)\) se dice que pertenece a la familia exponencial si \[ f(y ; \theta)=e^{a(y) b(\theta)+c(\theta)+d(y)} \] donde \(a(\cdot), b(\cdot), c(\cdot)\) y \(d(\cdot)\) son funciones conocidas y \(b(\theta)\) se conoce como el parámetro natural.
Si \(a(y)=y\) se dice que la distribución es canónica \[ f(y ; \theta)=e^{y b(\theta)+c(\theta)+d(y)} \] Ejemplos - Distribución Poisson, distribución Normal, distribución Binomial, distribución Gamma, distribución Pareto, distribución exponencial, distribución binomial negativa, distribución de valor extremo (Gumbel),…
La variable aleatoria \(Y\) tiene una distribución con parámetros \(\theta\) y \(\phi\). la densidad de \(Y\), \(f(y ; \theta, \phi)\) se dice que pertenece a la familia exponencial de dispersión si \[ f(y ; \theta, \phi)=e^{[y \theta-b(\theta)] / s(\phi)+c(y, \phi)} \] donde \(\phi\) es llamado el parámetro de dispersión mientras que \(\theta\) es llamado el parámetro canónico de localización. Si \(\phi\) es conocido entonces tenemos la definición de la familia exponencial.
Para cualquier fdp \[ \int f(y ; \theta) d y=1 \] Si \(Y\) es discreta entonces la integral se sustituye por la sumatoria. Derivando ambos lados de (1) respecto a \(\theta\) \[ \frac{d}{d \theta} \int f(y ; \theta) d y=\frac{d}{d \theta}(1)=0 \] Si el orden de integración y diferenciación en el primer término se invierte, entonces 2 \[ \int \frac{d f(y ; \theta)}{d \theta} d y=0 \] Similarmente si (1) se deriva dos veces respecto a \(\theta\) y el orden de integración se invierte \[ \int \frac{d^2 f(y ; \theta)}{d \theta^2} d y=0 \] Para la familia exponencial:
\[ \begin{aligned} f(y ; \theta) & = \exp \{a(y) b(\theta)+c(\theta)+d(y)\} \\ \frac{d f(y ; \theta)}{d \theta} & = \left[a(y) b^{\prime}(\theta)+c^{\prime}(\theta)\right] f(y ; \theta) \\ \frac{d^2 f(y ; \theta)}{d \theta^2} & = \left[a(y) b^{\prime \prime}(\theta)+c^{\prime \prime}(\theta)\right] f(y ; \theta)+\left[a(y) b^{\prime}(\theta)+c^{\prime}(\theta)\right]^2 f(y ; \theta) \end{aligned} \]
\[ \begin{aligned} \int \frac{d f(y ; \theta)}{d \theta} d y & =0 \\ \int \left[a(y) b^{\prime}(\theta)+c^{\prime}(\theta)\right] f(y ; \theta) d y & =0 \\ \int \left[a(y) b^{\prime}(\theta)f(y ; \theta)+c^{\prime}(\theta)f(y ; \theta)\right] d y & =0 \\ \int a(y) b^{\prime}(\theta)f(y ; \theta)d y+ \int c^{\prime}(\theta)f(y ; \theta)d y & =0 \\ b^{\prime}(\theta) \int a(y) f(y ; \theta)d y+c^{\prime}(\theta) \int f(y ; \theta)d y & =0 \\ b^{\prime}(\theta) E[a(y)]+c^{\prime}(\theta)[1] & =0 \\ b^{\prime}(\theta) E[a(y)] & = -c^{\prime}(\theta) \\ E[a(y)] & = - \frac{c^{\prime}(\theta)}{b^{\prime}(\theta) } \end{aligned} \] \[ \boxed{ E[a(y)] = - \frac{c^{\prime}(\theta)}{b^{\prime}(\theta)} } \]
\[ \begin{aligned} \int \frac{d^2 f(y ; \theta)}{d \theta^2} d y &=0 \\ \int \left[a(y) b^{\prime \prime}(\theta)+c^{\prime \prime}(\theta)\right] f(y ; \theta)+\left[a(y) b^{\prime}(\theta)+c^{\prime}(\theta)\right]^2 f(y ; \theta) d y &=0 \\ \int \left[a(y) b^{\prime \prime}(\theta)+c^{\prime \prime}(\theta)\right] f(y ; \theta)d y + \int \left[a(y) b^{\prime}(\theta)-b^{\prime}(\theta)(- \frac{c^{\prime}(\theta)}{b^{\prime}(\theta) })\right]^2 f(y ; \theta) d y &=0 \\ \int a(y) b^{\prime \prime}(\theta)f(y ; \theta)d y +\int c^{\prime \prime}(\theta) f(y ; \theta)d y + \int \left[a(y) b^{\prime}(\theta)-b^{\prime}(\theta)E[a(y)]\right]^2 f(y ; \theta) d y &=0 \\ b^{\prime \prime}(\theta) \int a(y) f(y ; \theta)d y +c^{\prime \prime}(\theta) \int f(y ; \theta)d y +(b^{\prime}(\theta))^2 \int \left[a(y)-E[a(y)]\right]^2 f(y ; \theta) d y &=0 \\ b^{\prime \prime}(\theta) E[a(y)] +c^{\prime \prime}(\theta) [1] +(b^{\prime}(\theta))^2V[a(y)] &=0 \\ \end{aligned} \] \[ \begin{aligned} +(b^{\prime}(\theta))^2V[a(y)] &=-b^{\prime \prime}(\theta) E[a(y)]-c^{\prime \prime}(\theta) \\ V[a(y)] &=\frac{-b^{\prime \prime}(\theta) E[a(y)]-c^{\prime \prime}(\theta)}{(b^{\prime}(\theta))^2} \\ V[a(y)] &=\frac{-b^{\prime \prime}(\theta)[-\frac{c^{\prime}(\theta)}{b^{\prime}(\theta)}]-c^{\prime \prime}(\theta)}{(b^{\prime}(\theta))^2} \\ V[a(y)] &=\frac{\frac{b^{\prime \prime}(\theta) c^{\prime}(\theta)}{b^{\prime}(\theta)}-c^{\prime \prime}(\theta)}{(b^{\prime}(\theta))^2} \\ V[a(y)] &=\frac{b^{\prime \prime}(\theta) c^{\prime}(\theta)-c^{\prime \prime}(\theta)b^{\prime}(\theta)}{(b^{\prime}(\theta))^3} \end{aligned} \]
\[ \boxed{ V[a(y)] =\frac{b^{\prime \prime}(\theta) c^{\prime}(\theta)-c^{\prime \prime}(\theta)b^{\prime}(\theta)}{(b^{\prime}(\theta))^3} } \]
Función de log-verosimilitud: \[ l(\theta ; y)=a(y) b(\theta)+c(\theta)+d(y) \]
Estadístico de puntuación o score \[ U(\theta ; y)=\frac{d l(\theta ; y)}{d \theta}=a(y) b^{\prime}(\theta)+c^{\prime}(\theta) \]
\(U\) depende de \(Y\), por tanto \(U\) también es una VA \[ \begin{aligned} U = & a(Y) b^{\prime}(\theta)+c^{\prime}(\theta) \\ E(U) = & b^{\prime}(\theta) E[a(Y)]+c^{\prime}(\theta) \\ E(U) = & b^{\prime}(\theta) (- \frac{c^{\prime}(\theta)}{b^{\prime}(\theta)})+c^{\prime}(\theta) \\ E(U) = & - c^{\prime}(\theta)+c^{\prime}(\theta)=0 \\ E(U) = & 0 \end{aligned} \] \[ \boxed{ E(U) = 0 } \]
La varianza de \(U\) es la información. \[ \begin{aligned} U = & a(Y) b^{\prime}(\theta)+c^{\prime}(\theta) \\ \mathfrak{I}=V(U) = & V[a(Y) b^{\prime}(\theta)+c^{\prime}(\theta)] \\ V(U) = & V[a(Y) b^{\prime}(\theta)] \\ V(U) = & (b^{\prime}(\theta))^2 V[a(Y)] \\ V(U) = & (b^{\prime}(\theta))^2 [\frac{b^{\prime \prime}(\theta) c^{\prime}(\theta)-c^{\prime \prime}(\theta)b^{\prime}(\theta)}{(b^{\prime}(\theta))^3})] \\ V(U) = & \frac{b^{\prime \prime}(\theta) c^{\prime}(\theta)-c^{\prime \prime}(\theta)b^{\prime}(\theta)}{b^{\prime}(\theta)})] \\ V(U) = & \frac{b^{\prime \prime}(\theta) c^{\prime}(\theta)}{b^{\prime}(\theta)}-c^{\prime \prime}(\theta) \\ \end{aligned} \] \[ \boxed{ \mathfrak{I}=V(U) = \frac{b^{\prime \prime}(\theta) c^{\prime}(\theta)}{b^{\prime}(\theta)}-c^{\prime \prime}(\theta) } \]
Otra propiedad de \(U\) \[ V(U)=E\left(U^2\right)=-E\left(U^{\prime}\right) . \]
Un MLG tiene tres componentes:
La distribución de \(Y_i\) pertenece a la \(\mathrm{FE}\) con \(\mu_i=E\left(Y_i\right)\).
Un predictor lineal \(\eta_i=\mathbf{x}_i^T \boldsymbol{\beta}=\beta_1 x_{i 1}+\beta_2 x_{i 2}+\ldots+\beta_p x_{i p}\).
Una función de liga \(g\) monótona y diferenciable \[ g\left(\mu_i\right)=\mathbf{x}_i^T \boldsymbol{\beta} \quad \Leftrightarrow \quad \mu_i=g^{-1}\left(\eta_i\right) \] Ejemplos
Regresión lineal \[ E[Y]=\mu_i=\beta_0+\beta_1 X_1+\beta_2 X_2+\cdots+\beta_p X_p, \quad Y \sim N\left(\mu_i, \sigma^2\right) \]
Regresión logística \(\left(P(Y=1)=\mu_i=\pi_i\right)\) \[ \log \left(\frac{\pi_i}{1-\pi_i}\right)=\beta_0+\beta_1 X_1+\beta_2 X_2+\cdots+\beta_p X_p, \quad Y \sim B\left(\pi_i\right) \]
Regresión nominal \((j=1\) categoria de referencia y \(j=2, \ldots, J\). \[ \log \left(\frac{\pi_j}{\pi_1}\right)=\beta_0+\beta_{1 j} X_1+\beta_{2 j} X_2+\cdots+\beta_p X_{p j} \quad Y \sim M\left(n, \pi_1, \cdots \pi_J\right) . \]
Regresión Poisson \[ E\left(Y_i\right)=\mu_i=n_i e^{\mathbf{x}_i^T \beta} ; \quad Y_i \sim \operatorname{Poisson}\left(\mu_i\right) . \]