Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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

Thimblee
November 09, 2022

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

Thimblee

November 09, 2022
Tweet

More Decks by Thimblee

Other Decks in Technology

Transcript

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

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  5. ࣄޙ෼෍ QPTUFSJPS

    ͸ύϥϝʔλɺ ͸σʔλ


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

    View full-size slide

  6. ࣄલ෼෍ QSJPS


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

    View full-size slide

  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

    View full-size slide

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

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

    View full-size slide

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

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

    View full-size slide

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

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

    View full-size slide

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

    ࣄલ෼෍ QSJPS

    11

    View full-size slide

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

    View full-size slide

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

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  16. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠
    16

    View full-size slide