Esquema del mètode
modifica
En els models de regressió lineal estàndard s'observen dades
{
y
i
,
x
i
j
}
i
=
1
,
…
,
n
,
j
=
2
,
…
,
k
{\displaystyle \{y_{i},x_{ij}\}_{i=1,\dots ,n,j=2,\dots ,k}}
sobre n unitats estadístiques .[3]
Els valors de resposta es col·loquen en un vector,
y
≡
(
y
1
⋮
y
n
)
,
{\displaystyle \mathbf {y} \equiv {\begin{pmatrix}y_{1}\\\vdots \\y_{n}\end{pmatrix}},}
i els valors del predictor es col·loquen a la matriu de disseny ,
X
≡
(
1
x
12
x
13
⋯
x
1
k
1
x
22
x
23
⋯
x
2
k
⋮
⋮
⋮
⋱
⋮
1
x
n
2
x
n
3
⋯
x
n
k
)
,
{\displaystyle \mathbf {X} \equiv {\begin{pmatrix}1&x_{12}&x_{13}&\cdots &x_{1k}\\1&x_{22}&x_{23}&\cdots &x_{2k}\\\vdots &\vdots &\vdots &\ddots &\vdots \\1&x_{n2}&x_{n3}&\cdots &x_{nk}\end{pmatrix}},}
on cada fila és un vector de la
k
{\displaystyle k}
variables predictores (inclosa una constant) per al
i
{\displaystyle i}
punt de dades. El model assumeix que la mitjana condicional de
y
{\displaystyle \mathbf {y} }
donat
X
{\displaystyle \mathbf {X} }
ser una funció lineal de
X
{\displaystyle \mathbf {X} }
i que la variància condicional del terme d'error donat
X
{\displaystyle \mathbf {X} }
és una matriu de covariància no singular coneguda,
Ω
{\displaystyle \mathbf {\Omega } }
. Això és,[4]
y
=
X
β
+
ε
,
E
[
ε
∣
X
]
=
0
,
Cov
[
ε
∣
X
]
=
Ω
,
{\displaystyle \mathbf {y} =\mathbf {X} {\boldsymbol {\beta }}+{\boldsymbol {\varepsilon }},\quad \operatorname {E} [{\boldsymbol {\varepsilon }}\mid \mathbf {X} ]=0,\quad \operatorname {Cov} [{\boldsymbol {\varepsilon }}\mid \mathbf {X} ]={\boldsymbol {\Omega }},}
on
β
∈
R
k
{\displaystyle {\boldsymbol {\beta }}\in \mathbb {R} ^{k}}
és un vector de constants desconegudes, anomenats "coeficients de regressió", que s'estimen a partir de les dades. Si
b
{\displaystyle \mathbf {b} }
és una estimació del candidat per
β
{\displaystyle {\boldsymbol {\beta }}}
, aleshores el vector residual per
b
{\displaystyle \mathbf {b} }
és
y
−
X
b
{\displaystyle \mathbf {y} -\mathbf {X} \mathbf {b} }
. Estimacions del mètode dels mínims quadrats generalitzats
β
{\displaystyle {\boldsymbol {\beta }}}
minimitzant la longitud al quadrat de Mahalanobis d'aquest vector residual:
β
^
=
argmin
b
(
y
−
X
b
)
T
Ω
−
1
(
y
−
X
b
)
=
argmin
b
y
T
Ω
−
1
y
+
(
X
b
)
T
Ω
−
1
X
b
−
y
T
Ω
−
1
X
b
−
(
X
b
)
T
Ω
−
1
y
,
{\displaystyle {\begin{aligned}{\hat {\boldsymbol {\beta }}}&={\underset {\mathbf {b} }{\operatorname {argmin} }}\,(\mathbf {y} -\mathbf {X} \mathbf {b} )^{\mathrm {T} }\mathbf {\Omega } ^{-1}(\mathbf {y} -\mathbf {X} \mathbf {b} )\\&={\underset {\mathbf {b} }{\operatorname {argmin} }}\,\mathbf {y} ^{\mathrm {T} }\,\mathbf {\Omega } ^{-1}\mathbf {y} +(\mathbf {X} \mathbf {b} )^{\mathrm {T} }\mathbf {\Omega } ^{-1}\mathbf {X} \mathbf {b} -\mathbf {y} ^{\mathrm {T} }\mathbf {\Omega } ^{-1}\mathbf {X} \mathbf {b} -(\mathbf {X} \mathbf {b} )^{\mathrm {T} }\mathbf {\Omega } ^{-1}\mathbf {y} \,,\end{aligned}}}
que equival a,
β
^
=
argmin
b
y
T
Ω
−
1
y
+
b
T
X
T
Ω
−
1
X
b
−
2
b
T
X
T
Ω
−
1
y
,
{\displaystyle {\hat {\boldsymbol {\beta }}}={\underset {\mathbf {b} }{\operatorname {argmin} }}\,\mathbf {y} ^{\mathrm {T} }\,\mathbf {\Omega } ^{-1}\mathbf {y} +\mathbf {b} ^{\mathrm {T} }\mathbf {X} ^{\mathrm {T} }\mathbf {\Omega } ^{-1}\mathbf {X} \mathbf {b} -2\mathbf {b} ^{\mathrm {T} }\mathbf {X} ^{\mathrm {T} }\mathbf {\Omega } ^{-1}\mathbf {y} ,}