1 / 37

完璧 サンプリング法

数理 情報科学特別講義(慶應・院・数理). July 26, 2012. 完璧 サンプリング法. Read Once Algorithm. 来嶋秀 治 九州大学 大学院システム情報科学研究院 情報学部門. O. Haeggstroem, “ Finite Markov Chains and Algorithmic Application, ” London Mathematical Society, Student Texts, 52, Cambridge University Press, 2002.

Télécharger la présentation

完璧 サンプリング法

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 数理情報科学特別講義(慶應・院・数理) July26, 2012 完璧サンプリング法 Read Once Algorithm 来嶋秀治 九州大学 大学院システム情報科学研究院 情報学部門

  2. O.Haeggstroem, “Finite Markov Chains and Algorithmic Application,” London Mathematical Society, Student Texts, 52, Cambridge University Press, 2002. 来嶋秀治, 松井知己, “完璧にサンプリングしよう!” オペレーションズ・リサーチ, 50 (2005), 第一話「遥かなる過去から」, 169--174 (no. 3), 第二話「天と地の狭間で」, 264--269 (no. 4), 第三話「終りある未来」,329--334 (no. 5). (松井先生のHPよりダウンロードできます) 参考文献

  3. 上級1: Read Onceアルゴリズム • Wilson (2000) • 乱数を記憶しなくて良いCFTPアルゴリズム。

  4. s1 s1 s2 s2 s2 s2 s2 s2 s3 s3 s3 s3 時刻 ... t–1 t t+1 ... t +s–1 t +s Couplingの模式図 時刻 t から t + s (s > 0)までのcouplingの様子 ... ... [t–1] [t] [t+1] [t+s–1] s1 s1 s1 s1 s1 s1 s1     s2 s2 s2 s2 s2 s2 s3 s3 s3 s3 s3 s3

  5. 時刻 ... t–1 t t+1 ... t+s–1 t+s Couplingの模式図 時刻 t から t + s (s > 0)までのcouplingの様子 ... [t] [t+1] [t+s–1]    

  6. y –a–b–c–d –a–b–c –a–b –a Read Onceアルゴリズムのアイデア -- Remember CFTP 時刻0の状態は変わらない! • 時間の遡り方は自由自在 • どこまで遡っても良い (coalescenceを確認した後さらに遡れる) • ステップバックする時間は何でも良い 0 時刻

  7. y –a–b–c–d –a–b–c –a–b –a 0 Read Onceアルゴリズムのアイデア -- Remember CFTP 時刻0の状態は変わらない! • 時間の遡り方は自由自在 • どこまで遡っても良い (coalescenceを確認した後さらに遡れる) • ステップバックする時間は何でも良い 時刻 時刻を過去から未来に進ませたとき、 いつ終わればいいのか?

  8. 定数時間遡る Read Onceアルゴリズム • 時刻0からTまでcouplingを行う。 • (a) もし、coalesceしていたら時刻 Tの状態を変数 xに代入する。 • (b) そうでなければStep 1へ戻る。 • 時刻0からTまでcouplingを行う。特に y = 0T(x,)とする。 • (a) もしcoalesceしていたら xを出力してアルゴリズムを終了する。 • (b) そうでなければ変数 xに yを代入しStep 2へ戻る。 定理 上のアルゴリズムが停止して値を返す時、その値は定常分布に厳密に従う。

  9. 定数時間遡る Read Onceアルゴリズム 1. 時刻0からTまでcouplingを行う。 a) coalesceしていたら時刻 T の状態を変数 xに代入する × 時刻 0 T

  10. 定数時間遡る Read Onceアルゴリズム 1. 時刻0からTまでcouplingを行う。 a) coalesceしていたら時刻 T の状態を変数 xに代入する × 時刻 0 T

  11. 定数時間遡る Read Onceアルゴリズム 1. 時刻0からTまでcouplingを行う。 a) coalesceしていたら時刻 T の状態を変数 xに代入する ○ 時刻 0 T

  12. 0 T 定数時間遡る Read Onceアルゴリズム 2. 時刻0からTまでcouplingを行う。とくに y = 0T(x,)とする。 b) coalesceしていなければ状態 yを変数 xに代入しStep 2へ戻る。 1反復目 時刻 0 T

  13. 0 T 0 T 定数時間遡る Read Onceアルゴリズム 2. 時刻0からTまでcouplingを行う。とくに y = 0T(x,)とする。 b) coalesceしていなければ状態 yを変数 xに代入しStep 2へ戻る。 1反復目 2反復目 時刻 0 T

  14. x 0 T 0 T 0 T 定数時間遡る Read Onceアルゴリズム 2. 時刻0からTまでcouplingを行う。とくに y = 0T(x,)とする。 a) coalesceしていれば状態 xを出力しアルゴリズムを終了する。 1反復目 2反復目 3反復目 時刻 0 T

  15. 1反復目 2反復目 0 T 0 T 0 T 0 T 定数時間遡る Read Onceアルゴリズム 2. 時刻0からTまでcouplingを行う。とくに y = 0T(x,)とする。 a) coalesceしていれば状態 xを出力しアルゴリズムを終了する。 3反復目 時刻

  16. 1. 時刻0からTまでcouplingを行う。 a) coalesceしていたら時刻 T の状態を変数 xに代入する ○ 0 T 定数時間遡る Read Onceアルゴリズム 2. 時刻0からTまでcouplingを行う。とくに y = 0T(x,)とする。 a) coalesceしていれば状態 xを出力しアルゴリズムを終了する。 時刻

  17. x 1反復目 2反復目 0 T 0 0 T T 定数時間遡る Read Onceアルゴリズム 2. 時刻0からTまでcouplingを行う。とくに y = 0T(x,)とする。 a) coalesceしていれば状態 xを出力しアルゴリズムを終了する。 時刻

  18. 1反復目 0 T 0 0 T T 定数時間遡る Read Onceアルゴリズム 2. 時刻0からTまでcouplingを行う。とくに y = 0T(x,)とする。 a) coalesceしていれば状態 xを出力しアルゴリズムを終了する。 2反復目 時刻

  19. 1. 時刻0からTまでcouplingを行う。 a) coalesceしていたら時刻 T の状態を変数 xに代入する ○ 0 T 定数時間遡る Read Onceアルゴリズム 2. 時刻0からTまでcouplingを行う。とくに y = 0T(x,)とする。 a) coalesceしていれば状態 xを出力しアルゴリズムを終了する。 時刻

  20. 1反復目 2反復目 3反復目 x 0 T 0 T 0 0 T T T 定数時間遡る Read Onceアルゴリズム 2. 時刻0からTまでcouplingを行う。とくに y = 0T(x,)とする。 a) coalesceしていれば状態 xを出力しアルゴリズムを終了する。 時刻

  21. 1反復目 2反復目 0 T 0 T 0 T 0 T 定数時間遡る Read Onceアルゴリズム 2. 時刻0からTまでcouplingを行う。とくに y = 0T(x,)とする。 a) coalesceしていれば状態 xを出力しアルゴリズムを終了する。 3反復目 時刻

  22. 1. 時刻0からTまでcouplingを行う。 a) coalesceしていたら時刻 T の状態を変数 xに代入する ○ 0 T 定数時間遡る Read Onceアルゴリズム 2. 時刻0からTまでcouplingを行う。とくに y = 0T(x,)とする。 a) coalesceしていれば状態 xを出力しアルゴリズムを終了する。 ・・・ 以下ずっと続く 時刻

  23. 定数時間遡る Read Onceアルゴリズム 遡る時間設定をどうすればいいか? Coalescence 時間程度にすれば良い。 Coalescence 時間が分からない場合は? Twin run アルゴリズム [Wilson 2000] 遡る時間を、coalescence 時間に設定 coalescence 時間を計る時計として、もう一つマルコフ連鎖を動かす。 遡る時間の設定

  24. 上級1’: Twin Runアルゴリズム • Wilson (2000) • 乱数を記憶しなくて良いCFTPアルゴリズム。 • Twin runによる探索時間の決定。

  25. 確率 ½ で、1反復で終了 y Read Onceのアイデア – CFTPの改訂(1反復の例) 遡る時間を、 coalescence 時間に設定 0 時刻

  26. 確率1/2 確率1/2 y Read Onceのアイデア – CFTPの改訂(2反復の例) 遡る時間を、 coalescence 時間に設定 0 時刻

  27. 確率1/2 確率1/2 確率1/2 確率1/2 y Read Onceのアイデア –CFTPの改訂(4反復の例) 遡る回数の 期待値=2 0 時刻

  28. 確率1/2 確率1/2 確率1/2 確率1/2 y 0 –t1–t2–t3–t4 –t2–t3–t4 –t3–t4 –t4 Read Onceのアイデア – 時刻は過去から未来へ 1反復目 2反復目 3反復目 4反復目 y3 y2 y4 y1 時刻 → 過去から未来へ →

  29. 1[0] 1[1] … … 1[t–1] 2[0] 2[1] … … 2[t–1] Twin run 2つの互いに独立なcoupling 1 X 0 t 時刻 Y 2

  30. Read Onceアルゴリズム • *-successfulを実行し、その出力を変数 x に代入する。 • 1/2の確率で次の(a), (b)のいずれかを実行する。 • (a) xを出力してアルゴリズムを終了する。 • (b) Step 2に進む。 • 状態 xを入力して *-failingを実行し、その出力を変数 x に代入する。 • 1/2の確率で次の(a), (b)のいずれかを実行する。 • (a) xを出力してアルゴリズムを終了する。 • (b) Step 2に戻る。 • プロセス *-successful • 入力: 状態空間  ; • twin run を行い状態 yを返す; • プロセス *-failing • 入力: 状態空間 , 状態 x  ; • twin run を行い状態 yを返す; 定理 上のアルゴリズムが停止して値を返す時、その値は定常分布に厳密に従う。

  31. 1[0] 1[1] … … 1[t–1] t y 2[0] 2[1] … … 2[t–1] プロセス*-successfulの絵 2本ともcoalesceしたら終了 先にcoalesceしたcouplingの時刻tの状態を返す X 0 時刻 Y

  32. 1[0] 1[1] … … 1[t–1] y x t x 2[0] 2[1] … … 2[t–1] プロセス*-failingの絵 1本でもcoalesceしたら終了 coalesceしていない方の時刻 tの状態 0t (x,) を返す X 0 時刻 Y

  33. y –t1–t2–t3–t4 –t2–t3–t4 –t3–t4 –t4 Read Once アルゴリズム (*-successful,*-failing) 1反復目  *-successful 2反復目 *-failing 3反復目 *-failing 4反復目 *-failing y3 y2 y4 y1 0 時刻

  34. Read Once アルゴリズム (詳細) • *-successfulを実行し、その出力を変数 x に代入する。 • 1/2の確率で次の(a), (b)のいずれかを実行する。 • (a) xを出力してアルゴリズムを終了する。 • (b) Step 2に進む。 • 状態 xを入力して *-failingを実行し、その出力を変数 x に代入する。 • 1/2の確率で次の(a), (b)のいずれかを実行する。 • (a) xを出力してアルゴリズムを終了する。 • (b) Step 2に戻る。 • プロセス *-successful • 入力: 状態空間  ; • twin run を行い状態 yを返す; • プロセス *-failing • 入力: 状態空間 , 状態 x  ; • twin run を行い状態 yを返す; 定理 上のアルゴリズムが停止して値を返す時、その値は定常分布に厳密に従う。

  35. 確率1/2 確率1/2 確率1/2 確率1/2 y4 0 –t1–t2–t3–t4 –t2–t3–t4 –t3–t4 –t4 Read Once アルゴリズム 1反復目 2反復目 3反復目 4反復目 y3 y2 y1 時刻 *-successful *-failing *-failing *-failing

  36. *-successful: 推移回数 (期待値は) coalescence時間の 高々2倍 回数: 1回 *-failing: 推移回数 (期待値は) 高々coalescence 時間 回数: (期待値は)1回 Read Once アルゴリズムの計算時間 総推移回数の期待値 ≦( *-successful+*-failing)×(twin run)

  37. The end — all of your views coalesce. Thank you for the attention.

More Related