Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Modelos de regressão.
Uma variável aleatória pode ser explicada quer por factores determinís-
ticos quer por factores aleatórios. Este capítulo distingue-se dos capítu-
los anteriores, uma vez que o estudo de variáveis aleatórias não é feito
somente com base em componentes não determinísticas.
Y = g(x) + ǫ,
Yi = β0 + β1 xi + ǫi ,
E(Y |x) = β0 + β1 x,
Parâmetros de regressão:
• β0 = E(Y |x = 0).
• β1 = E(Y |x0 +1) − E(Y |x0 ), ∀ x0 .
P
∂
∂β0
SQ(β0 , β1 ) = 2 ni=1 (Yi − β0 − β1 xi )(−1)
P
∂
∂β1
SQ(β0 , β1 ) = 2 ni=1 (Yi − β0 − β1 xi )(−xi )
Logo,
∂
Pn Pn
SQ(β0 , β1 ) =0 ⇒ Yi = n β0 + β 1 i=1 xi
∂β0
∂
Pi=1
n P n Pn 2
∂β1
SQ(β0 , β1 ) =0 ⇒ i=1 xi Yi = β0 i=1 xi + β1 i=1 xi
• Estimador β̂1 :
Pn Pn n
i=1 x i Yi − n x̄ Ȳ i=1 (xi − x̄)Yi X
β̂1 = Pn 2 2
= Pn 2
= ki Yi ,
x
i=1 i − n x̄ i=1 (x i − x̄) i=1
Pn Pn
onde ki = P n xi(x−x̄ 2 , com i=1 ki = 0, i=1 ki xi = 1 e
i=1 i −x̄)
Pn 2
2.
Pn 1 1
i=1 ki = (xi −x̄)2
i=1
= Pn 2
i=1 i −n x̄
x
Logo,
Pn Pn Pn
i=1 ki xi = β1 .
• E(β̂1 ) = k E(Y ) = β0 k + β1
i=1 i i i=1 i
Pn 2 P n
i=1 xi − n x̄ ) .
• V ar(β̂1 ) = 2 2 2 −1
i=1 ki V ar(Yi ) = σ (
• Estimador β̂0 :
n n n
1X X X
β̂0 = Ȳ − β̂1 x̄ = Yi − ki Yi x̄ = wi Yi ,
n i=1 i=1 i=1
Pn Pn
onde wi = (1/n − ki x̄), com i=1 wi = 1, i=1 w i xi = 0 e
Pn 1 2
w 2
= ( + P n x̄ 2 ).
i=1 i n x −n x̄2
i=1 i
Logo,
Pn Pn Pn
i=1 wi xi = β0 .
• E(β̂0 ) = w E(Y ) = β0 w + β1
i=1 i i i=1 i
Pn 2 1 2
• V ar(β̂0 ) = 2 P n x̄ 2
i=1 wi V ar(Yi ) = σ ( n + x −n x̄2
).
i=1 i
Note-se que β̂0 e β̂1 são combinações lineares dos Yi e estimadores cen-
trados de β0 e β1 , respectivamente.
Pn Pn
onde SST = i=1 (Yi − Ȳ ) e SSR = β̂1
2 2 2
i=1 (xi − x̄) =
Pn
i=1 (Ŷi − Ȳ ) são conhecidas por somas de quadrados total e da
2
y 213 220 216 225 235 218 239 243 233 240
x 13 15 14 18 19 17 22 21 16 18
P10
i=1 xi = 173
P10
i=1 yi = 2288
235
P10 2
i=1 xi = 3069
y
P10 2
225
i=1 yi = 524510
P10
i=1 xi yi = 39825
215
14 16 18 20 22
β̂1 = 39825−10×17.3×228.8
3069−10×17.32
= 3.188
β̂0 = 228.8 − 3.188 × 17.3 = 173.65
Yb ≡ E(Y
b |x) = 173.65 + 3.188 x,
e, por conseguinte,
β̂1 − β1
T =q ∼ t(n−2) .
Pn σ̂ 2
2 2
i=1 xi −n x̄
onde b = −a = Ft−1
(n−2)
(1− α2 ), e −b 0 b T
s s
σ̂ 2 σ̂ 2
P β̂1 −b Pn 2 2
< β1 < β̂1 +b Pn 2 2
= 1−α
i=1 xi − n x̄ i=1 xi − n x̄
Teste de hipóteses:
−b 0 b T
• V ar(β̂0 ) = σ 2 ( 1 + x̄2
2 ).
Pn 2
n i=1 xi −n x̄
Logo,
2
1 x̄
β̂0 ∼ N β0 , σ 2 + Pn 2 2
,
n x
i=1 i − n x̄
e, por conseguinte,
β̂0 − β0
T =q ∼ t(n−2) .
x̄2
σ̂ 2 ( n1 + Pn 2 2)
i=1 xi −n x̄
onde b = −a = Ft−1
(n−2)
(1− α2 ), e −b 0 b T
s s
1 x̄2 1 x̄2
P β̂0 − b σ̂ 2 + Pn 2 2
< β0 < β̂0 + b σ̂ 2 + Pn 2 2
= 1−α
n i=1 xi − n x̄ n i=1 xi − n x̄
−b 0 b T
b0 ) = · · · = σ 2 ( 1 +
• V ar(Y (x̄−x0 )2
2 ),
Pn 2
n i=1 xi −n x̄
β̂0 + β̂1 x0 − β0 + β1 x0
T = q ∼ t(n−2) .
2 1 (x̄−x0 )2
σ̂ ( n + P n x2 −n x̄2 )
i=1 i
onde b = −a = Ft−1
(n−2)
(1− α2 ), e
q 2
P β̂0 + β̂1 x0 − b σ̂ 2 ( n1 + P n x̄x2 −n x̄2 ) < E(Y |x0 ) <
i=1 i
q
1 x̄2
β̂0 + β̂1 x0 + b σ̂ 2 ( n + P n x2 −n x̄2 ) = 1−α
i=1 i
Teste de hipóteses:
−b 0 b T
Coeficiente de determinação.
Definição 9.1: O coeficiente de determinação é uma medida relativa de
ajustamento do modelo de regressão linear, dada por
SSR SSE
R2 = =1− ,
SST SST
P P
onde SST = ni=1 (Yi − Ȳ )2 e SSR = β̂12 ni=1 (xi − x̄)2 e portanto
Pn 2
2 ( i=1 xi Yi − n x̄ Ȳ )
R = Pn 2 P .
( i=1 xi − n x̄2 )( ni=1 Yi2 − n Ȳ 2 )
- -
x x
ri ri
6 6
* *
* * * *
*
0 - - - - - - - -*- - - - - - - - - - ------------------
* * * * * *
* *
- -
xi xi
2.0
standardized.residuals
Gráficos de resíduos:
1.0
y√
• ris = i −ŷi
, i = 1, . . . , 10.
0.0
σ̂ 2
• inexistência de problemas.
−1.0
14 16 18 20 22
FIM!
NOTAS DE PROBABILIDADES E ESTATÍSTICA - GS – 207/207