ここでは「two-way probability table」の適切な訳が不明なため「Two-Way 確率テーブル」とした。
テキスト Workshop Statistics: Discovery with Data, A Bayesian Approach で、本格的にベイズを扱うトピック 15 から読み始めたが、序文を読んでトピック 14 が「条件付確率」の話題と知って読んでみた。
Workshop Statistics: Discovery With Data, a Bayesian Approach (Workshop Statistics Series)
posted with amazlet at 17.02.14
James H. Albert Allan J. Rossman
Key Curriculum Pr
売り上げランキング: 1,554,339
Key Curriculum Pr
売り上げランキング: 1,554,339
これがかなり面白かった。既にトピック 15 の課題を幾つか解いているが、そこでも使われている「Two-Way 確率テーブル」による確率の算出が特に面白い。以下は、トピック 14 の「まとめ」から
In this topic, we have practiced on interpreting probability tables when there are two numerical outcomes of interest. There is much information in a two-way probability table. One can learn about one of the numerical outcomes by summing the probability table over rows or columns. Also we can compute conditional probabilities by restricting attention to only one row or only one column. These conditional probabilities that we compute help us understand how one outcome is dependent on the knowledge of the second outcome. We will use two-way probability tables in the introduction of statistical inference in the next topic.
要約すると
- ある行や列に限定して条件付確率を計算
- その条件付確率からある事象と別の事象の依存具合を理解できる
この「Two-Way 確率テーブル」のことを知っていたら、条件付確率や独立性について、長期間悩むことはなかったのに...、と若干嘆いたが後悔はない。学び方や理解の仕方は様々だ。常に近道を行けるほど私は賢くない、と改めて思い知った出来事(泣)
ベイズの理解では避けられない「条件付確率」を理解するには、このテーブルは非常に面白い。
「Two-Way 確率テーブル」で条件付確率
偏りのないコイン(表H : 裏T = 0.5 : 0.5)を 3 回投げると、次のような結果になる。
各カラムは、事象「OUTCOME」、表(H)が出る数(# OF HEADS)と、連続する回数(# OF RUNS)、8 つの各事象の確率「PROBABILITY」。1/8 の理由は (1/2)*(1/2)*(1/2), もしくは 8 つとも同じ確率で出るため。
注意:HHH, TTT は他より出にくいと感じた方は、「組合せ」とした誤解です。この場合は「順列」です。
私は「連続する回数(# OF RUNS)」で悩んだ。その点は、末尾 The Number of Runs 参照。
次は「Two-Way 確率テーブル」で、先の表から作成したもの。
# OF RUNS の下での # OF HEADS の条件付確率
# OF RUNS が 2 の場合、# OF HEADS の各確率
1 が 50%, 2 が 50%、0 と 1 は起こらない
# OF HEADS が 2 の場合、# OF RUNS の各確率
1 は起こらない、 2 が 2/3、3 が 1/3
# OF RUNS が条件の場合、行(0, 1/4, 1/4, 0)
# OF HEADS が条件の場合、列(0, 1/4, 1/8)
冒頭に示した、本トピックの要約のようにして、条件付確率が算出できる。
当初は、「偏りのないコイン投げで、条件付確率てどうすのかな?」が正直な疑問だった。# OF RUNS 「連続する回数」を条件にすれば、確かに表の出方は限定されて、条件付確率が成立する。
自明のこととはいえ、こうやって「Two-Way 確率テーブル」を使うと、視覚的にも納得感は高い。
Topic14 独立性の検証 に続く。
The Number of Runs:あの頃の僕はアホだった
HTH の場合は
In the three tosses above, we observe 2 heads and 3 runs in the sequence.
2 heads の「表二回」は自明だが、3 runs が理解できなかった。the number of runs の説明もあるのだが
the number of runs in the sequence (a run is a sequence of heads, like HHH, or a sequence of tails, like TT)
何だか良く分からない。結果の表から、HHH なら 1, HHTなら 2, HTHなら 3 だって....。「俺は頭が悪いのか...」と泣きそうになりながら(泣かないけどね...)、ネットを漁った。大量の検索結果から、次の投稿を見つけた。
A coin with heads probability p is flipped n times. A "run" is a maximal sequence of consecutive flips that are all the same. For example, the sequence HTHHHTTH with n=8 has five runs, namely H, T, HHH, TT,H.
HTHHHTTH が「H, T, HHH, TT, H」で「5 runs」
つまり、H と T の「1 つ以上の連続した組みの回数」。
HHH は「H だけなので 1つ」
HHT は「HH と T で 2つ」
HTH は「H と T と H で 3つ」
ということです。
あぁ、あの頃の僕はアホだったぁ〜
今の僕の方が、まだマシだぁ〜
と Bob Dylan の My Back Pages の替え歌を、思わず口ずさんでみたが、虚しいだけだった(泣)このヒントの記事を投稿された方、ありがとうございます、助かりました。



0 件のコメント:
コメントを投稿