Module 8 — Probability as Degree of Belief

A.I HUB
3 min readAug 7, 2023

--

Image by Author

In this article, we will walk you through the probability as degree of belief. In this guide we will exploring the core concept probability as the point of degree of belief.

The probability is calculated as a degree of belief in the Bayesian interpretation of the probability. Suppose, in a rainy season, it rains most of the days of the month in some geographical area. The natives of that area believe that the chances of having a rainy day are 80 percent or 0.8. This becomes the prior probability that is based on the degree of belief of the natives.

P(rainy day = true) = 0.8

where a degree of belief of 80 percent that a randomly chosen

day receives rain is the prior probability of having a rainy day

in the absence of any other evidence or the data.

It is important to point out that the degree of belief denotes

the probability of a particular event happening before we make

an actual observation of the event. Obviously, the priors of the

events can change when we observe the actual outcomes or

events. In other words, the presence of evidence may cause

our degree of belief in the event to change. It means that the

calculation of posterior probability from prior likelihood and evidence will change our belief which may be used in later

experiments of a similar type.

As a practical example, we might want to calculate the probability that a patient has heart disease given they are obese.

  • We define event A as “patient has a heart disease.”

    From previous experience and the data collected from

    different hospitals, it is believed that 15 percent of patients have heart disease. P(A) = 0.15.
  • We define event B as “patient is obese.” From the past collected data, we believe that 10 percent of the patients are obese. P(B) = 0.1.
  • Suppose that we know from the hospital tests data that 20 percent of the patients diagnosed with heart disease are obese P(B|A) = 0.2. The probability that a patient is obese, given that they have heart disease, is 20 percent. P(B|A) is referred to as a likelihood function.
  • Now, we are interested to find out the probability that a

    patient has heart disease if they are obese P(A|B).

    This new probability in the presence of evidence, obesity is called posterior probability. It is calculated using the Bayes’ theorem.

P(A|B) = P(B|A) x P(A) / P(B)

P(A|B) = 0.2 x 0.15 / 0.1 = 0.3.

This implies that if a patient is obese, their chances of having

heart disease are 0.3 or 30 percent in contrast to 15 percent chances in the absence of the evidence, as suggested by the past collected data. Thus, the presence of evidence of one event alters the posterior probability of the other event.

In lines 5 to 8, we define a function, namely bayes_rule () that

takes the given probabilities P(A), P(B), and P (B|A) as inputs

and produces P(A|B) as the output. Lines 12 to 19 test our function. We define arbitrary values of P(A), P(B), and P (B|A) and call the function bayes_rule () within the print statement. Note that we have used string formatting operator % as % .1f%% that specifies the format of the floating-point number to be printed. This formatting is applied to the floating-point number returned by (p_a_over_b * 100) to give the result to one decimal place as specified by .1f.

Conclusion

Degree of belief in probability is an important concept in statistics. In this step by step guide, we will take a test drive of calculating probability as certain degree as belief and along with the theoretical knowledge we also gaining the hands-on experience using python as well.

--

--

A.I HUB

A.I HUB is a learning platform, where you can learn from all sorts of courses for free we help individuals and youngster by providing quality content.