Modelo lineal

En el modelo nulo, la variable aleatoria \(Y\) tiene un valor entorno a \(\mu\); en este caso, la media es un buen modelo para estimar \(Y\) si se tiene en cuenta el error aleatorio:

\[ Y = \mu + \epsilon \]

Si Y varía en función de distintas situaciones experimentales, podemos representarlo con los parámetros \(\beta\):

\[ Y = f(X_{1} + X_{2} + X_{3}) + \epsilon \]

o

\[ Y = \beta_{0} + \beta_{1}X_{1} + \beta_{2}X_{2} + \epsilon \]

donde \(\beta_{i}\) es un parámetro y \(\epsilon\) es el error.

De forma general, hablamos de

\[ y = X\beta +\epsilon \]

Representación matricial

Cada valor de \(Y\) puede obtenerse en relación con los parámetros que estudiamos, y representarlo en forma de tabla.

\[\begin{matrix} Y & X_{1} & X_{2} & X_{3} \\ y_{1} & x_{11} & x_{12} & x_{13} \\ y_{2} & x_{21} & x_{22} & x_{23} \\ y_{n} & x_{n1} & x_{n2} & x_{n3} \\ \end{matrix} \]

\[ y_{i} = \beta_{0} + \beta_{1x_{i1}} + \beta_{2x_{i2}} + \beta_{3x_{i3}} + \epsilon_{i} // i = 1, ..., n \]

\(\beta_{0}\) es el Intercept, todos los demás valores son los parámetros.

Para estimar los parámetros de un modelo utilizamos el álgebra matricial (ver el capítulo 2 de los libros de Faraway [1], Irizarry [irizarry_data_2017?] y Carmona [2]).

\[ Y = X\beta + \epsilon \]

$$ \[\begin{pmatrix} y_{1} \\ y_{2} \\ y_{n} \end{pmatrix}\]

=

\[\begin{pmatrix} x_{11} & x_{12} & x_{1m} \\ x_{21} & x_{22} & x_{2m} \\ x_{n1} & x_{n2} & x_{nm} \end{pmatrix}\] \[\begin{pmatrix} \beta_{1} \\ \beta_{2} \\ \beta_{n} \end{pmatrix}\]
\[\begin{pmatrix} \epsilon_{1} \\ \epsilon_{2} \\ \epsilon_{n} \end{pmatrix}\]

$$

Condiciones de Gauss-Markov

El modelo lineal solamente es válido cuando pera dentro de los siguientes supuestos

  1. Los errores suman cero
  2. No están correlacionados
  3. Tienen la misma varianza

Descomposición QR

Mirar en el libro de Faraway [1].

1.
Faraway JJ. Linear models with R. Second edition. Boca Raton London: CRC Press, Taylor & Francis; 2014. (Texts in statistical science).
2.
Carmona Pontaque F. Modelos lineales. Ediciones de la Universidad de Barcelona; 2004.
3.
Chollet F. Deep learning with R. Second edition. Shelter Island: Manning; 2022.
4.
Gatto L. An Introduction to Machine Learning with R. 2020.
5.
Song Y, Millidge B, Salvatori T, Lukasiewicz T, Xu Z, Bogacz R. Inferring neural activity before plasticity as a foundation for learning beyond backpropagation. Nat Neurosci. 2024 Feb;27(2):348–58.
6.
Jones E, Harden S, Crawley MJ. The R book. Third edition. Hoboken, NJ: Wiley; 2022.
7.
Field A, Miles J, Field Z. Discovering statistics using R. Repr. Los Angeles, CA, USA: Sage; 2014.
8.
Yap BW, Sim CH. Comparisons of various types of normality tests. Journal of Statistical Computation and Simulation. 2011 Dec;81(12):2141–55.
9.
Perezgonzalez JD. Fisher, Neyman-Pearson or NHST? A tutorial for teaching data testing. Front Psychol. 2015 Mar;6:223.
10.
Lantz B. Machine learning with R: Learn techniques for building and improving machine learning models, from data preparation to model tuning, evaluation, and working with big data, fourth edition. 4th ed. Place of publication not identified: Packt Publishing; 2023.
11.
Carmona Pontaque F. Álgebra Matricial en Estadística. Análisis Multivariante. Fundació Universitat Oberta de Catalunya; 2024.