PRML第11章

370e1dde1ef2391bdebe02e4a777890e?s=47 gucchi
March 30, 2019

 PRML第11章

370e1dde1ef2391bdebe02e4a777890e?s=128

gucchi

March 30, 2019
Tweet

Transcript

  1. PRML ୈ 11 ষ αϯϓϦϯά๏ 2019/04/01 ࡔޱ ྒี 1 /

    56
  2. Ұൠతͳ֬཰Ϟσϧʹ͓͍ͯɺ࿈ଓతͳ֬཰ม਺Λ z ͱͨ͠ͱ͖ͷ͋Δ ؔ਺ f(z) ͷ֬཰෼෍ p(z) ͷԼͰͷظ଴஋ E[f] =

    ∫ f(z)p(z) dz (11.1) Λܭࢉ͍ͨ͠γνϡΤʔγϣϯ͕ଟ͘ൃੜ͢Δɻ(ྫ͑͹ɺPRML ͷ 4 ষͷࣜ (4.145) ͳͲ) ଟ͘ͷ৔߹ɺ͜ͷੵ෼ (11.1) ͸ղੳతʹܭࢉͰ͖ͳ͍ɻ αϯϓϦϯά๏ͷҰൠతͳΞΠσΞ͸ɺ෼෍ p(z) ͔Βಠཱʹநग़͞Ε ͨαϯϓϧ z(l) (l = 1, · · · , L) Λಘͯɺ(11.1) ΛҎԼͷΑ͏ʹۙࣅ͢Δɻ f = 1 L L ∑ l=1 f(z(l)) (11.2) ͔͜͠͠ͷํ๏ͩͱɺ΋͠ p(z) ͕খ͍͞ྖҬͰ f(z) ͕େ͖͘ɺp(z) ͕ େ͖͍ྖҬͰ f(z) ͕খ͔ͬͨ͞Βɺαϯϓϧ਺͕গͳ͍࣌͸ͦͷαϯ ϓϧͷதʹ p(z) ͕খ͍͞ྖҬ͔Βαϯϓϧ͕͋ͬͨΒɺ(11.2) ͸ p(z) ͕খ͍͞ྖҬ͔ΒαϯϓϧʹӨڹΛड͚͗͢Δͱ͍͏໰୊͕͋Δɻ 2 / 56
  3. 11.1 جຊతͳαϯϓϦϯάΞϧΰϦζϜ ͜͜Ͱ͸ɺ༩͑ΒΕͨ෼෍͔ΒϥϯμϜʹαϯϓϦϯάΛߦ͏ํ๏Λઆ ໌͢Δɻ αϯϓϧࣗମ͸ܭࢉػʹΑΓੜ੒͞Ε͍ͯΔͨΊɺαϯϓϧ͸ٖࣅཚ ਺Ͱ͋Δɻ ͭ·Γɺܾఆ࿦తͳܭࢉͷ૊Έ߹ΘͤʹΑΓɺϥϯμϜͳαϯϓϧΛੜ ੒͢Δɻ ·ͨԾఆͱͯ͠ɺ۠ؒ (0,

    1) ͷҰ༷෼෍͔Βͷαϯϓϧੜ੒Λߦ͏Ξϧ ΰϦζϜ͸༩͑ΒΕ͍ͯΔͱ͢Δɻ ͜ͷҰ༷෼෍͔ΒͷαϯϓϦϯά͔ΒඇҰ༷෼෍ͷαϯϓϦϯάΛ ߦ͏ɻ 3 / 56
  4. 11.1.1 ඪ४తͳ෼෍ ·ͣɺz ͕۠ؒ (0, 1) ͰҰ༷ʹ෼෍͓ͯ͠Γɺͦͷม਺ z Λ y

    = f(z) Ͱ ඇҰ༷ͳ֬཰ม਺ y ʹม׵͢Δ͜ͱΛߟ͑Δɻ ͜ͷͱ͖ɺPRML ͷࣜ (1.27) ΑΓɺy ͷ֬཰෼෍͸ҎԼͷΑ͏ʹͳΔɻ p(y) = p(z) dz dy (11.5) ͜͜Ͱɺp(z) ͸۠ؒ (0, 1) ͷҰ༷෼෍ͳͷͰɺp(z) = 1 ͱͳΔɻ (p(z) = c = const. ͱͯ͠ɺن֨Խ৚݅Λ՝ͤ͹ɺc = 1 ͱͳΔɻ) ͜͜Ͱɺy Λ z ʹม׵͢ΔҎԼͷؔ਺ h(y) Λߟ͑Δɻ z = h(y) ≡ ∫ y −∞ p(ˆ y) dˆ y (11.6) ͜ͷΑ͏ͳؔ਺ h(y) Ͱ z ʹม׵͢Ε͹ɺp(z) = 1 ͱ h(y)′ = p(y) ≥ 0 Λ༻͍ͯ p(z) dz dy = |h(y)′| = p(y) ͱͳΓɺ֬཰ม਺ y ͸ p(y) ʹै͏͜ͱ͕Θ͔Δɻ 4 / 56
  5. 11.1.1 ඪ४తͳ෼෍ ͜ΕΑΓɺp(y) ʹै͏ y Λ z ͔ΒٻΊΔʹ͸ɺ(11.6) Ͱఆٛ͞Εͨؔ਺ h

    ͷٯؔ਺Λ༻͍ͯɺy = h−1(z) ͱͯ͠ม׵͢Ε͹ྑ͍ɻ ͳͷͰɺҰ༷෼෍͔ΒಘΒΕͨαϯϓϧ zi ͔Βɺ͋ΔඇҰ༷෼෍ p(y) ͔Β༩͑ΒΕΔαϯϓϧ yi ΛಘΔͨΊͷखॱ͸ҎԼͷΑ͏ʹͳΔɻ 1. (11.6) ΑΓɺp(y) Λੵ෼ͯ͠ h(y) ΛಘΔɻ 2. h(y) ͷٯؔ਺ h−1(z) ΛٻΊΔɻ 3. h−1 Λ༻͍ͯɺyi = h−1(zi ) Ͱαϯϓϧ yi ΛಘΔɻ ͜ͷखॱͰͷαϯϓϦϯά๏Λٯؔ਺๏ͱ͍͏ɻ 5 / 56
  6. 11.1.1 ඪ४తͳ෼෍ ྫͱͯ͠ɺαϯϓϧΛҎԼͷࢦ਺෼෍͔Βಘ͍ͨͱ͢Δɻ p(y) = λ exp (−λy) (11.7) ͜͜Ͱɺλ

    ͸ਖ਼ͷύϥϝʔλͰɺ0 ≤ y < ∞ Ͱ͋Δɻ ·ͣ (11.6) ΑΓɺ0 ≤ y < ∞ Ͱ͋Δ͜ͱʹ஫ҙͯ͠ɺ h(y) = ∫ y 0 λ exp (−λˆ y) dˆ y = − [ exp (−λˆ y) ]ˆ y=y ˆ y=0 = 1 − exp (−λy) ͱͳΓɺh(y) = z ͱ͢Δͱɺy ͸ (−λy ≤ 0 ΑΓɺ1 − exp (−λy) < 1 Ͱ ͋Δ͜ͱʹ஫ҙ͢Δͱ) z = 1 − exp (−λy) → − λy = ln (1 − z) →y = −λ−1 ln (1 − z) ͱͳΔɻ 6 / 56
  7. 11.1.1 ඪ४తͳ෼෍ ͜ΕΑΓɺҰ༷෼෍͔Β zi ΛಘΔͱɺyi = −λ−1 ln (1 −

    zi ) ͱͯ͠ಘͨ yi ͸ࢦ਺෼෍ (11.7) ͔Βͷαϯϓϧʹͳ͍ͬͯΔɻ ͜ͷํ๏͕͏·͍͘͘ʹ͸ɺੵ෼ (11.6) ͕࣮ߦͰ͖ɺٯؔ਺ h−1 ͕ٻ ·Δඞཁ͕͋Δɻ ্ͷྫͷࢦ਺෼෍ͷΑ͏ͳ୯७ͳ෼෍Ͱ͋Ε͹ՄೳͰ͋Δ͕ɺҰൠతʹ ͸ෆՄೳͰ͋Δɻ ͦͷΑ͏ͳෳࡶͳ෼෍ʹ͍ͭͯ͸ผͷΞϓϩʔν͕ඞཁͰɺ࣍ʹड़΂ Δغ٫αϯϓϦϯά΍ॏ఺αϯϓϦϯά͕༗ޮͰ͋Δɻ 7 / 56
  8. 11.1.2 غ٫αϯϓϦϯά ࣍ͷغ٫αϯϓϦϯάͷઆ໌Λߦ͏ɻ ͜͜Ͱ͸ɺલͱಉ͡Α͏ʹ෼෍ p(z) ͔ΒαϯϓϦϯάΛߦ͍͍ͨͱ ͢Δɻ ·ͨԾఆͱͯ͠ɺp(z) ͸ن֨Խఆ਺Λআ͍ͯΘ͔͍ͬͯΔͱ͢Δɻ ͭ·Γɺن֨Խఆ਺Λ

    Zp ͱͯ͠ɺp(z) Λ p(z) = 1 Zp p(z) (11.13) ͱ͢Δͱɺp(z) ͸Θ͔͍ͬͯΔ͕ɺZp ͷ஋͸Θ͔͍ͬͯͳ͍ͱ͢Δɻ غ٫αϯϓϦϯάΛߦ͏ʹ͋ͨͬͯɺΑΓαϯϓϦϯά͕؆୯ͳ (11.1.1 ͷٯؔ਺๏ͰαϯϓϦϯάͰ͖ΔΑ͏ͳ) ෼෍ q(z) Λ༻ҙ͢Δɻ (͜ͷΑ͏ͳ෼෍ΛఏҊ෼෍ͱ͍͏ɻ) 8 / 56
  9. 11.1.2 غ٫αϯϓϦϯά ࣍ʹɺਖ਼ͷఆ਺ k Λ༻ҙͯ͠ɺ͢΂ͯͷ z ʹରͯ͠ kq(z) ≥ p(z)

    ͱͳ ΔΑ͏ʹ k ͷ஋ΛܾΊΔɻ p(z) ͸Θ͔͍ͬͯΔ͔Βɺk ͷ஋͸ٻΊΒΕΔɻ ҎԼ͕ kq(z) ͱ p(z) ͷྫͰ͋Δɻ 9 / 56
  10. 11.1.2 غ٫αϯϓϦϯά ࣮ࡍͷαϯϓϦϯάͷํ๏͸ɺ·ͣఏҊ෼෍ q(z) ͔Βཚ਺ z0 Λੜ੒ ͢Δɻ ࣍ʹ۠ؒ [0,

    kq(z0 )] ͷҰ༷෼෍͔Βཚ਺ u0 Λੜ੒͢Δɻ ੜ੒ͨ͠ u0 ͕ɺu0 > p(z0 ) Ͱ͋Ε͹غ٫͞Ε (ࣺͯΒΕ)ɺͦΕҎ֎Ͱ ͋Ε͹ u0 ͸ p(z) ͔ΒͷαϯϓϦϯάͱͯ͠อ࣋͞ΕΔɻ 10 / 56
  11. 11.1.2 غ٫αϯϓϦϯά αϯϓϦϯά͸Ͱ͖Δ͚ͩޮ཰తʹߦ͍͍ͨͷͰɺغ٫͞ΕΔαϯϓϧ ͷ਺͸ݮΒ͍ͨ͠ɻ ͦ͜Ͱɺαϯϓϧ z ͕डཧ͞ΕΔ֬཰ p(accept) ΛٻΊͯΈΔɻ αϯϓϧ

    z ͸ q(z) ͔Βੜ੒͞Εɺ۠ؒ [0, kq(z)] ͷҰ༷෼෍͔Βੜ੒͞ ΕΔαϯϓϧ͸ p(z)/kq(z) ͷ֬཰Ͱडཧ͞ΕΔͷͰɺαϯϓϧ͕डཧ ͞ΕΔ֬཰ p(accept) ͸ p(accept) = ∫ {p(z)/kq(z)}q(z) dz = 1 k ∫ p(z) dz = ∫ p(z) dz ∫ kq(z) dz (11.14) ͱͳΔɻ 11 / 56
  12. 11.1.2 غ٫αϯϓϦϯά ͭ·Γɺ(11.14) ΑΓɺk ͸͢΂ͯͷ z ʹରͯ͠ kq(z) ≥ p(z)

    Λຬͨ͢ ݶΓɺͰ͖Δ͚ͩখ͘͢͞Δඞཁ͕͋Δɻ ·ͨɺԼͷਤͷփ৭ͷ෦෼ΛͰ͖Δ͚ͩখ͘͢͞ΔΑ͏ͳఏҊ෼෍Λબ ΂͹ɺडཧ཰্͕͕Δɻ 12 / 56
  13. 11.1.3 దԠతغ٫αϯϓϦϯά غ٫αϯϓϦϯάͰ͸ɺద੾ͳఏҊ෼෍Λ༻ҙ͢Δඞཁ͕͋Δ͕ɺద੾ ͳఏҊ෼෍͕Θ͔Βͳ͍৔߹ɺదԠతغ٫αϯϓϦϯά͕࢖͑Δɻ ͜ͷαϯϓϦϯάͰ͸ɺαϯϓϦϯάΛ͍ͨ͠෼෍ p(z) ͸Θ͔͍ͬͯ Δͱ͢Δɻ ͞ΒʹɺҎԼͷ੺͍ؔ਺Α͏ʹ p(z)

    ͸ର਺Ԝ (ର਺্͕ʹತͳؔ਺) Ͱ ͋Δͱ͢Δɻ 13 / 56
  14. 11.1.3 దԠతغ٫αϯϓϦϯά ·ͣ͸ॳظू߹ͱͯ͠ɺԿ఺͔αϯϓϧ {zi } ͕༩͑Δɻ ͦͯ͠ɺͦͷ఺Ͱͷ ln p(z) ͷඍ෼܎਺Λ

    −λi ͱ͢Δɻ d dz ln p(z) z=zi = −λi ͜ͷඍ෼܎਺ −λi Λ༻͍ͯɺఏҊ෼෍ͷର਺ ln q(z) ΛҎԼͷΑ͏ʹ ࡞Δɻ ln q(z) = −λi (z − zi ) + ln λi ki (ˆ zi−1,i < z ≤ ˆ zi,i+1 ) ͜͜Ͱɺˆ zi−1,i ͸ zi−1 Ͱͷ઀ઢͱ zi Ͱͷ઀ઢͱͷަ఺ͷ z ࠲ඪɻ 14 / 56
  15. 11.1.3 దԠతغ٫αϯϓϦϯά ͜ͷΑ͏ʹͯ͠࡞ΒΕͨఏҊ෼෍͸ p(z) ͕ର਺ԜͰ͋Ε͹ɺ p(z) ≤ q(z) ͱͳΓɺغ٫αϯϓϦϯά͕ద༻Ͱ͖Δɻ ͜ΕΑΓɺq(z)

    ͸ q(z) = λi ki exp {−λi (z − zi )} (ˆ zi−1,i < z ≤ ˆ zi,i+1 ) ͱͳΔɻ ͜ͷ q(z) ͔ΒͷαϯϓϦϯά͸؆୯Ͱɺ11.1.1 ͷٯؔ਺๏Λ༻͍ͯα ϯϓϦϯάͰ͖Δɻ(ԋश 11.9) ͦ͜Ͱɺq(z) ͔Βͷ৽ͨͳαϯϓϦϯά z ͕༩͑ΒΕͨΒɺغ٫αϯϓ Ϧϯάͷͱ͖ͱಉ༷ʹ [0, q(z)] ͷҰ༷෼෍͔Βαϯϓϧ u ΛಘΔɻ ͦͯ͠ɺu > p(u) ͳΒغ٫͠ɺͦΕҎ֎ͳΒडཧ͢Δɻ غ٫͞ΕͨΒɺq(z) Λ࡞੒͢ΔͨΊͷ৽͍͠఺ʹ͢Δɻ 15 / 56
  16. 11.1.3 దԠతغ٫αϯϓϦϯά ͜͜Ͱ͸ɺغ٫αϯϓϦϯά͕αϯϓϧม਺ z ͕ߴ࣍ݩϕΫτϧͷ࣌ʹ ͸޲͔ͳ͍͜ͱΛઆ໌͢Δɻ ྫͱͯ͠ɺฏۉ͕θϩͰڞ෼ࢄߦྻ͕ σ2 p I

    Ͱ͋ΔΨ΢ε෼෍͔Βαϯϓ Ϧϯά͍ͨ͠ͱ͢Δɻ p(z) = N(z|0, σ2 p I) ·ͨɺఏҊ෼෍ q(z) ͸ฏۉ͕θϩͰڞ෼ࢄߦྻ͕ σ2 q I Ͱ͋ΔΨ΢ε෼ ෍Ͱ͋Δͱ͢Δɻ q(z) = N(z|0, σ2 q I) غ٫αϯϓϦϯάͰ͸ɺ͢΂ͯͷ z Ͱ kq(z) ≥ p(z) Ͱ͋ΔΑ͏ͳ k ͕ ଘࡏ͠ͳͯ͘͸͍͚ͳ͍ɻ ͦͷΑ͏ͳ k ͕ଘࡏ͢Δʹ͸ɺq(z) ͕ p(z) ΑΓฏ͍ͨ෼෍Ͱͳ͍ͱ͍ ͚ͳ͍ɻ ͭ·Γɺσ2 q ≥ σ2 p Ͱ͋Δඞཁ͕͋Δɻ 16 / 56
  17. 11.1.3 దԠతغ٫αϯϓϦϯά σ2 q ≥ σ2 p ͷ৚݅Ͱɺ͢΂ͯͷ z Ͱ

    kq(z) ≥ p(z) ͱͳΔͨΊʹ͸ҎԼͷਤ ͷΑ͏ʹɺ࠷େ஋Λ༩͑Δ఺Ͱ z = 0 Ͱ kq(z = 0) = p(z = 0) ͱͳΕ ͹Α͘ɺ N(x|µ, Σ) = 1 (2π)D/2 1 |Σ|1/2 exp { − 1 2 (x − µ)TΣ−1(x − µ) } ΑΓɺ k = ( σq σp )D ͱऔΕ͹ྑ͍ɻ 17 / 56
  18. 11.1.3 దԠతغ٫αϯϓϦϯά ͜ΕΑΓɺαϯϓϦϯάͷडཧ཰ p(accept) ͸ (11.14) ΑΓ p(accept) = ∫

    p(z) dz ∫ kq(z) dz = 1 k = ( σp σq )D ͱͳΔɻ ͭ·ΓɺD = 1000 Ͱ͸ɺσq /σp = 1.01 ͷͱ͖ (σq ͕ͨͬͨ 1 ύʔηϯ τ͚ͩ σp ΑΓେ͖͍ͱ͖) p(accept) = ( 1 1.01 )1000 ∼ 1 20000 ͱͳΓɺ΄ͱΜͲडཧ͞Εͳ͍ɻ ͭ·Γɺغ٫αϯϓϦϯά͸ߴ࣍ݩʹ͸ద͓ͯ͠Βͣɺ1 ࣍ݩ·ͨ͸ 2 ࣍ݩ͘Β͍ͷͱ͖ʹదͨ͠αϯϓϦϯάͰ͋Δɻ 18 / 56
  19. 11.1.4 ॏ఺αϯϓϦϯά ॏ఺αϯϓϦϯάͰ͸ɺ෼෍ p(z) ͔ΒαϯϓϦϯάΛಘΔͷͰ͸ͳ͘ɺ (11.1) ͷΑ͏ͳظ଴஋ͷۙࣅ஋Λ௚઀ٻΊΔɻ (11.2) ͷΑ͏ʹۙࣅ͢Δͱɺ{z(l)} ͸ෳࡶͳ෼෍

    p(z) ͔Βͷαϯϓϧͳ ͷͰɺαϯϓϦϯά͕೉͍͠ɻ ͦ͜Ͱɺ͜͜Ͱ΋αϯϓϦϯά͕ൺֱత؆୯ͳఏҊ෼෍ q(z) Λར༻ ͢Δɻ ఏҊ෼෍Λར༻ͯ͠ɺ(11.1) ΛҎԼͷΑ͏ʹۙࣅ͢Δɻ E[f] = ∫ f(z)p(z) dz = ∫ f(z) p(z) q(z) q(z) dz ∼ 1 L L ∑ l=1 p(z(l)) q(z(l)) f(z(l)) (11.19) ͜͜Ͱɺ{z(l)} ͸ q(z) ͔ΒͷαϯϓϧͰ͋Δɻ 19 / 56
  20. 11.1.4 ॏ఺αϯϓϦϯά ͜͜Ͱɺrl = p(z(l))/q(z(l)) ͸ॏཁ౓ॏΈͱ͍ͬͯɺq(z) ͰαϯϓϦϯ άͨ͜͠ͱʹΑΔ p(z) ͔ΒͷζϨΛิਖ਼͢ΔҼࢠͰ͋Δɻ

    ͨͱ͑͹ɺ͋Δ l ʹରͯ͠ɺq(z(l)) ͕΄ͱΜͲ 1 ͩͬͨͱ͖ɺαϯϓϧ ͷதʹසൟʹ z(l) ͕ೖͬͯདྷΔ͜ͱ͕༧૝͞ΕΔɻ ͨͩ͠ɺp(z(l)) ͕খ͍͞৔߹͸ɺ͋·Γαϯϓϧ z(l) ͸ (11.19) ʹد༩ ͢Δ΂͖Ͱ͸ͳ͍ɻ ͜ͷͱ͖ɺrl = p(z(l))/q(z(l)) ͕খ͘͞ͳͬͯɺ͔ͨ͠ʹαϯϓϧ z(l) ͸ (11.19) ʹد༩͠ͳ͍ɻ 20 / 56
  21. 11.1.4 ॏ఺αϯϓϦϯά ·ͨɺҎલʹ΋͋ͬͨ௨Γɺp(z) ͕ن֨Խఆ਺Λআ͍ͯΘ͔͍ͬͯΔͱ ͢Δɻ ͭ·Γɺp(z) = p(z)/Zp ͱͨ͠ͱ͖ʹɺp(z) ͸Θ͔͍ͬͯΔ͕ɺZp

    ͸ Θ͔͍ͬͯͳ͍ͱԾఆ͢Δɻ·ͨɺಉ༷ʹ q(z) = q(z)/Zq ͱ͢Δɻ ͜ͷͱ͖ɺ(11.19) ͸ҎԼͷΑ͏ʹͳΔɻ E[f] = ∫ f(z)p(z) dz = ∫ f(z) p(z) q(z) q(z) dz ∼ 1 L L ∑ l=1 p(z(l)) q(z(l)) f(z(l)) = Zq Zp 1 L L ∑ l=1 p(z(l)) q(z(l)) f(z(l)) = Zq Zp 1 L L ∑ l=1 rl f(z(l)) (11.20) ͜͜Ͱɺ{z(l)} ͸ q(z) ͔ΒαϯϓϦϯά͞Εͨαϯϓϧͷू߹Ͱ͋Γɺ rl = p(z(l))/q(z(l)) ͱఆٛͨ͠ɻ 21 / 56
  22. 11.1.4 ॏ఺αϯϓϦϯά ·ͨɺZp = ∫ p(z) dz ͱ Zq =

    q(z)/q(z) Λ༻͍ΔͱɺZp /Zq ΋ҎԼͷ Α͏ʹಉ͡αϯϓϧͷू߹ {z(l)} Λ࢖ͬͯɺۙࣅతʹܭࢉͰ͖Δɻ Zp Zq = ∫ 1 Zq p(z) dz = ∫ p(z) q(z) q(z) dz ∼ 1 L L ∑ l=1 rl (11.21) ΑͬͯɺE[f] ͸ҎԼͷΑ͏ʹۙࣅͰ͖Δɻ E[f] ∼ Zq Zp 1 L L ∑ l=1 rl f(z(l)) ∼ L ∑ L m=1 rm · 1 L L ∑ l=1 rl f(z(l)) = L ∑ l=1 rl ∑ L m=1 rm f(z(l)) = L ∑ l=1 wl f(z(l)) (11.22) ͜͜Ͱɺwl ͸ҎԼͰఆٛ͞ΕΔɻ wl = rl ∑ L m=1 rm (11.23) 22 / 56
  23. 11.1.4 ॏ఺αϯϓϦϯά ͜ΕΑΓɺ͔֬ʹॏ఺αϯϓϦϯάΛ༻͍Δͱɺظ଴஋ E[f] Λۙࣅత ʹٻΊΔ͜ͱ͕Ͱ͖Δɻ ͨͩ͠ɺ͜ͷαϯϓϦϯάͰ࢖༻͢ΔఏҊ෼෍ q(z) ͸αϯϓϧΛٻΊ ͍ͨ෼෍

    p(z) ͱ͋Δఔ౓ࣅ͍ͯΔ෼෍Λ࢖༻͢Δඞཁ͕͋Δɻ ͨͱ͑͹ɺp(z) ͕͋Δαϯϓϧۭؒͷখ͞ͳൣғ A Ͱ 0 Ͱͳ͍Α͏ͳ ෼෍Ͱ͋ΓɺఏҊ෼෍ q(z) ͕ͦͷൣғ A Ͱ 0 Ͱ͋Δͱɺαϯϓϧͷू ߹ {z(l)} ͷதͰൣғ A ʹೖΔ΋ͷ͸ͳ͍ͷͰɺॏཁ౓ॏΈͷू߹ {rl } ͸͸͢΂ͯ 0 ͱͳΔɻ ͜ͷͱ͖ɺE[f] ͷۙࣅ஋͸ 0 ͱͳͬͯ͠·͏ɻ ͞ΒʹɺE[f] ͕ 0 ͱͳΔͷ͕ਖ਼͍͔͠൱͔ (ਖ਼͍͠৔߹΋͋Δ) ΛଌΔ ࢦඪ͕ॏ఺αϯϓϦϯάͰ͸ଘࡏ͠ͳ͍ͷ͕࠷΋ਂࠁͳ఺Ͱ͋Δɻ 23 / 56
  24. 11.1.5 SIR غ٫αϯϓϦϯάͷ໰୊఺͸ɺ্͔Βԡ͑͞ΔΑ͏ͳ k ΛܾΊΔͱɺغ ٫཰͕ߴ͘ͳΔ͜ͱͩͬͨɻ ͜͜Ͱ͸ɺk ΛઃఆͤͣʹࡁΉํ๏Ͱ͋Δ SIR(Sampling-Importance-Resampling) ʹ͍ͭͯઆ໌͢Δɻ

    ·ͣɺఏҊ෼෍ q(z) ͔Β L ݸͷαϯϓϧू߹ {z(l)} ΛಘΔɻ (Sampling) (11.23) ΑΓɺwl Λܭࢉ͢Δɻ(Importance) wl ͸ ∑ l wl = 1 Λຬͨ͢ͷͰɺ཭ࢄతͳ֬཰෼෍ͱΈͳͤΔͷͰɺͦ ͷ֬཰෼෍ pl = wl ʹै͏֬཰Ͱ {z(l)} ͔Β L ݸαϯϓϦϯά͢Δɻ (Resampling) ҎԼͰɺ͜ͷΑ͏ʹ࠶αϯϓϦϯά͞Εͨαϯϓϧू߹ {z(l)} ͸ L → ∞ ͰαϯϓϦϯά͍ͨ͠෼෍ p(z) ͔ΒͷαϯϓϦϯάʹͳ͍ͬͯ Δ͜ͱΛࣔ͢ɻ 24 / 56
  25. 11.1.5 SIR αϯϓϧۭ͕ؒҰม਺ͷ৔߹Ͱɺ֬཰෼෍ pl = wl ͷྦྷੵ෼෍ p(z ≤ a)

    Λܭࢉͯ͠ΈΔɻ(֬཰ม਺ z ͕ a ҎԼͱͳΔ֬཰) p(z ≤ a) ͸ (11.23) Λ༻͍Δͱ p(z ≤ a) = ∑ l:z(l)≤a wl = ∑ l I(z(l) ≤ a)p(z(l))/q(z(l)) ∑ m p(z(m))/q(z(m)) (11.25) ͱͳΔɻ ͜͜ͰɺI(z ≤ a) ͸Ҿ਺͕ਅͷ࣌͸ 1 ͰɺͦΕҎ֎Ͱ͸ 0 ͱͳΔؔ਺Ͱ ͋Δɻ 25 / 56
  26. 11.1.5 SIR L → ∞ ͱ͢Δͱɺ{z(l)} ͸΋ͱ΋ͱ q(z) ͔ΒαϯϓϦϯά͞Εͨαϯ ϓϧͳͷͰɺ

    p(z ≤ a) = ∫ I(z ≤ a){p(z)/q(z)}q(z) dz ∫ {p(z)/q(z)}q(z) dz = ∫ I(z ≤ a)p(z) dz ∫ p(z) dz = ∫ I(z ≤ a)p(z) dz (11.26) ͱͳΓɺ͔֬ʹ L → ∞ Ͱ͸ɺαϯϓϦϯά͍ͨ͠෼෍ p(z) ͷྦྷੵ෼ ෍ʹҰக͍ͯ͠Δɻ 26 / 56
  27. 11.1.6 αϯϓϦϯάͱ EM ΞϧΰϦζϜ EM ΞϧΰϦζϜͷ E εςοϓͷۙࣅܭࢉʹαϯϓϦϯά๏͸࢖༻Ͱ ͖Δɻ EM

    ΞϧΰϦζϜͷ E εςοϓͰ͸ɺӅΕม਺ Z ͷࣄޙ෼෍ p(Z|X, θold) ʹΑΔ׬શσʔλର਺໬౓ ln p(Z, X|θ) ͷظ଴஋ Q(θ, θold) ΛٻΊΔɻ Q(θ, θold) = ∫ p(Z|X, θold) ln p(Z, X|θ) dZ (11.28) ͜ͷੵ෼Λɺࣄޙ෼෍ p(Z|X, θold) ͔Βͷαϯϓϧू߹ {Z(l)} Λ࢖ͬ ͯɺҎԼͷ༗ݶ࿨Ͱۙࣅ͢Δɻ Q(θ, θold) ∼ 1 L L ∑ l=1 ln p(Z(l), X|θ) (11.29) ͦͯ͠ɺ͜ͷ Q(θ, θold) Λ༻͍ͯ M εςοϓΛ࣮ߦ͢Δɻ ͜ͷΑ͏ͳ EM ΞϧΰϦζϜΛϞϯςΧϧϩ EM ΞϧΰϦζϜͱ͍͏ɻ 27 / 56
  28. 11.2 Ϛϧίϑ࿈࠯ϞϯςΧϧϩ ͜͜·Ͱղઆ͖ͯͨ͠αϯϓϦϯά๏Ͱ͸ɺαϯϓϧۭ͕ؒ௿࣍ݩͳΒ ༗ޮͰ͋Δ͕ɺߴ࣍ݩʹͳΔͱ্ख͍͔͘ͳ͍͜ͱ͕Θ͔͍ͬͯΔɻ ͜͜Ͱಋೖ͢ΔϚϧίϑ࿈࠯ϞϯςΧϧϩ (MCMC) Ͱ͸αϯϓϧۭؒ ͕ߴ࣍ݩͰ͋ͬͯ΋Α͘ػೳ͢Δɻ ɹ MCMC

    ʹ͓͍ͯ΋ɺఏҊ෼෍Λಋೖ͢Δɻ ͨͩ͠ɺ͜͜ͰͷఏҊ෼෍͸ݱࡏͷαϯϓϧ z(τ) ʹґଘ͠ɺq(z|z(τ)) ͱͳΓɺ࣍ͷαϯϓϧ z(τ+1) ͸ q(z|z(τ)) ͔ΒಘΒΕΔɻ(ޙ΄Ͳઆ໌͢ ΔϚϧίϑ࿈࠯) ·ͨɺ໨ඪ͸෼෍ p(z) ͔ΒαϯϓϧΛಘΔ͜ͱͰ͋Δ͕ɺ͜͜Ͱ΋ p(z) = p(z)/Zp ͱ͠ɺp(z) ͸Θ͔͍ͬͯΔ͕ɺZp ͷ஋͸Θ͔Βͳ͍ͱ ͢Δɻ 28 / 56
  29. 11.2 Ϛϧίϑ࿈࠯ϞϯςΧϧϩ ·ͣ MCMC ͷҰൠ࿦ʹೖΔલʹɺ࠷΋؆୯ͳྫͰ͋Δ Metropolis Ξϧ ΰϦζϜΛղઆ͢Δɻ ఏҊ෼෍͸͢΂ͯͷαϯϓϧʹ͍ͭͯରশͰ͋Δͱ͢Δɻ ྫ͑͹

    zA ͱ zB ʹରͯ͠ q(zA |zB ) = q(zB |zA ) (ରশͰͳ͍৔߹͸ 11.2.2 Ͱղઆ͢Δɻ) ·ͣɺαϯϓϧ z(τ) ͕༩͑ΒΕͯɺ࣍ͷαϯϓϧީิ z⋆ ͕ఏҊ෼෍ q(z|z(τ)) ͔ΒಘΒΕͨͱ͢Δɻ ͦͷαϯϓϧީิ z⋆ ͸ҎԼͷ֬཰ A(z⋆, z(τ)) Ͱडཧ͞ΕΔɻ A(z⋆, z(τ)) = min ( 1, p(z⋆) p(z(τ)) ) (11.33) ࣮૷Ͱ͸ɺ୯Ґ۠ؒ (0, 1) ͷҰ༷෼෍͔Βཚ਺ u Λऔಘ͠ɺ A(z⋆, z(τ)) > u Ͱ͋Ε͹ɺαϯϓϧީิ z⋆ ͸αϯϓϧͱͯ͠डཧ͞Εɺ ͦΕҎ֎ͷ৔߹͸غ٫͞ΕΔΑ͏ʹ͢Δɻ 29 / 56
  30. 11.2 Ϛϧίϑ࿈࠯ϞϯςΧϧϩ ͜͜Ͱ (11.33) ΑΓɺp(z⋆) > p(z(τ)) Ͱ͋Ε͹ɺA(z⋆, z(τ)) =

    1 ͱͳΓɺ ͲΜͳཚ਺ u Ͱ΋ඞͣ A(z⋆, z(τ)) > u ͱͳΔͷͰɺඞͣαϯϓϧީิ z⋆ ͸αϯϓϧͱͯ͠डཧ͞ΕΔ͜ͱʹ஫ҙɻ ΋͠ɺαϯϓϧީิ z⋆ ͸αϯϓϧͱͯ͠डཧ͞ΕͨΒɺz(τ+1) = z⋆ ͱ ͠ɺغ٫͞ΕͨΒ z(τ+1) = z(τ) ͱ͢Δɻ ͜ͷ఺͕ɺغ٫͞ΕͨΒ୯ʹαϯϓϧΛࣺͯΔغ٫αϯϓϦϯάͱͷҧ ͍Ͱ͋Δɻ (11.2.2 Ͱূ໌͢Δ͕ɺ) ೚ҙͷ zA ͱ zB ʹରͯ͠ q(zA |zB ) ͕ਖ਼ͳΒ ͹ɺz(τ) ͕ै͏෼෍͸ τ → ∞ ͰαϯϓϧΛಘ͍ͨ෼෍ p(z) ʹۙͮ͘ɻ 30 / 56
  31. 11.2.1 Ϛϧίϑ࿈࠯ MCMC ͷҰൠతͳٞ࿦Λ͢ΔͨΊɺ·ͣ͸Ϛϧίϑ࿈࠯ͷٞ࿦Λߦ͏ɻ ͦ͜Ͱɺ·ͣ m εςοϓͰͷ֬཰ม਺Λ z(m) ͱ͢Δɻ ͦͯ͠ɺm

    = 1, · · · , M ͱͨ͠ͱ͖ͷ֬཰ม਺ͷܥྻ z(1), · · · , z(M) ʹ ରͯ͠ɺҎԼͷੑ࣭ (ಠཱੑ) Λຬͨ͢ͱ͖ɺz(1), · · · , z(M) ΛϚϧίϑ ࿈࠯ͱ͍͏ɻ p(z(m+1)|z(1), · · · , z(m)) = p(z(m+1)|z(m)) (11.37) ͭ·Γɺεςοϓ m + 1 ͷ֬཰աఔ͕Ұݸલͷεςοϓ m ΑΓ΋લͷ εςοϓʹ͸ґଘ͠ͳ͍ͱ͍͏͜ͱͰ͋Δɻ ͜ͷ༷ࢠΛάϥϑͰද͢ͱɺҎԼͷΑ͏ʹͳΔɻ 31 / 56
  32. 11.2.1 Ϛϧίϑ࿈࠯ m + 1 εςοϓͰͷαϯϓϧ z(m+1) Λൃੜͤ͞Δपล෼෍ p(z(m+1)) ͸

    p(z(m+1)) = ∑ z(m) p(z(m+1), z(m)) = ∑ z(m) p(z(m+1)|z(m))p(z(m)) (11.38) ͱͳΔɻ ͜͜ͰɺTm (z(m), z(m+1)) = p(z(m+1)|z(m)) ͸ભҠ֬཰ͱ͍͏ɻ ಛʹભҠ֬཰͕εςοϓ m ʹґΒͳ͍ (Tm (z(m), z(m+1)) = T(z(m), z(m+1))) Ϛϧίϑ࿈࠯ΛۉҰϚϧίϑ࿈ ࠯ͱ͍͍ɺࠓޙ͸ͦͷΑ͏ͳભҠ֬཰ʹݶఆͯ͠࿩ΛਐΊΔɻ 32 / 56
  33. 11.2.1 Ϛϧίϑ࿈࠯ Ҏ্ͷٞ࿦ΑΓɺT(z(m), z(m+1)) ͕༩͑ΒΕΕ͹ɺϚϧίϑ࿈࠯ʹै ͏֬཰ม਺͸࣍ͷΑ͏ʹͯ͠ൃੜͤ͞Δ͜ͱ͕Ͱ͖Δɻ 1. ॳظঢ়ଶ z(1) Λॳظ෼෍

    (ྫ͑͹αϯϓϦϯά͕ՄೳͳఏҊ෼෍ q(z)) ͔ΒαϯϓϦϯά͢Δ 2. m = 1, · · · , M − 1 ʹରͯ͠ɺભҠ֬཰ T(z(m), z(m+1)) ΑΓ z(m+1) Λൃੜͤ͞Δ ͜ͷΑ͏ʹͯ͠ൃੜͤͨ͞αϯϓϧ z(m+1) ͸ (11.38) ΑΓɺ͔֬ʹ p(z(m+1)) ͔Βൃੜͤͨ͞αϯϓϧͰ͋Δɻ 33 / 56
  34. 11.2.1 Ϛϧίϑ࿈࠯ ͜ͷΑ͏ʹαϯϓϧ z(m) Λੜ੒͠ଓ͚ͯɺm → ∞ ͱͨ͠ͱ͖ʹ෼෍ p(z(m)) ͸ऩଋ͢Δ͔Ͳ͏͔͕໰୊ͱͳΔɻ

    ͜Ε͸Ϛϧίϑ࿈࠯͕ΤϧΰʔυੑΛຬ͍ͨͯ͠Ε͹ɺऩଋ͢Δ͜ͱ͕ Θ͔͍ͬͯΔɻ Ϛϧίϑ࿈࠯͕ΤϧΰʔυతͰ͋Δͱ͸ɺن໿ੑʢͲͷঢ়ଶ͔ΒͰ΋೚ ҙͷঢ়ଶ΁ભҠͰ͖Δʣͱਖ਼࠶ؼੑʢ೚ҙͷঢ়ଶ΁ԿճͰ΋ભҠͰ͖ Δʣͱඇपظੑʢ೚ҙͷঢ়ଶ͸ҰճͷભҠͰݩʹ໭ΕΔʣΛશͯಉ࣌ʹ ຬͨ͢͜ͱΛݴ͏ɻ ͦͯ͠ΤϧΰʔυੑΛຬ͍ͨͯ͠ΔۉҰϚϧίϑ࿈࠯Ͱ͸ɺm → ∞ ͱ ͨ͠ͱ͖ɺ෼෍ p(z(m)) ͸ҎԼͷৄࡉ௼Γ߹͍৚݅Λຬͨ͢෼෍ p⋆(z) ʹऩଋ͢Δɻ p⋆(z)T(z, z′) = p⋆(z′)T(z′, z) (11.40) 34 / 56
  35. 11.2.1 Ϛϧίϑ࿈࠯ Ҏ্Λ౿·͑ΔͱɺఏҊ෼෍ q(z) ͔ΒɺϚϧίϑ࿈࠯Λ࢖ͬͯر๬ͷ ෼෍ p⋆(z) ͔ΒͷαϯϓϧΛಘ͍ͨͳΒҎԼͷखॱͰαϯϓϦϯάΛߦ ͑͹͍͍ɻ 1.

    (11.40) ͷৄࡉ௼Γ߹͍৚݅ΛΈͨ͢Α͏ͳભҠ֬཰ T(z, z′) Λ༻ ҙ͢Δ 2. ॳظঢ়ଶ z(1) ΛఏҊ෼෍ q(z) ͔ΒαϯϓϦϯά͢Δ 3. m = 1, · · · , M − 1 ʹରͯ͠ɺT(z(m), z(m+1)) ͔Β z(m+1) Λൃੜ ͤ͞Δ 4. m → ∞ ͷͱ͖ͷαϯϓϧ z(m) ͸ر๬ͷ෼෍ p⋆(z) ͔Βͷαϯϓ ϧͰ͋Δ 35 / 56
  36. 11.2.2 Metropolis-Hastings ΞϧΰϦζϜ ҎલɺMetropolis ΞϧΰϦζϜΛ MCMC ͷҰྫͱͯ͠঺հ͕ͨ͠ɺͦ Ε͕αϯϓϦϯά͍ͨ͠෼෍ p(z) ͔ΒͷαϯϓϦϯάʹͳ͍ͬͯΔ͜

    ͱ͸આ໌͠ͳ͔ͬͨɻ ͜͜Ͱ͸ɺMetropolis ΞϧΰϦζϜΛ֦ுͯ͠ɺఏҊ෼෍͕ରশͰͳ͍ ৔߹ (zA ͱ zB ʹରͯ͠ q(zA |zB ) ̸= q(zB |zA )) ͷΞϧΰϦζϜ (Metropolis-Hastings ΞϧΰϦζϜ) Λಋೖ͢Δɻ ·ͣɺαϯϓϧ z(τ) ͕༩͑ΒΕͯɺ࣍ͷαϯϓϧީิ z⋆ ͕ఏҊ෼෍ qk (z|z(τ)) ͔ΒಘΒΕͨͱ͢Δɻ(ఴ͑ࣈ k ͸ભҠઌ͕ෳ਺͋ͬͨ৔߹ ͷͨΊʹ͚͍ͭͯΔɻ11.3 Ͱ۩ମྫΛݟΔɻ) ͦͷαϯϓϧީิ z⋆ ͸ҎԼͷ֬཰ Ak (z⋆, z(τ)) Ͱडཧ͞ΕΔɻ Ak (z⋆, z(τ)) = min ( 1, p(z⋆)qk (z(τ)|z⋆) p(z(τ))qk (z⋆|z(τ)) ) (11.44) 36 / 56
  37. 11.2.2 Metropolis-Hastings ΞϧΰϦζϜ ͜ͷ Metropolis-Hastings ΞϧΰϦζϜͰ͸ɺqk (z′|z) ʹΑΓαϯϓϧީ ิ͕બ͹ΕɺAk (z′,

    z) ʹΑΓडཧ͞ΕΔ͔Ͳ͏͔ܾ·ΔͷͰɺભҠ֬ ཰͸ Tk (z, z′) = qk (z′|z)Ak (z′, z) ͱͳΔ͔Βɺ(11.44) ΑΓ p(z)Tk (z, z′) =p(z)qk (z′|z)Ak (z′, z) =p(z)qk (z′|z) · min ( 1, p(z′)qk (z|z′) p(z)qk (z′|z) ) =p(z)qk (z′|z) · min ( 1, p(z′)qk (z|z′) p(z)qk (z′|z) ) =min ( p(z)qk (z′|z), p(z′)qk (z|z′) ) =p(z′)qk (z|z′) · min ( p(z)qk (z′|z) p(z′)qk (z|z′) , 1 ) =p(z′)qk (z|z′)Ak (z, z′) = p(z′)Tk (z′, z) (11.45) ͱͳΔͷͰɺαϯϓϧΛಘ͍ͨ෼෍ p(z) ͕ৄࡉ௼Γ߹͍৚݅ (11.40) Λ ຬͨ͢ͷͰɺMetropolis-Hastings ΞϧΰϦζϜΛ܁Γฦ͢ͱɺp(z) ͔Β ͷαϯϓϧΛಘΔ͜ͱ͕Ͱ͖Δ͜ͱ͕Θ͔Δɻ 37 / 56
  38. 11.2.2 Metropolis-Hastings ΞϧΰϦζϜ ͜ͷ Metropolis-Hastings ΞϧΰϦζϜʹ΋஫ҙ఺͕͋Δɻ ྫ͑͹ɺҎԼͷਤͷΑ͏ʹɺରশͳఏҊ෼෍ q(z) Λݱࡏͷঢ়ଶ z(τ)

    Λ த৺ʹͨ͠౳ํΨ΢ε෼෍ͱ͠ɺp(z) ͸ํ޲ʹΑͬͯେ͖͘ҟͳΔภ ࠩΛ࣋ͭΨ΢ε෼෍ͱ͢Δɻ(੺͕ p(z) Ͱɺ੨͕ q(z)) ఏҊ෼෍ͷεέʔϧ ρ ͕খ͍͞ͱغ٫཰͸Լ͕Δ͕ɺz ͕ z(τ) ͔Βେ͖ ͘มԽ͠ͳ͍ͨΊɺϥϯμϜ΢ΥʔΫΛͱΓɺܥྻ z(1), · · · ͷؒͰ௕͍ ૬ؔΛ࣋ͭɻ Ұํɺεέʔϧ ρ େ͖͗͘͢͠Δͱ p(z) ͕খ͍͞αϯϓϧΛऔͬͯ͘ ΔՄೳੑ͕ߴ͘ͳΓɺغ٫཰্͕͕Δɻ 38 / 56
  39. 11.3 ΪϒεαϯϓϦϯά ࣍͸ MCMC ͷҰྫͰ͋ΔΪϒεαϯϓϦϯάΛઆ໌͢Δɻ ޙͰड़΂ΔΑ͏ʹɺΪϒεαϯϓϦϯά͸ Metropolis-Hastings Ξϧΰ ϦζϜͷಛघͳ৔߹Ͱ͋Δ͜ͱ͕Θ͔Δɻ αϯϓϦϯάΛ͍ͨ͠෼෍Λ

    p(z) = p(z1 , · · · , zM ) ͱ͠ɺ֤εςοϓͰ ͸ z = (z1 , · · · , zM )T ͷதͷҰͭͷ੒෼ zi Λ p(zi |z\i ) ͔ΒαϯϓϦϯ ά͠ɺߋ৽͢Δɻ ͜͜Ͱɺz\i ͸ z ͔Β zi ΛऔΓআ͍ͨ΋ͷͰ͋Δɻ 1. {zi : i = 1, · · · , M} ΛॳظԽ͢Δ 2. τ = 1, · · · , T ʹରͯ͠ҎԼΛߦ͏ɻ ▶ p(z1 |z(τ) 2 , · · · , z(τ) M ) ͔Β z(τ+1) 1 ΛαϯϓϦϯά ▶ p(z2 |z(τ+1) 1 , z(τ) 3 , · · · , z(τ) M ) ͔Β z(τ+1) 2 ΛαϯϓϦϯά . . . ▶ p(zM |z(τ+1) 1 , z(τ+1) 2 , · · · , z(τ+1) M−1 ) ͔Β z(τ+1) M ΛαϯϓϦϯά 39 / 56
  40. 11.3 ΪϒεαϯϓϦϯά ຊདྷαϯϓϧΛٻΊ͍ͨ෼෍ p(z) = p(z1 , · · ·

    , zM ) ͔ΒͷαϯϓϦϯά ͸αϯϓϧۭ͕ؒߴ࣍ݩͰ͋ΔͨΊɺغ٫αϯϓϦϯάͳͲͰ͸αϯϓ ϦϯάͰ͖ͳ͍ɻ ͔͠͠ɺ৚݅෇͖෼෍ p(zi |z(τ+1) 1 , · · · , z(τ+1) i−1 , z(τ) i+1 , · · · , z(τ) M ) ͸αϯϓ ϧۭ͕ؒҰ࣍ݩͳͷͰɺغ٫αϯϓϦϯάͳͲͰαϯϓϧ z(τ+1) i Λಘ Δ͜ͱ͕Ͱ͖Δɻ ·ͨɺΪϒεαϯϓϦϯάͰͷ֤εςοϓͰ͸ɺzi ͷΈ͕มߋ͞ΕΔͷ ͰɺఏҊ෼෍͸ qi (z∗|z) = p(z∗ i |z\i ) ͱͳΔɻ ͜͜Ͱɺz ͸εςοϓલͷม਺Ͱ z∗ ͸εςοϓલͷม਺Ͱ͋Γɺzi ͷ Έ͕มߋ͞ΕΔͷͰ z∗ \i = z\i Ͱ͋Δɻ 40 / 56
  41. 11.3 ΪϒεαϯϓϦϯά ·ͨɺ͜ͷఏҊ෼෍ qk (z∗|z) = p(z∗ k |z\k )

    ͱҰൠతͳੑ࣭ p(z) = p(zk |z\k )p(z\k ) Λ༻͍Δͱ p(z∗)qk (z|z∗) p(z)qk (z∗|z) = p(z∗ k |z∗ \k )p(z∗ \k )p(zk |z∗ \k ) p(zk |z\k )p(z\k )p(z∗ k |z\k ) = 1 (11.49) ͱͳΔɻ ͜͜Ͱɺz∗ \k = z\k Λ༻͍ͨɻ ͭ·Γɺ(11.44) ΑΓɺ Ak (z∗, z) = min ( 1, p(z∗)qk (z|z∗) p(z)qk (z∗|z) ) = min(1, 1) = 1 ͱͳΓɺΪϒεαϯϓϦϯά͸ Metropolis-Hastings ΞϧΰϦζϜͷಛ घͳ৔߹ (ৗʹडཧ) Ͱ͋Δ͜ͱ͕Θ͔Δɻ ΑͬͯɺΪϒεαϯϓϦϯάΛଓ͚Ε͹ɺαϯϓϧΛಘ͍ͨ෼෍ p(z) ͔ΒͷαϯϓϧΛಘΔ͜ͱ͕Ͱ͖Δ͜ͱ͕Θ͔Δɻ 41 / 56
  42. 11.4 εϥΠεαϯϓϦϯά Metropolis ΞϧΰϦζϜͷ೉఺͸εςοϓ෯Λখ͘͞औΓ͗͢Δͱϥϯ μϜ΢ΥʔΫΛى͜͠ɺେ͖͘औΓ͗͢Δͱغ٫཰্͕͕Δ͜ͱͰ ͋ͬͨɻ εϥΠεαϯϓϦϯάͰ͸ɺ෼෍ͷಛ௃ʹ߹Θͤͯεςοϓ෯Λࣗಈత ʹௐઅ͢Δ͜ͱ͕Ͱ͖Δɻ ͜͜Ͱ΋αϯϓϧΛಘ͍ͨ෼෍ͷܗ͸ਖ਼نԽఆ਺Λআ͍ͯΘ͔͍ͬͯ Δͱ͢Δɻ(p(z)

    ͷܗ͸Θ͔͍ͬͯΔ) ·ͨɺαϯϓϧۭؒ͸Ұ࣍ݩͱ͢Δɻ 42 / 56
  43. 11.4 εϥΠεαϯϓϦϯά αϯϓϧऔಘͷखॱͱͯ͠͸ɺݱࡏͷ఺Λ z ͱͨ͠ͱ͖ʹൣғ 0 ≤ u ≤ p(z)

    ͔ΒҰ༷ʹ u ΛαϯϓϦϯά͢Δɻ ͦͯ͠ u Λݻఆͯ͠ɺp(z) > u ͱͳΔΑ͏ͳ z ͷྖҬ͔Β࣍ͷ z Λந ग़͢Δɻ(p(z) = u ͰεϥΠε) 43 / 56
  44. 11.4 εϥΠεαϯϓϦϯά ͜ͷαϯϓϦϯά͸ಉ࣌෼෍ ˆ p(z, u) ͔ΒαϯϓϦϯάΛߦ͏͜ͱͱ౳ ͍͠ɻ ˆ p(z,

    u) = { 1/Zp (0 ≤ u ≤ p(z)) 0 (otherwise) (11.51) ͨͩ͠ɺ Zp = ∫ p(z) dz Ͱ͋Δɻ ·ͨɺz ͷपล෼෍͸ (11.51) ΑΓ ∫ ˆ p(z, u) du = ∫ p(z) 0 1 Zp du = p(z) Zp = p(z) ͱͳΔͷͰɺαϯϓϧ (u, z) Λ ˆ p(z, u) ͔Βಘͯɺu Λແࢹ͢Ε͹ر๬ ͷ෼෍ p(z) ͔Βͷαϯϓϧ z ͕ಘΒΕΔɻ 44 / 56
  45. 11.4 εϥΠεαϯϓϦϯά ͨͩ͠ɺ࣮ࡍ໰୊ p(z) > u ͱͳΔΑ͏ͳ z ͷྖҬ͔Β࣍ͷ z

    Λநग़͢ Δ͜ͱ͕ࠔ೉ͳ͜ͱ͕ଟ͍ɻ ͦ͜ͰɺԼͷਤͷΑ͏ʹݱࡏͷ z ͷ஋Λ z(τ) ͱ͢Δͱɺͦͷ z(τ) ΛؚΉ ൣғ zmin ≤ z(τ) ≤ zmax ͷҰ༷෼෍͔Β z(τ+1) Λநग़͢Δํ๏͕͋Δɻ Ͱ͖Δ͚ͩ p(z) > u ͱͳΔΑ͏ͳ z Λ zmin ≤ z(τ) ≤ zmax ͷதʹؚΊ ΔΑ͏ʹൣғΛܾΊ͍͕ͨɺ޿͛͗͢Δͱغ٫཰্͕͕ͬͯ͠·͏໰୊ ఺͕͋Δɻ 45 / 56
  46. 11.4 εϥΠεαϯϓϦϯά ͦ͜ͰɺൣғͷܾΊํͱͯ͠ɺ·ͣ z(τ) ΛؚΉΑ͏ʹϥϯμϜʹൣғ w ΛܾΊΔɻ ͦͷ w ͕εϥΠε֎ʹग़ΔΑ͏ʹ֦ு͢Δɻ

    ͦͷ֦ு͞Εͨൣғͷத͔Βαϯϓϧ z′ Λநग़͠ɺͦΕ͕εϥΠε಺ ʹ͋Ε͹αϯϓϧͱ͢Δɻ(z(τ+1) = z′) ΋͠εϥΠε֎ʹ͋Ε͹ɺൣғ w Λ (z(τ) ΛؚΉΑ͏ʹ)z′ Λ୺఺ͱ͢ ΔΑ͏ʹॖখ͢Δɻ ͦͯ͠৽ͨʹ z(τ+1) ͱͳΓ͏ΔީิΛൣғ w ͷத͔ΒऔΓग़͢ɻ 46 / 56
  47. 11.5 ϋΠϒϦουϞϯςΧϧϩΞϧΰϦζϜ ͜Ε·Ͱͷٞ࿦ͷதͰΘ͔ͬͨΑ͏ʹ Metropolis-Hastings ΞϧΰϦζ Ϝͷ໰୊఺͸ɺখ͞ͳεςοϓΛऔΔͱϥϯμϜ΢ΥʔΫΛҾ͖ى͜ ͠ɺεςοϓΛେ͖͘͢Δͱغ٫཰্͕͕Δ͜ͱͰ͋Δɻ ͜͜Ͱ͸ɺ෺ཧγεςϜΛࢀߟʹ͠ɺغ٫཰Λখ͘͞อͬͨ··ɺε ςοϓΛେ͖͘ͱΔํ๏Λߟ͑Δɻ 47

    / 56
  48. 11.5.1 ྗֶܥ ·ͣɺϋϛϧτϯྗֶʹ͍ͭͯઆ໌͢Δɻ ͜Ε·Ͱ཭ࢄతͳεςοϓ τ Ͱͷ֬཰ม਺Λ z(τ) ͱ͕ͨ͠ɺτ Λ࿈ଓ ม਺ʹ֦ு͠ɺ֬཰ม਺Λ

    τ ͷؔ਺ z(τ) ͱ͢Δɻ ྗֶͰݴ͑͹ɺ͜ͷ τ ͕࣌ؒͰɺz(τ) ͕෺ମͷҐஔϕΫτϧͱͳΔɻ ·ͨɺz(τ) ͷ τ ඍ෼ r = dz dτ (11.53) ͸ӡಈྔ (෺ମͷ଎౓ͱಉ౳ͷྔ) Ͱ͋Δɻ ·ͨɺܥͷϙςϯγϟϧΤωϧΪʔΛ E(z) ͱ͢Δͱɺ෺ମ͸ҎԼͷӡ ಈํఔࣜʹै͍ӡಈΛߦ͏͜ͱ͕஌ΒΕ͍ͯΔɻ dr dτ = − ∂E(z) ∂z (11.55) 48 / 56
  49. 11.5.1 ྗֶܥ ͜ΕΛϋϛϧτϯܗࣜͰ·ͱΊͳ͓͢ɻ ·ͣ͸ӡಈΤωϧΪʔ K(r) ΛҎԼͷΑ͏ʹఆٛ͢Δɻ K(r) = 1 2

    ∥r∥2 (11.56) ͞ΒʹɺϙςϯγϟϧΤωϧΪʔ E(z) ͱӡಈΤωϧΪʔ K(r) Λ଍͠ ͨશΤωϧΪʔΛҎԼͰఆٛ͢Δɻ H(z, r) = E(z) + K(r) (11.57) ͜͜ͰɺશΤωϧΪʔ H(z, r) ͸ϋϛϧτϯؔ਺ͱ͍͏ɻ ͜ͷஈ֊Ͱ͸ɺҐஔϕΫτϧ z ͱӡಈྔϕΫτϧ r ͸ಠཱͳϕΫτϧͰ ͋Δ͜ͱʹ஫ҙɻ((11.53) ͱ͍͏ؔ܎͸ຬͨ͞ͳ͍ɻ) 49 / 56
  50. 11.5.1 ྗֶܥ ͜ͷϋϛϧτϯؔ਺Λ༻͍Δͱɺܥͷํఔࣜ (11.53) ͱ (11.55) ͸ҎԼ ͷ 2 ͭͷࣜͰදͤΔ͜ͱ͕Θ͔Δɻ

    dz dτ = ∂H ∂r (11.58) dr dτ = − ∂H ∂z (11.59) ͞Βʹɺ(11.58) ͱ (11.59) Λຬͨ࣌͢ɺϋϛϧτϯؔ਺ͷ࣌ؒඍ෼Λܭ ࢉ͢ΔͱҎԼͷΑ͏ʹ 0 ͱͳΔɻ dH(z, r) dτ = 0 (11.60) ͭ·Γɺ(11.58) ͱ (11.59) Λຬͨ͢ӡಈ͸ɺશΤωϧΪʔ H(z, r) Λอ ଘ͢Δɻ 50 / 56
  51. 11.5.1 ྗֶܥ ͞ΒʹɺԼͷਤͷΑ͏ͳ (z, r) ۭؒ (Ґ૬ۭؒ) ͷ͋ΔྖҬΛߟ͑Δɻ ͜ͷྖҬͷ֤఺͕ํఔࣜ (11.58)

    ͱ (11.59) Λຬͨ͠ͳ͕ΒҠಈͨ͠ޙ ͷମੵ͸ɺݩͷମੵͱಉ͡Ͱ͋Δ͜ͱ͕஌ΒΕ͍ͯΔɻ(Ϧ΢ϰΟϧͷ ఆཧ) 51 / 56
  52. 11.5.1 ྗֶܥ Ҏ্ͷϋϛϧτϯؔ਺ͷ࣌ؒෆมੑͱϦ΢ϰΟϧͷఆཧ͔ΒɺҎԼͷΑ ͏ʹఆٛ͞Εͨ֬཰෼෍͸Ґ૬্ۭؒͷ (11.58) ͱ (11.59) Λຬͨ͢ม Խʹରͯ͠ෆมͰ͋Δ͜ͱ͕Θ͔Δɻ p(z,

    r) = 1 ZH exp (−H(z, r)) (11.63) ͜͜Ͱɺ֬཰෼෍͸ม਺ม׵ޙ΋ن֨Խ͕੒ཱ͍ͯ͠ͳ͍ͱ͍͚ͳ͍ (۩ମతʹ͸ PRML(1.27) ͷΑ͏ͳม׵Λ͢Δ) ͷͰɺϋϛϧτϯؔ਺ͷ ࣌ؒෆมੑ͚ͩͰ͸ p(z, r) ͸ෆมʹͳΒͳ͍͜ͱʹ஫ҙɻ (11.58) ͱ (11.59) Λຬͨ͢ (p(z, r) Λෆมʹ͢Δ)z ͱ r ͷ਺஋తͳ࣌ ؒมԽ (਺஋ੵ෼) ͷ༩͑ํͱͯ͠ɺϦʔϓϑϩοά཭ࢄԽͱ͍͏ํ๏ ͕͋Δɻ 52 / 56
  53. 11.5.1 ྗֶܥ Ϧʔϓϑϩοά཭ࢄԽͱ͸ɺҎԼͷΑ͏ͳߋ৽ํ๏Ͱ͋Δɻ ˆ r(τ + ϵ/2) =ˆ r(τ) −

    ϵ 2 ∂E ∂z (ˆ z(τ)) (11.64) ˆ z(τ + ϵ) =ˆ z(τ) + ϵˆ r(τ + ϵ/2) (11.65) ˆ r(τ + ϵ) =ˆ r(τ + ϵ/2) − ϵ 2 ∂E ∂z (ˆ z(τ + ϵ)) (11.66) ͜ͷߋ৽͸਺஋ੵ෼ʹ΋͔͔ΘΒͣϦ΢ϰΟϧͷఆཧΛຬͨ͢ߋ৽ํ ๏Ͱ͋Δɻ͔͠͠ɺH ͷ஋ʹ͸ ϵ ෼ͷޡ͕ࠩग़Δɻ 53 / 56
  54. 11.5.2 ϋΠϒϦουϞϯςΧϧϩΞϧΰϦζϜ Ҏ্ͷϋϛϧτϯྗֶͱ Metropolis ΞϧΰϦζϜΛ༥߹ͤͨ͞ϋΠϒ ϦουϞϯςΧϧϩΞϧΰϦζϜΛಋग़͢Δɻ ·ͣɺॳظঢ়ଶΛ (z, r) ͱ͠ɺϦʔϓϑϩοά཭ࢄԽͰߋ৽ͨ͠ม਺Λ

    (z⋆, r⋆) ͱ͠ɺҎԼͷ֬཰Ͱडཧ͢Δɻ min(1, exp {H(z, r) − H(z⋆, r⋆)}) (11.67) ΋͠ϋϛϧτϯྗֶΛ׬શʹγϛϡϨʔτͨ͠ΒɺH ͸ෆมͳͷͰඞ ͣडཧ͞ΕΔ͕ɺϦʔϓϑϩοά཭ࢄԽΛ༻͍ͨΒɺ਺஋ੵ෼ʹΑΔޡ ࠩʹΑΓɺH ͕มԽ͢Δ৔߹͕͋ΔͷͰɺغ٫͞ΕΔ͜ͱ͕͋Δɻ ·ͨɺৄࡉ௼Γ߹͍৚͕݅੒ཱ͢Δ͔Ͳ͏͔͸ԋश 11.17 Ͱٞ࿦ͯ͠ ͍Δɻ 54 / 56
  55. 11.6 ෼഑ؔ਺ͷਪఆ ຊষͷ΄ͱΜͲͷ৔߹ͰɺαϯϓϧΛٻΊ͍ͨ෼෍͸ن֨Խఆ਺Λআ͍ ͯΘ͔͍ͬͯΔͱԾఆͨ͠ɻ ͭ·ΓɺαϯϓϧΛٻΊ͍ͨ෼෍ pE (z) Λ pE (z)

    = 1 ZE exp (−E(z)) (11.71) ͱͨ࣌͠ʹ E(z) ͷؔ਺ܗ͸Θ͔͍ͬͯΔ͕ɺZE ͷ஋͸Θ͔Βͳ͍ͱ ͍͏͜ͱͰ͋Δɻ ͞Βʹɺ͜Ε·Ͱͷ͍ΖΜͳαϯϓϦϯά๏Ͱ͸ ZE ͸Θ͔Βͳͯ͘ ΋ɺۙࣅతʹ pE (z) ͔ΒαϯϓϦϯάͰ͖͍ͯͨɻ ͨͩ͠ɺZE ͷ஋͕Θ͔ΔͱϞσϧͷൺֱ͕Ͱ͖ɺศརͳ͕࣌͋Δɻ ͜͜Ͱ͸ɺZE ͷ஋Λ஌Δํ๏Λઆ໌͢Δɻ 55 / 56
  56. 11.6 ෼഑ؔ਺ͷਪఆ ϞσϧൺֱͰ஌Γ͍ͨͷ͸ɺ2 ͭͷϞσϧͷ෼഑ؔ਺ͷൺͰ͋Δɻ ͦ͜ͰɺҎԼͷ෼෍ pG (z) Λߟ͑Δɻ pG (z)

    = 1 ZG exp (−G(z)) ͜͜ͰɺpG (z) ͔ΒͷαϯϓϦϯά͸ՄೳͰ͋ΔͱԾఆ͢Δɻ ͜ͷ࣌ɺൺ ZE /ZG ͸ pG (z) ͔Βͷαϯϓϧͷू߹ {z(l)} Λ༻͍ͯҎԼ ͷΑ͏ʹܭࢉͰ͖Δɻ ZE ZG = ∑ z exp (−E(z)) ∑ z exp (−G(z)) = ∑ z exp (−E(z) + G(z)) exp (−G(z)) ∑ z exp (−G(z)) = ∑ z exp (−E(z) + G(z))pG (z) =EpG [exp (−E + G)] ∼ 1 L ∑ l exp (−E(z(l)) + G(z(l))) (11.72) 56 / 56