Explanation for Weight multiplied in Posterior Probability Sum Let, $P(\theta|x)$ is the posterior probability. It describes $\textbf{how certain or confident we
are that hypothesis $\theta$ is true, given that}$ we have observed data $x$.
Calculating posterior probabilities is the main goal of Bayesian statistics!
$P(\theta)$ is the prior probability, which describes $\textbf{how sure we were that}$ $\theta$ was true,
before we observed the data $x$.
$P(x|\theta)$ is the likelihood. $\textbf{If you were to assume that $\theta$ is true, this is the
probability}$ that you would have observed data $x$.
$P(x)$ is the marginal likelihood. This is the probability that you would have observed data $x$, whether $\theta$ is true or not.
So, $P (\theta|x) = \frac{P (\theta) P(x|\theta)}{P (x)}$
The following part is an excerpt from the same text -

In the Bayesian framework, our predictions are always in the form of
probabilities or (later) probability distributions. They are usually
calculated in three stages.
First, you pretend you actually know the true value of the parameters,
and calculate the probability based on that assumption.
Then, you do this for all possible values of the parameter $\theta$
(alternatively, you can calculate the probability as a function of
$\theta$).
Finally, you combine all of these probabilities in a particular way to
get one final probability which tells you how confident you are of
your prediction.
Suppose we knew the true value of $\theta$ was $0.3$. Then, we would
know the probability of catching the right bus tomorrow is $0.3$. If
we knew the true value of $\theta$ was $0.4$, we would say the
probability of catching the right bus tomorrow is 0.4.
The problem is, we don’t know what the true value is. We only have the
posterior distribution. Luckily, the sum rule of probability (combined
with the product rule) can help us out.
We are interested in whether I will get the good bus tomorrow. There
are $11$ different ways that can happen. Either $\theta=0$ and I get
the good bus, or $\theta=0.1$ and I get the good bus, or $\theta=0.2$
and I get the good bus, and so on. These 11 ways are all mutually
exclusive. That is, only one of them can be true (since $\theta$ is
actually just a single number).
Mathematically, we can obtain the posterior probability of catching
the good bus tomorrow using the sum rule: $$P(\text{good bus tomorrow}|x) = \sum_{\theta} p(\theta|x) \times P(\text{good bus tomorrow}|\theta, x) $$$$=  \sum_{\theta} p(\theta|x) \times \theta$$
This says that the total probability for a good bus tomorrow (given
the data, i.e. using the posterior distribution and not the prior
distribution) is given by

*

*going through each possible $\theta$ value,


*working out the probability assuming the $\theta$ value you are considering is true, multiplying by the probability (given the data)
this $\theta$ value is actually true,


*and summing.
In this particular problem, because $P\text{(good bus  tomorrow}|\theta, x) = θ$, it just so happens that the probability for
tomorrow is the expectation value of $\theta$ using the posterior
distribution.
To three decimal places, the result for the probability tomorrow is
$0.429$. Interestingly, this is not equal to $2/5 = 0.4$.

The problem on page $26, 7$ of the text of Introduction to Bayesian Statistics by Brendon J. Brewer is written as following  -
QUESTION
Now to calculate posterior probability (of catching
the good bus tomorrow) $P(\text{good bus tomorrow}|x)$ why do the author multiplied  $p(\theta|x)$  by $P(\text{good bus tomorrow}|\theta, x) $ in the $\sum_{\theta}$?
To me, $P(\text{good bus tomorrow}|x) = \sum_{\theta} p(\theta|x) $ is correct, so what am I missing?
In this comment I have been told,  $p(\theta|x)$ itself is a weight, which confused me more, so please explain, thanks.
 A: (1) Bayes law with extra-conditioning.
You are familiar with Bayes law.

$$P(\theta|x) = \frac{P(\theta,x)}{P(x)}= \frac{P(x|\theta)}{P(x)}\cdot P(\theta)$$
Intuitively, what is the chance of observing $\theta$ while restricting your attention only to trials where $x$ occurs?

What if, you add an extra condition $y$? What is the chance of observing $\theta$ restricting your attention to trials where both $x,y$ occur?
Bayes' law with extra-conditioning would be:

$$P(\theta|x,y) = \frac{P(x|\theta,y)}{P(x|y)}\cdot P(\theta|y)$$

(2) Multiplication rule with extra conditioning.
Similarly, if $A$ and $B$ are any two events, the joint probability of $AB$ is given by :
$P(AB) = P(B|A)\cdot P(A)$
Adding extra-conditioning, the joint probability of $AB$ conditioned on $C$, is:
$P(AB|C) = P(B|AC)\cdot P(A|C)$
(3) Law of total probability with extra-conditioning.
If the event $A$ depends $n$ disjoint events $\theta_1,\theta_2,\ldots,\theta_n$ then
$\begin{align}
P(A)=\sum_{\theta}p(A|\theta)\cdot P(\theta)
\end{align}$
With extra-conditioning the law of total probability becomes:
$\begin{align}
P(A|x)=\sum_{\theta}p(A|\theta,x)\cdot P(\theta|x)
\end{align}$
