プリンキピア

第2章準備

2.6.4. Multiple Random Variables2.6.4 複数の確率変数

You might have noticed that we could not even make it through the previous section without making statements involving interactions among multiple random variables (recall P(X,Y)=P(X)P(Y)). Most of machine learning is concerned with such relationships. Here, the sample space would be the population of interest, say customers who transact with a business, photographs on the Internet, or proteins known to biologists. Each random variable would represent the (unknown) value of a different attribute. Whenever we sample an individual from the population, we observe a realization of each of the random variables. Because the values taken by random variables correspond to subsets of the sample space that could be overlapping, partially overlapping, or entirely disjoint, knowing the value taken by one random variable can cause us to update our beliefs about which values of another random variable are likely. If a patient walks into a hospital and we observe that they are having trouble breathing and have lost their sense of smell, then we believe that they are more likely to have COVID-19 than we might if they had no trouble breathing and a perfectly ordinary sense of smell.
英語のヒント
前の節でさえ、複数の確率変数のあいだの相互作用にかかわる言明をせずには進めなかったことに気づいたかもしれない(P(X,Y)=P(X)P(Y)を思い出そう)。機械学習のほとんどは、そうした関係を扱う。ここでは標本空間は関心のある母集団、たとえばある企業と取引する客、インターネット上の写真、生物学者に知られたタンパク質などになる。各確率変数は、異なる属性の(未知の)値を表す。母集団から一つを抽出するたびに、各確率変数の実現値を観測する。確率変数がとる値は、重なり合ったり、部分的に重なったり、まったく交わらなかったりしうる標本空間の部分集合に対応するので、一方の確率変数がとる値を知ると、もう一方の確率変数のどの値がありそうかについての信念を更新することになりうる。患者が病院に来て、呼吸が苦しく嗅覚を失っていることがわかれば、呼吸に問題がなく嗅覚がまったく普通の場合よりも、COVID-19にかかっている可能性が高いと考える。
When working with multiple random variables, we can construct events corresponding to every combination of values that the variables can jointly take. The probability function that assigns probabilities to each of these combinations (e.g. A=a and B=b) is called the joint probability function and simply returns the probability assigned to the intersection of the corresponding subsets of the sample space. The joint probability assigned to the event where random variables A and B take values a and b, respectively, is denoted P(A=a,B=b), where the comma indicates “and”. Note that for any values a and b, it follows that
英語のヒント
複数の確率変数を扱うときは、変数が一緒にとりうる値の組み合わせのそれぞれに対応する事象を作れる。こうした組み合わせのそれぞれ(たとえばA=aかつB=b)に確率を割り当てる確率関数を同時確率関数といい、これは単に、標本空間の対応する部分集合の共通部分に割り当てられた確率を返す。確率変数AとBがそれぞれ値aとbをとる事象に割り当てられた同時確率はP(A=a,B=b)と表され、コンマは「かつ」を示す。任意の値aとbについて、次が成り立つことに注意してほしい。
P(A=a,B=b)≤P(A=a) and P(A=a,B=b)≤P(B=b),(2.6.1)
since for A=a and B=b to happen, A=a has to happen and B=b also has to happen. Interestingly, the joint probability tells us all that we can know about these random variables in a probabilistic sense, and can be used to derive many other useful quantities, including recovering the individual distributions P(A) and P(B). To recover P(A=a) we simply sum up P(A=a,B=v) over all values v that the random variable B can take: P(A=a)=∑vP(A=a,B=v).
英語のヒント
なぜなら、A=aかつB=bが起きるには、A=aが起きなければならず、B=bも起きなければならないからである。おもしろいことに、同時確率は、確率的な意味でこれらの確率変数について知りうることをすべて教えてくれ、個々の分布P(A)とP(B)を取り戻すことを含め、ほかの多くの役立つ量を導くのに使える。P(A=a)を取り戻すには、確率変数Bがとりうるすべての値vについてP(A=a,B=v)を足し合わせればよい。つまりP(A=a)=∑vP(A=a,B=v)である。
The ratio P(A=a,B=b)P(A=a)≤1 turns out to be extremely important. It is called the conditional probability, and is denoted via the “∣” symbol:
英語のヒント
比P(A=a,B=b)P(A=a)≤1は非常に重要であることがわかる。これは条件付き確率と呼ばれ、「∣」という記号で表される。
P(B=b∣A=a)=P(A=a,B=b)/P(A=a).(2.6.2)
It tells us the new probability associated with the event B=b, once we condition on the fact A=a took place. We can think of this conditional probability as restricting attention only to the subset of the sample space associated with A=a and then renormalizing so that all probabilities sum to 1. Conditional probabilities are in fact just ordinary probabilities and thus respect all of the axioms, as long as we condition all terms on the same event and thus restrict attention to the same sample space. For instance, for disjoint events ℬ and ℬ′, we have that P(ℬ∪ℬ′∣A=a)=P(ℬ∣A=a)+P(ℬ′∣A=a).
英語のヒント
これは、A=aが起きたという事実で条件付けたときの、事象B=bに結びついた新しい確率を教えてくれる。この条件付き確率は、A=aに結びついた標本空間の部分集合だけに注意を限り、すべての確率の和が1になるように正規化し直すことだと考えられる。条件付き確率は、実はただの普通の確率なので、すべての項を同じ事象で条件付けて同じ標本空間に注意を限るかぎり、すべての公理に従う。たとえば、交わらない事象ℬとℬ′については、P(ℬ∪ℬ′∣A=a)=P(ℬ∣A=a)+P(ℬ′∣A=a)が成り立つ。
Using the definition of conditional probabilities, we can derive the famous result called Bayes’ theorem. By construction, we have that P(A,B)=P(B∣A)P(A) and P(A,B)=P(A∣B)P(B). Combining both equations yields P(B∣A)P(A)=P(A∣B)P(B) and hence
英語のヒント
条件付き確率の定義を使うと、ベイズの定理と呼ばれる有名な結果を導ける。作り方から、P(A,B)=P(B∣A)P(A)であり、P(A,B)=P(A∣B)P(B)である。両方の式を組み合わせるとP(B∣A)P(A)=P(A∣B)P(B)が得られ、したがって次が成り立つ。
P(A∣B)=P(B∣A)P(A)P(B).(2.6.3)
This simple equation has profound implications because it allows us to reverse the order of conditioning. If we know how to estimate P(B∣A), P(A), and P(B), then we can estimate P(A∣B). We often find it easier to estimate one term directly but not the other and Bayes’ theorem can come to the rescue here. For instance, if we know the prevalence of symptoms for a given disease, and the overall prevalences of the disease and symptoms, respectively, we can determine how likely someone is to have the disease based on their symptoms. In some cases we might not have direct access to P(B), such as the prevalence of symptoms. In this case a simplified version of Bayes’ theorem comes in handy:
英語のヒント
この単純な式は、条件付けの順序を逆にできるので、深い意味をもつ。P(B∣A)、P(A)、P(B)の推定のしかたがわかれば、P(A∣B)を推定できる。一方の項は直接推定しやすいがもう一方はそうでないことがよくあり、そこでベイズの定理が助けてくれる。たとえば、ある病気の症状の出現率と、病気と症状それぞれの全体の出現率がわかっていれば、症状にもとづいて誰かがその病気にかかっている可能性がどれほどかを決められる。症状の出現率のように、P(B)が直接手に入らない場合もある。この場合、ベイズの定理を簡単にした形が役に立つ。
P(A∣B)∝P(B∣A)P(A).(2.6.4)
Since we know that P(A∣B) must be normalized to 1, i.e., ∑aP(A=a∣B)=1, we can use it to compute
英語のヒント
P(A∣B)は1に正規化されなければならない、つまり∑aP(A=a∣B)=1であるとわかっているので、それを使って次を計算できる。
P(A∣B)=P(B∣A)P(A)∑aP(B∣A=a)P(A=a).(2.6.5)
In Bayesian statistics, we think of an observer as possessing some (subjective) prior beliefs about the plausibility of the available hypotheses encoded in the prior P(H), and a likelihood function that says how likely one is to observe any value of the collected evidence for each of the hypotheses in the class P(E∣H). Bayes’ theorem is then interpreted as telling us how to update the initial prior P(H) in light of the available evidence E to produce posterior beliefs P(H∣E)=P(E∣H)P(H)P(E). Informally, this can be stated as “posterior equals prior times likelihood, divided by the evidence”. Now, because the evidence P(E) is the same for all hypotheses, we can get away with simply normalizing over the hypotheses.
英語のヒント
ベイズ統計では、観測者は、事前分布P(H)に符号化された、利用できる仮説の妥当さについての(主観的な)事前の信念と、クラスP(E∣H)の各仮説のもとで集めた証拠の各値を観測する可能性がどれほどかを述べる尤度関数とをもっていると考える。そのうえでベイズの定理は、利用できる証拠Eに照らして最初の事前分布P(H)をどう更新し、事後の信念P(H∣E)=P(E∣H)P(H)P(E)を得るかを教えてくれるものと解釈される。くだけた言い方をすれば、これは「事後は事前と尤度の積を証拠で割ったものに等しい」と言える。さて、証拠P(E)はすべての仮説で同じなので、仮説について正規化するだけで済ませられる。
Note that ∑aP(A=a∣B)=1 also allows us to marginalize over random variables. That is, we can drop variables from a joint distribution such as P(A,B). After all, we have that
英語のヒント
∑aP(A=a∣B)=1によって、確率変数について周辺化することもできることに注意してほしい。つまり、P(A,B)のような同時分布から変数を落とせる。なにしろ、次が成り立つからである。
∑aP(B∣A=a)P(A=a)=∑aP(B,A=a)=P(B).(2.6.6)
Independence is another fundamentally important concept that forms the backbone of many important ideas in statistics. In short, two variables are independent if conditioning on the value of A does not cause any change to the probability distribution associated with B and vice versa. More formally, independence, denoted A⊥B, requires that P(A∣B)=P(A) and, consequently, that P(A,B)=P(A∣B)P(B)=P(A)P(B). Independence is often an appropriate assumption. For example, if the random variable A represents the outcome from tossing one fair coin and the random variable B represents the outcome from tossing another, then knowing whether A came up heads should not influence the probability of B coming up heads.
英語のヒント
独立性は、統計学の多くの重要な考え方の背骨となる、根本的に重要なもう一つの概念である。手短に言えば、二つの変数が独立であるとは、Aの値で条件付けてもBに結びついた確率分布が何も変わらず、その逆も成り立つことである。より形式的には、A⊥Bと表される独立性は、P(A∣B)=P(A)であること、したがってP(A,B)=P(A∣B)P(B)=P(A)P(B)であることを要求する。独立性は、多くの場合、適切な仮定である。たとえば、確率変数Aがある公正な硬貨を投げた結果を表し、確率変数Bが別の硬貨を投げた結果を表すなら、Aが表を出したかどうかを知っても、Bが表を出す確率には影響しないはずである。
Independence is especially useful when it holds among the successive draws of our data from some underlying distribution (allowing us to make strong statistical conclusions) or when it holds among various variables in our data, allowing us to work with simpler models that encode this independence structure. On the other hand, estimating the dependencies among random variables is often the very aim of learning. We care to estimate the probability of disease given symptoms specifically because we believe that diseases and symptoms are not independent.
英語のヒント
独立性がとりわけ役立つのは、ある元の分布からのデータの連続した取り出しのあいだで成り立つ場合(強い統計的結論を下せる)や、データのさまざまな変数のあいだで成り立ち、この独立性の構造を組み込んだより単純なモデルを扱える場合である。一方で、確率変数のあいだの依存関係を推定することこそが、学習の目的であることも多い。症状が与えられたときの病気の確率を推定したいのは、まさに、病気と症状が独立ではないと考えているからである。
Note that because conditional probabilities are proper probabilities, the concepts of independence and dependence also apply to them. Two random variables A and B are conditionally independent given a third variable C if and only if P(A,B∣C)=P(A∣C)P(B∣C). Interestingly, two variables can be independent in general but become dependent when conditioning on a third. This often occurs when the two random variables A and B correspond to causes of some third variable C. For example, broken bones and lung cancer might be independent in the general population but if we condition on being in the hospital then we might find that broken bones are negatively correlated with lung cancer. That is because the broken bone explains away why some person is in the hospital and thus lowers the probability that they are hospitalized because of having lung cancer.
英語のヒント
条件付き確率はきちんとした確率なので、独立性と依存性の概念はそれにも当てはまることに注意してほしい。二つの確率変数AとBが、第三の変数Cが与えられたもとで条件付き独立であるのは、P(A,B∣C)=P(A∣C)P(B∣C)であるとき、かつそのときに限る。おもしろいことに、二つの変数は一般には独立でも、第三の変数で条件付けると従属になりうる。これは、二つの確率変数AとBが、ある第三の変数Cの原因に対応するときによく起こる。たとえば、骨折と肺がんは一般の人々のあいだでは独立かもしれないが、入院していることで条件付けると、骨折は肺がんと負の相関があるとわかるかもしれない。骨折が、ある人がなぜ入院しているのかの説明をつけてしまい、その人が肺がんのせいで入院している確率を下げるからである。
And conversely, two dependent random variables can become independent upon conditioning on a third. This often happens when two otherwise unrelated events have a common cause. Shoe size and reading level are highly correlated among elementary school students, but this correlation disappears if we condition on age.
英語のヒント
逆に、従属な二つの確率変数が、第三の変数で条件付けると独立になることもある。これは、ほかの点では無関係な二つの出来事が共通の原因をもつときによく起こる。小学生のあいだでは靴のサイズと読解力の水準は強く相関しているが、年齢で条件付けるとこの相関は消える。