Regression Analysis Hand Write 2008/09/26
在迴歸分析中必備之工具:
1. Probability distribution Z :Standard normal
A group of r.v’s X 1, X 2, …, X n or Z 1, Z 2 ,…, Z n (iid ) iid : Independent Identically Distribution Set W 1=Z 12
W 2=Z 22 ⋮ ⋮
W K =Z K 2 ⇒ W i K i =1=Z K 2
:具有卡方自由度為K 之r.v p.d.f of Z K 2
∶ g X K 2 y =
1
Γ K
2
212y
K 2
−1e
−
y 2
,y >0
引申:If Z~N (0, 1) and chi-square of X K 2 are independent Set t =
K
2
K
then p.d.f t student – t with degree of freedom K
If W 1.W 2 are independent each other, and where W i is chi-square distribution with X i Let F =
W 1
K 1 W 2K 2
and F is chi-square distribution with (K 1. K 2)
(1) I f Z~N (0, 1) i.e. p.d.f of Z f z =
2π
−z 22
(2) I f Z 1, Z 2 , …, Z n are independent each other ~N (0, 1)
Then Z 12,Z 22,…,Z n 2,…~ χ(1)2
Why? Find p.d.f of Z i 2
P r Z 2
<t =P r − t <Z 0< t
()
= 2π
−z 2
2 t − t dz =2 2π
−z 2
2
t 0dz
∴p .d .f of Z 12 g Z i 2 t
isbn号=d
dt P r Z i 2
<t =2d dt 2π−z 22 t 0dz
= 2π∙
12
t 12−1∙e −
t 2
=
1Γ 12
21
2
y
12
−1e −
t 2
(3) If W 1, W2, …, W n are not only independent but also in chi-square distribution. Let U =W 1+W 2+⋯+W n then p.d.f of U is chi-square distribution with (K ) Sol: Find moment-generating function M(t) M x t =E e tU = e tU ∙g U U du
=M w 1+M w 2+⋯+M w K
= M w i K
i =1 ⇒
1
(1+2t )K
2
米酒的制作And
M w i t =E e tw i =
e
tw i
∙
1
Γ 1
2
21
2w
12
−1e
−
w 2
dw ∞0
⇒
1
(1+2t )12
(4) If Z~N (0, 1) r.v
U ~χ(K )2 r.v and Z, U are independent Set T =
U K
find p.d.f of T
= (Z ,U ) Set S=Z
Then the J p.d.f relationship between S ,T ∙g S ,T s ,t and U ,Z ∙f Z ,U z ,u
g S ,T s ,t =f Z ,U (z d ,t ,u s ,t ) J where J = ðz
ðs
ðz ðt ðu
ðs
ðu ðt
∵T =
U K
S =Z
∴Z =S ,T = U K
汤饭的家常做法∴T 2
=
S 2
U K
∴U K =S 2
T 2 U =K ∙S 2
T 2
J =
ðz
ðs
ðz ðt ðu ðs
ðu ðt = 1
2ks
t 2
−2ks t 3
=−
2ks t 3
⇒J p.d.f of S,T g S ,T s ,t =
2π
−z 22
∙
1
Γ K
2
212u
K 2
手动曝光
−1e
−
u 2
∙ J
=
1
2π∙Γ K
2 212
∙e −S 22
∙
KS 2t 2
K 2
−1∙e
KS 2− t 22野子歌词
g S ,T s ,t =C ∙ S 2
K
2
−1∙e开讲啦周杰伦
−id名字大全
(1+K
t 2)∙S 2
2
∙
1
t 2 K 2 −1
∙
S 2t 2
Where C =
2K K K
2
−1
2π∙Γ K
2 212
Marginal p.d.f of T g S ,T s ,t ds ∞
−∞=?
估計:如何求估計式M.L.E
Confidence level (coefficient) 信賴(心)水準 Confidence interval 信賴區間 檢定:虛無假設:H o 對立假設:A
如何判定:accept H o or reject H o Power of a test 檢定力 d : significance level p -value β: 2nd error 1-β: power
以回歸模型為例 經過觀察 data
y =β0+β1x +ε x 1 y 1 , x 2 y 2 ,…, x n y n y 1=β0+β1x 1+ε1
y 2=β0+β1x 2+ε2 ⋮ ⋮
y n =β0+β1x n +εn ⇓
y 1y 2⋮y n = 1x 11⋮1x 2⋮x n β0β1 + ε1ε2⋮εn ⇓ ⇓ ⇓ ⇓ y = X β + ε
Estimate β0 β1 By least square
y i −β0−β1x i 2
Min n i =0 , ask β0 β1=?
Set f β0,β1 = y i −β0−β1x i 2
n i =0 Find the minimum
ðf
ðβ0
=−2 y i −β0−β1x i
ðf
ðβ1
煎锅=−2 y i −β0−β1x i x i
β0n i =0+β1 x i n i =0= y i β0x i +β1 x i 2= x i y i
⇒
nβ0+β1 x i = y i β0 x i +β1 x i 2= x i y i
⇒nβ0 +β1 x i = y i ⇒ β0 = y i n
−β1 x
n =y −β1 x β0 =
n
y i x i x i y i
n
x i x i x i 2
=
n x i y i − x i ∙ y i
n x i 2− x i 2
Let L, S works on y i −β0−β1x i 2n i =1
y −xβ 2= y −xβ T
y −xβ = y T −βT x T y −xβ =y T y −y T xβ−βT x T y +βT x T xβ =y T y −2y T xβ+βT x T xβ
Set L β = y −xβ 2
=y T y −2y T xβ+βT x T xβ ∂L
∂β=−2y T x +2βT x T x =0
∴ βT x T x =y T x ⇒ (βT x T x )T = y T x T ⇒ x T x β=x T y
β
=(x T x )−1x T y ↑解釋變項每日攝取營養
量
↑反
應變項
↑成長(身高、體
重
)
↑誤差項
∴y=xβ
=x x T x−1x T y
=p y
Where p=x x T x−1x T
p∙p=x x T x−1x T∙x x T x−1x T
=x x T x−1x T
=p
∴ p is an idempotent
Geometric: p is a project mapping
Homework 2
Given t(K)and F(K1,K2) to figure p.d.f of t and F(at least 6th K or 6th t of (K1,K2))
This figure is made by the computer software MA TLAB.
We given x range 0~10 per 0.1 once again and y range 0~1 per 0.01 once again, Finally, plot in K=1~8 while obtain this graphics