Thimblee
November 09, 2022
210

# ベイズで単回帰モデルを考える /bayes-simple-linear-regression

## Thimblee

November 09, 2022

## Transcript

1. ϕΠζͰ୯ճؼϞσϧΛߟ͑Δ
5IJNCMFF
1

2. ໰୊ઃఆ
܇࿅σʔλͷઆ໌ม਺ ͱ໨తม਺ ͔ΒҎԼͷ
༧ଌ෼෍ΛٻΊΔ

ҎԼͷ୯ճؼϞσϧΛ࢖༻͢Δ
x = (x1
, x2
, ⋯, xN
)T t = (t1
, t2
, ⋯, tN
)T
p(t*
|x*
, t, x)
p(t*
|x*
, w, β) =
𝒩
(t*
|w0
+ w1
x*
, β−1)
2

3. ۩ମతʹ͸
͜͏͍͏σʔλʹର͍͍ͯ͠ײ͡ʹύϥϝʔλ Λௐ੔ͯ͠ɺ௚ઢ
ΛҾ͖͍ͨɻ͜ͷσʔλ͸େମ ͱͳ͍ͬͯΔɻ
w = (w0
, w1
)T
y = w0
+ w1
x t = − 2 + 2x
3

4. ϕΠζͷఆཧ
p(A|B) =
p(A)p(B|A)
p(B)
4

5. ࣄޙ෼෍ QPTUFSJPS

͸ύϥϝʔλɺ ͸σʔλ

ࣄޙ෼෍Λ༻͍ͨύϥϝʔλͷਪఆ͕ϕΠζਪఆͰ͢ɻ
w t
p(w|t) =
p(w)p(t|w)
p(t)
∝ p(w)p(t|w)
(posterior) ∝ (prior)(likelihood)
5

6. ࣄલ෼෍ QSJPS

p(w) =
𝒩
(w|0, α−1I), α = 0.25
6

7. ໬౓ؔ਺ MJLFMJIPPE

L(w) = p(t|w)
=
𝒩
(t|m, β−1I)
where m = (w0
+ w1
x1
, w0
+ w1
x2
, ⋯, w0
+ w1
xN
)T, β = 2.0
7

8. ໬౓ؔ਺ͷྫ
͜ͷΑ͏ͳ͍͍ײ͡ͷ௚ઢͩͱͱ͍͏େ͖͍஋ΛͱΔ

L((−2.1,2.2)T) = 0.39
8

9. ໬౓ؔ਺ͷྫ
͜ͷΑ͏ͳ௚ઢͩͱͱ͍͏஋ΛͱΔ

L((−1.0,0.0)T) = 0.29
9

10. ໬౓ؔ਺ͷྫ
͜ͷΑ͏ͳѱ͍௚ઢͩͱͱ͍͏খ͍͞஋ΛͱΔ

L((1.0, − 3.0)T) = 0.18
10

11. ࣄલ෼෍ͱ໬౓ؔ਺ʢ࠶ܝʣ
໬౓ؔ਺ MJLFMJIPPE

ࣄલ෼෍ QSJPS

11

12. ࣄલ෼෍ͱ໬౓ؔ਺ͷੵ
12

13. ٻΊΒΕͨ௚ઢ
ࣄޙ෼෍͸ ͷ࣌ʹ࠷େʹͳΔ

w = (−1.08,0.38)
L((−1.08,0.38)T) = 0.31
13

14. ໬౓ؔ਺͚ͩʢ࠷໬ਪఆʣͰ͍͍ͷͰ͸
ϕΠζʢࣄޙ෼෍ʣͩͱσʔλΛ͏·͘දݱͰ͖͍ͯͳ͍
࣮ࡍɺ͜ͷσʔλΛ୯ճؼϞσϧͰֶश͢Δࡍʹ͸ϕΠζ͸ඞཁͳ͍
ʢ୯ճؼϞσϧ͕ཧղ͠΍͍͔͢Β༻͍ͨʣ
͔͠͠ɺҰൠʹ͸ϕΠζͰߟ͑ΔϝϦοτ͕ଟ͍
14

15. ϕΠζͷಛ௃
w ύϥϝʔλʢ୯ճؼϞσϧͳΒ ʣʹ͍ͭͯ΋֬཰෼෍Λߟ͑ΒΕΔ
w ࣄલ෼෍ʹʢσʔλҎ֎ͷʣط஌ͷ৘ใΛ൓өͤ͞ΒΕΔ
w ֬཰෼෍ͷஞ࣍ߋ৽͕Ͱ͖Δ
w աֶशΛ๷͛Δʢਖ਼ଇԽʣ
w ʢଞʹ΋৭ʑ͋Δͱࢥ͍·͢ʣ
w
15

16. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠
16