chapter
int64
1
14
question_number
stringlengths
3
5
difficulty
stringclasses
3 values
question_text
stringlengths
64
8.24k
answer
stringlengths
56
16.5k
answer_length
int64
14
16.6k
6
6.7
easy
Verify the results $k(\mathbf{x}, \mathbf{x}') = k_1(\mathbf{x}, \mathbf{x}') + k_2(\mathbf{x}, \mathbf{x}')$ and $k(\mathbf{x}, \mathbf{x}') = k_1(\mathbf{x}, \mathbf{x}')k_2(\mathbf{x}, \mathbf{x}')$ for constructing valid kernels.
To prove $k(\mathbf{x}, \mathbf{x}') = k_1(\mathbf{x}, \mathbf{x}') + k_2(\mathbf{x}, \mathbf{x}')$, we will use the property stated below $= \phi(\mathbf{x})^{\mathrm{T}} \phi(\mathbf{z}).$. Since we know $k_1(\mathbf{x}, \mathbf{x}')$ and $k_2(\mathbf{x}, \mathbf{x}')$ are valid kernels, their Gram matrix $\math...
2,420
6
6.8
easy
Verify the results $k(\mathbf{x}, \mathbf{x}') = k_3(\phi(\mathbf{x}), \phi(\mathbf{x}'))$ and $k(\mathbf{x}, \mathbf{x}') = \mathbf{x}^{\mathrm{T}} \mathbf{A} \mathbf{x}'$ for constructing valid kernels.
For $k(\mathbf{x}, \mathbf{x}') = k_3(\phi(\mathbf{x}), \phi(\mathbf{x}'))$ we suppose $k_3(\mathbf{x}, \mathbf{x}') = \mathbf{g}(\mathbf{x})^T \mathbf{g}(\mathbf{x}')$ , and thus we have: $$k(\mathbf{x}, \mathbf{x}') = k_3(\phi(\mathbf{x}), \phi(\mathbf{x}')) = g(\phi(\mathbf{x}))^T g(\phi(\mathbf{x}')) = f(\mathbf{...
1,714
6
6.9
easy
Verify the results $k(\mathbf{x}, \mathbf{x}') = k_a(\mathbf{x}_a, \mathbf{x}'_a) + k_b(\mathbf{x}_b, \mathbf{x}'_b)$ and $k(\mathbf{x}, \mathbf{x}') = k_a(\mathbf{x}_a, \mathbf{x}'_a)k_b(\mathbf{x}_b, \mathbf{x}'_b)$ for constructing valid kernels.
To prove $k(\mathbf{x}, \mathbf{x}') = k_a(\mathbf{x}_a, \mathbf{x}'_a) + k_b(\mathbf{x}_b, \mathbf{x}'_b)$, let's first expand the expression: $$k(\mathbf{x}, \mathbf{x}') = k_a(\mathbf{x}_a, \mathbf{x}'_a) + k_b(\mathbf{x}_b, \mathbf{x}'_b)$$ $$= \sum_{i=1}^{M} \phi_i^{(a)}(\mathbf{x}_a) \phi_i^{(a)}(\mathbf{x}'_a)...
2,450
7
7.1
medium
- 7.1 (\*\*) Suppose we have a data set of input vectors $\{\mathbf{x}_n\}$ with corresponding target values $t_n \in \{-1,1\}$ , and suppose that we model the density of input vectors within each class separately using a Parzen kernel density estimator (see Section 2.5.1) with a kernel $k(\mathbf{x}, \mathbf{x}')...
By analogy to Eq $p(\mathbf{x}) = \frac{1}{N} \sum_{n=1}^{N} \frac{1}{h^D} k\left(\frac{\mathbf{x} - \mathbf{x}_n}{h}\right)$, we can obtain: $$p(\mathbf{x}|t) = \begin{cases} \frac{1}{N_{+1}} \sum_{n=1}^{N_{+1}} \frac{1}{Z_k} \cdot k(\mathbf{x}, \mathbf{x}_n) & t = +1\\ \frac{1}{N_{-1}} \sum_{n=1}^{N_{-1}} \frac{1}{Z...
2,812
7
7.10
medium
Derive the result $= -\frac{1}{2} \left\{ N \ln(2\pi) + \ln |\mathbf{C}| + \mathbf{t}^{\mathrm{T}} \mathbf{C}^{-1} \mathbf{t} \right\}$ for the marginal likelihood function in the regression RVM, by performing the Gaussian integral over w in $p(\mathbf{t}|\mathbf{X}, \boldsymbol{\alpha}, \beta) = \int p(\mathbf{t}|\mat...
We first note that this result is given immediately from (2.113)–(2.115), but the task set in the exercise was to practice the technique of completing the square. In this solution and that of Exercise 7.12, we broadly follow the presentation in Section 3.5.1. Using $p(\mathbf{t}|\mathbf{X}, \mathbf{w}, \beta) = \prod_{...
3,684
7
7.12
medium
Show that direct maximization of the log marginal likelihood $= -\frac{1}{2} \left\{ N \ln(2\pi) + \ln |\mathbf{C}| + \mathbf{t}^{\mathrm{T}} \mathbf{C}^{-1} \mathbf{t} \right\}$ for the regression relevance vector machine leads to the re-estimation equations $\alpha_i^{\text{new}} = \frac{\gamma_i}{m_i^2}$ and $(\beta...
According to the previous problem, we can explicitly write down the log marginal likelihood in an alternative form: $$\ln p(\mathbf{t}|\mathbf{X}, \boldsymbol{\alpha}, \boldsymbol{\beta}) = \frac{N}{2} \ln \boldsymbol{\beta} - \frac{N}{2} \ln 2\pi + \frac{1}{2} \ln |\boldsymbol{\Sigma}| + \frac{1}{2} \sum_{i=1}^{M} \l...
5,244
7
7.13
medium
In the evidence framework for RVM regression, we obtained the re-estimation formulae $\alpha_i^{\text{new}} = \frac{\gamma_i}{m_i^2}$ and $(\beta^{\text{new}})^{-1} = \frac{\|\mathbf{t} - \mathbf{\Phi}\mathbf{m}\|^2}{N - \sum_{i} \gamma_i}$ by maximizing the marginal likelihood given by $= -\frac{1}{2} \left\{ N \ln(2\...
This problem is quite confusing. In my point of view, the posterior should be denoted as $p(\mathbf{w}|\mathbf{t}, \mathbf{X}, \{a_i, b_i\}, a_{\beta}, b_{\beta})$ , where $a_{\beta}, b_{\beta}$ controls the Gamma distribution of $\beta$ , and $a_i, b_i$ controls the Gamma distribution of $\alpha_i$ . What we sh...
688
7
7.14
medium
Derive the result $= \mathcal{N}\left(t|\mathbf{m}^{\mathrm{T}}\boldsymbol{\phi}(\mathbf{x}), \sigma^{2}(\mathbf{x})\right).$ for the predictive distribution in the relevance vector machine for regression. Show that the predictive variance is given by $\sigma^{2}(\mathbf{x}) = (\beta^{*})^{-1} + \phi(\mathbf{x})^{\math...
We begin by writing down $p(t|\mathbf{x}, \mathbf{w}, \beta^*)$ . Using Eq $p(t|\mathbf{x}, \mathbf{w}, \beta) = \mathcal{N}(t|y(\mathbf{x}), \beta^{-1})$ and Eq $y(\mathbf{x}) = \sum_{i=1}^{M} w_i \phi_i(\mathbf{x}) = \mathbf{w}^{\mathrm{T}} \phi(\mathbf{x})$, we can obtain: $$p(t|\mathbf{x}, \mathbf{w}, \beta^*) = ...
2,039
7
7.15
medium
Using the results $|\mathbf{C}| = |\mathbf{C}_{-i}||1 + \alpha_i^{-1} \boldsymbol{\varphi}_i^{\mathrm{T}} \mathbf{C}_{-i}^{-1} \boldsymbol{\varphi}_i|$ and $\mathbf{C}^{-1} = \mathbf{C}_{-i}^{-1} - \frac{\mathbf{C}_{-i}^{-1} \boldsymbol{\varphi}_{i} \boldsymbol{\varphi}_{i}^{\mathrm{T}} \mathbf{C}_{-i}^{-1}}{\alpha_{i}...
We just follow the hint. $$\begin{split} L(\pmb{\alpha}) &= -\frac{1}{2} \{ N \ln 2\pi + \ln |\mathbf{C}| + \mathbf{t}^T \mathbf{C}^{-1} \mathbf{t} \} \\ &= -\frac{1}{2} \Big\{ N \ln 2\pi + \ln |\mathbf{C}_{-i}| + \ln |1 + \alpha_i^{-1} \pmb{\varphi}_i^T \mathbf{C}_{-i}^{-1} \pmb{\varphi}_i | \\ &+ \mathbf{t}^T (\math...
1,318
7
7.16
easy
By taking the second derivative of the log marginal likelihood $\lambda(\alpha_i) = \frac{1}{2} \left[ \ln \alpha_i - \ln (\alpha_i + s_i) + \frac{q_i^2}{\alpha_i + s_i} \right]$ for the regression RVM with respect to the hyperparameter $\alpha_i$ , show that the stationary point given by $\alpha_i = \frac{s_i^2}{q_i^...
We first calculate the first derivative of Eq(7.97) with respect to $\alpha_i$ : $$\frac{\partial \lambda}{\partial \alpha_i} = \frac{1}{2} \left[ \frac{1}{\alpha_i} - \frac{1}{\alpha_i + s_i} - \frac{q_i^2}{(\alpha_i + s_i)^2} \right]$$ Then we calculate the second derivative: $$\frac{\partial^2 \lambda}{\partial ...
1,537
7
7.17
medium
Using $\Sigma = (\mathbf{A} + \beta \mathbf{\Phi}^{\mathrm{T}} \mathbf{\Phi})^{-1}$ and $\mathbf{C} = \beta^{-1} \mathbf{I} + \mathbf{\Phi} \mathbf{A}^{-1} \mathbf{\Phi}^{\mathrm{T}}.$, together with the matrix identity (C.7), show that the quantities $S_n$ and $Q_n$ defined by $Q_i = \boldsymbol{\varphi}_i^{\mathr...
We just follow the hint. According to Eq $Q_i = \boldsymbol{\varphi}_i^{\mathrm{T}} \mathbf{C}^{-1} \mathbf{t}$, Eq $\mathbf{C} = \beta^{-1} \mathbf{I} + \mathbf{\Phi} \mathbf{A}^{-1} \mathbf{\Phi}^{\mathrm{T}}.$ and matrix identity (C.7), we have: $$Q_{i} = \boldsymbol{\varphi}_{i}^{T} \mathbf{C}^{-1} \mathbf{t}$$ $...
1,771
7
7.18
easy
Show that the gradient vector and Hessian matrix of the log posterior distribution $= \sum_{n=1}^{N} \left\{ t_n \ln y_n + (1 - t_n) \ln(1 - y_n) \right\} - \frac{1}{2} \mathbf{w}^{\mathrm{T}} \mathbf{A} \mathbf{w} + \text{const} \quad$ for the classification relevance vector machine are given by $\nabla \ln p(\mathbf{...
We begin by deriving the first term in Eq $= \sum_{n=1}^{N} \left\{ t_n \ln y_n + (1 - t_n) \ln(1 - y_n) \right\} - \frac{1}{2} \mathbf{w}^{\mathrm{T}} \mathbf{A} \mathbf{w} + \text{const} \quad$ with respect to $\mathbf{w}$ . This can be easily evaluate based on Eq (4.90)-(4.91). $$\frac{\partial}{\partial \mathbf{w...
2,459
7
7.19
medium
Verify that maximization of the approximate log marginal likelihood function $\simeq p(\mathbf{t}|\mathbf{w}^*)p(\mathbf{w}^*|\alpha)(2\pi)^{M/2}|\Sigma|^{1/2}.$ for the classification relevance vector machine leads to the result $\alpha_i^{\text{new}} = \frac{\gamma_i}{(w_i^{})^2}$ for re-estimation of the hyperparame...
We begin from Eq $\simeq p(\mathbf{t}|\mathbf{w}^*)p(\mathbf{w}^*|\alpha)(2\pi)^{M/2}|\Sigma|^{1/2}.$. $$p(\mathbf{t}|\alpha) = p(\mathbf{t}|\mathbf{w}^*)p(\mathbf{w}^*|\alpha)(2\pi)^{M/2}|\mathbf{\Sigma}|^{1/2}$$ $$= \left[\prod_{n=1}^{N} p(t_n|x_n, \mathbf{w})\right] \left[\prod_{i=1}^{M} \mathcal{N}(w_i|0, \alpha_...
4,137
7
7.2
easy
Show that, if the 1 on the right-hand side of the constraint $t_n\left(\mathbf{w}^{\mathrm{T}}\boldsymbol{\phi}(\mathbf{x}_n) + b\right) \geqslant 1, \qquad n = 1, \dots, N.$ is replaced by some arbitrary constant $\gamma > 0$ , the solution for the maximum margin hyperplane is unchanged.
Suppose we have find $\mathbf{w}_0$ and $b_0$ , which can let all points satisfy Eq $t_n\left(\mathbf{w}^{\mathrm{T}}\boldsymbol{\phi}(\mathbf{x}_n) + b\right) \geqslant 1, \qquad n = 1, \dots, N.$ and simultaneously minimize Eq $\underset{\mathbf{w},b}{\operatorname{arg\,max}} \left\{ \frac{1}{\|\mathbf{w}\|} \min_...
1,413
7
7.3
medium
$ Show that, irrespective of the dimensionality of the data space, a data set consisting of just two data points, one from each class, is sufficient to determine the location of the maximum-margin hyperplane.
Suppose we have $\mathbf{x}_1$ belongs to class one and we denote its target value $t_1 = 1$ , and similarly $\mathbf{x}_2$ belongs to class two and we denote its target value $t_2 = -1$ . Since we only have two points, they must have $t_i \cdot y(\mathbf{x}_i) = 1$ as shown in Fig. 7.1. Therefore, we have an e...
641
7
7.4
medium
Show that the value $\rho$ of the margin for the maximum-margin hyperplane is given by $$\frac{1}{\rho^2} = \sum_{n=1}^{N} a_n \tag{7.123}$$ where $\{a_n\}$ are given by maximizing $\widetilde{L}(\mathbf{a}) = \sum_{n=1}^{N} a_n - \frac{1}{2} \sum_{n=1}^{N} \sum_{m=1}^{N} a_n a_m t_n t_m k(\mathbf{x}_n, \mathbf{x...
Since we know that $$\rho = \frac{1}{||\mathbf{w}||}$$ Therefore, we have: $$\frac{1}{\rho^2} = ||\mathbf{w}||^2$$ In other words, we only need to prove that $$||\mathbf{w}||^2 = \sum_{n=1}^N a_n$$ When we find th optimal solution, the second term on the right hand side of Eq $L(\mathbf{w}, b, \mathbf{a}) = \frac...
1,020
7
7.5
medium
$ Show that the values of $\rho$ and $\{a_n\}$ in the previous exercise also satisfy $$\frac{1}{\rho^2} = 2\widetilde{L}(\mathbf{a}) \tag{7.124}$$ where $\widetilde{L}(\mathbf{a})$ is defined by $\widetilde{L}(\mathbf{a}) = \sum_{n=1}^{N} a_n - \frac{1}{2} \sum_{n=1}^{N} \sum_{m=1}^{N} a_n a_m t_n t_m k(\mathb...
We have already proved this problem in the previous one.
56
7
7.6
easy
Consider the logistic regression model with a target variable $t \in \{-1, 1\}$ . If we define $p(t = 1|y) = \sigma(y)$ where $y(\mathbf{x})$ is given by $y(\mathbf{x}) = \mathbf{w}^{\mathrm{T}} \boldsymbol{\phi}(\mathbf{x}) + b$, show that the negative log likelihood, with the addition of a quadratic regularizati...
If the target variable can only choose from $\{-1,1\}$ , and we know that $$p(t=1|y) = \sigma(y)$$ We can obtain: $$p(t = -1|y) = 1 - p(t = 1|y) = 1 - \sigma(y) = \sigma(-y)$$ Therefore, combining these two situations, we can derive: $$p(t|y) = \sigma(yt)$$ Consequently, we can obtain the negative log likelihood...
769
7
7.7
easy
Consider the Lagrangian $- \sum_{n=1}^{N} a_n (\epsilon + \xi_n + y_n - t_n) - \sum_{n=1}^{N} \hat{a}_n (\epsilon + \hat{\xi}_n - y_n + t_n). \quad$ for the regression support vector machine. By setting the derivatives of the Lagrangian with respect to $\mathbf{w}$ , b, $\xi_n$ , and $\hat{\xi}_n$ to zero and then ...
The derivatives are easy to obtain. Our main task is to derive Eq $-\epsilon \sum_{n=1}^{N} (a_n + \widehat{a}_n) + \sum_{n=1}^{N} (a_n - \widehat{a}_n)t_n$ using Eq (7.57)-(7.60). $$\begin{split} L &= C \sum_{n=1}^{N} (\xi_{n} + \widehat{\xi}_{n}) + \frac{1}{2} ||\mathbf{w}||^{2} - \sum_{n=1}^{N} (\mu_{n} \xi_{n} + ...
2,163
7
7.8
easy
For the regression support vector machine considered in Section 7.1.4, show that all training data points for which $\xi_n > 0$ will have $a_n = C$ , and similarly all points for which $\hat{\xi}_n > 0$ will have $\hat{a}_n = C$ .
This obviously follows from the KKT condition, described in Eq $(C - a_n)\xi_n = 0$ and $(C - \widehat{a}_n)\widehat{\xi}_n = 0.$.
146
7
7.9
easy
Verify the results $\mathbf{m} = \beta \mathbf{\Sigma} \mathbf{\Phi}^{\mathrm{T}} \mathbf{t}$ and $\Sigma = (\mathbf{A} + \beta \mathbf{\Phi}^{\mathrm{T}} \mathbf{\Phi})^{-1}$ for the mean and covariance of the posterior distribution over weights in the regression RVM.
The prior is given by Eq $p(\mathbf{w}|\boldsymbol{\alpha}) = \prod_{i=1}^{M} \mathcal{N}(w_i|0, \alpha_i^{-1})$. $$p(\mathbf{w}|\boldsymbol{\alpha}) = \prod_{i=1}^{M} \mathcal{N}(0, \alpha_i^{-1}) = \mathcal{N}(\mathbf{w}|\mathbf{0}, \mathbf{A}^{-1})$$ Where we have defined: $$\mathbf{A} = diag(\alpha_i)$$ The lik...
6,386
8
8.1
easy
By marginalizing out the variables in order, show that the representation $p(\mathbf{x}) = \prod_{k=1}^{K} p(x_k | \mathbf{pa}_k)$ for the joint distribution of a directed graph is correctly normalized, provided each of the conditional distributions is normalized.
We are required to prove: $$\int_{\mathbf{x}} p(\mathbf{x}) d\mathbf{x} = \int_{\mathbf{x}} \prod_{k=1}^{K} p(x_k | pa_k) d\mathbf{x} = 1$$ Here we adopt the same assumption as in the main text: No arrows lead from a higher numbered node to a According to Eq(8.5), we can write: $$\int_{\mathbf{x}} p(\mathbf{x}) d\ma...
1,413
8
8.10
easy
Consider the directed graph shown in Figure 8.54 in which none of the variables is observed. Show that $a \perp \!\!\!\perp b \mid \emptyset$ . Suppose we now observe the variable d. Show that in general $a \perp \!\!\!\!\perp b \mid d$ .
By examining Fig.8.54, we can obtain: $$p(a,b,c,d) = p(a)p(b)p(c|a,b)p(d|c)$$ Next we performing summation on both sides with respect to c and d, we can obtain: $$p(a,b) = p(a)p(b) \sum_{c} \sum_{d} p(c|a,b)p(d|c)$$ $$= p(a)p(b) \sum_{c} p(c|a,b) \left[ \sum_{d} p(d|c) \right]$$ $$= p(a)p(b) \sum_{c} p(c|a,b) \tim...
1,154
8
8.11
medium
Consider the example of the car fuel system shown in Figure 8.21, and suppose that instead of observing the state of the fuel gauge G directly, the gauge is seen by the driver D who reports to us the reading on the gauge. This report is either that the gauge shows full D=1 or that it shows empty D=0. Our driver is a bi...
This problem is quite straightforward, but it needs some patience. According to the Bayes' Theorem, we have: $$p(F=0|D=0) = \frac{p(D=0|F=0)p(F=0)}{p(D=0)} \tag{*}$$ We will calculate each of the term on the right hand side. Let's begin from the numerator p(D = 0). According to the sum rule, we have: $$p(D=0) = p(D=...
3,089
8
8.12
easy
Show that there are $2^{M(M-1)/2}$ distinct undirected graphs over a set of M distinct random variables. Draw the 8 possibilities for the case of M=3.
An intuitive solution is that we construct a matrix $\mathbf{A}$ with size of $M \times M$ . If there is a link from node i to node j, the entry on the i-th row and j-th column of matrix $\mathbf{A}$ , i.e., $A_{i,j}$ , will equal to 1. Otherwise, it will equal to 0. Since the graph is undirected, the matrix $\ma...
1,357
8
8.13
easy
Consider the use of iterated conditional modes (ICM) to minimize the energy function given by $E(\mathbf{x}, \mathbf{y}) = h \sum_{i} x_i - \beta \sum_{\{i,j\}} x_i x_j - \eta \sum_{i} x_i y_i$. Write down an expression for the difference in the values of the energy associated with the two states of a particular variab...
It is straightforward. Suppose that $x_k$ is the target variable whose state may be $\{-1.1\}$ while all other variables are fixed. According to Eq $E(\mathbf{x}, \mathbf{y}) = h \sum_{i} x_i - \beta \sum_{\{i,j\}} x_i x_j - \eta \sum_{i} x_i y_i$, we can obtain: $$E(\mathbf{x}, \mathbf{y}) = h \sum_{i \neq k} x_i...
1,162
8
8.14
easy
Consider a particular case of the energy function given by $E(\mathbf{x}, \mathbf{y}) = h \sum_{i} x_i - \beta \sum_{\{i,j\}} x_i x_j - \eta \sum_{i} x_i y_i$ in which the coefficients $\beta = h = 0$ . Show that the most probable configuration of the latent variables is given by $x_i = y_i$ for all i.
It is quite obvious. When h = 0, $\beta = 0$ , the energy function reduces to $$E(\mathbf{x}, \mathbf{y}) = -\eta \sum_{i} x_i y_i$$ If there exists some index j which satisfies $x_j \neq y_j$ , considering that $x_j, y_j \in \{-1.1\}$ , then $x_jy_j$ will equal to -1. By changing the sign of $x_j$ , we can alw...
636
8
8.15
medium
Show that the joint distribution $p(x_{n-1}, x_n)$ for two neighbouring nodes in the graph shown in Figure 8.38 is given by an expression of the form $p(x_{n-1}, x_n) = \frac{1}{Z} \mu_{\alpha}(x_{n-1}) \psi_{n-1,n}(x_{n-1}, x_n) \mu_{\beta}(x_n).$.
This problem can be solved by analogy to Eq $p(\mathbf{x}) = \frac{1}{Z} \psi_{1,2}(x_1, x_2) \psi_{2,3}(x_2, x_3) \cdots \psi_{N-1,N}(x_{N-1}, x_N).$ - Eq(8.54). We begin by noticing: $$p(x_{n-1},x_n) = \sum_{x_1} ... \sum_{x_{n-2}} \sum_{x_{n+1}} ... \sum_{x_N} p(\mathbf{x})$$ We also have: $$p(\mathbf{x}) = \frac...
939
8
8.16
medium
Consider the inference problem of evaluating $p(\mathbf{x}_n|\mathbf{x}_N)$ for the graph shown in Figure 8.38, for all nodes $n\in\{1,\ldots,N-1\}$ . Show that the message passing algorithm discussed in Section 8.4.1 can be used to solve this efficiently, and discuss which messages are modified and in what way.
We can simply obtain $p(x_N)$ using Eq(8.52) and Eq(8.54): $$p(x_N) = \frac{1}{Z} \mu_{\alpha}(x_N) \tag{*}$$ According to Bayes' Theorem, we have: $$p(x_n|x_N) = \frac{p(x_n, x_N)}{p(x_N)}$$ Therefore, now we only need to derive an expression for $p(x_n, x_N)$ , where n = 1, 2, ..., N - 1. We follow the same pr...
2,112
8
8.17
medium
Consider a graph of the form shown in Figure 8.38 having N=5 nodes, in which nodes $x_3$ and $x_5$ are observed. Use d-separation to show that $x_2 \perp \!\!\! \perp x_5 \mid x_3$ . Show that if the message passing algorithm of Section 8.4.1 is applied to the evaluation of $p(x_2|x_3,x_5)$ , the result will be i...
It is straightforward to see that for every path connecting node $x_2$ and $x_5$ in Fig.8.38, it must pass through node $x_3$ . Therefore, all paths are blocked and the conditional property holds. For more details, you should read section 8.3.1. According to Bayes' Theorem, we can obtain: $$p(x_2|x_3,x_5) = \frac...
1,232
8
8.18
medium
Show that a distribution represented by a directed tree can trivially be written as an equivalent distribution over the corresponding undirected tree. Also show that a distribution expressed as an undirected tree can, by suitable normalization of the clique potentials, be written as a directed tree. Calculate the numbe...
First, the distribution represented by a directed tree can be trivially be written as an equivalent distribution over an undirected tree by moralization. You can find more details in section 8.4.2. Alternatively, now we want to represent a distribution, which is given by a directed graph, via a directed graph. For exa...
2,330
8
8.2
easy
Show that the property of there being no directed cycles in a directed graph follows from the statement that there exists an ordered numbering of the nodes such that for each node there are no links going to a lower-numbered node. | T 11 00 7 | | 10 4 91 40 | | | | |--------...
This statement is obvious. Suppose that there exists an ordered numbering of the nodes such that for each node there are no links going to a lower-numbered node, and that there is a directed cycle in the graph: $$a_1 \rightarrow a_2 \rightarrow \dots \rightarrow a_N$$ To make it a real cycle, we also require $a_N \t...
473
8
8.20
easy
Consider the message passing protocol for the sum-product algorithm on a tree-structured factor graph in which messages are first propagated from the leaves to an arbitrarily chosen root node and then from the root node out to the leaves. Use proof by induction to show that the messages can be passed in such an order t...
We do the induction over the size of the tree and we grow the tree one node at a time while, at the same time, we update the message passing schedule. Note that we can build up any tree this way. For a single root node, the required condition holds trivially true, since there are no messages to be passed. We then assu...
1,180
8
8.23
medium
In Section 8.4.4, we showed that the marginal distribution $p(x_i)$ for a variable node $x_i$ in a factor graph is given by the product of the messages arriving at this node from neighbouring factor nodes in the form $= \prod_{s \in ne(x)} \mu_{f_s \to x}(x).$. Show that the marginal $p(x_i)$ can also be written ...
This follows from the fact that the message that a node, $x_i$ , will send to a factor $f_s$ , consists of the product of all other messages received by $x_i$ . From $= \prod_{s \in ne(x)} \mu_{f_s \to x}(x).$ and $= \prod_{l \in \text{ne}(x_m) \setminus f_s} \mu_{f_l \to x_m}(x_m)$, we have $$p(x_i) = \prod_{s \in...
513
8
8.28
medium
The concept of a *pending* message in the sum-product algorithm for a factor graph was defined in Section 8.4.7. Show that if the graph has one or more cycles, there will always be at least one pending message irrespective of how long the algorithm runs.
If a graph has one or more cycles, there exists at least one set of nodes and edges such that, starting from an arbitrary node in the set, we can visit all the nodes in the set and return to the starting node, without traversing any edge more than once. Consider one particular such cycle. When one of the nodes $n_1$ ...
734
8
8.29
medium
Show that if the sum-product algorithm is run on a factor graph with a tree structure (no loops), then after a finite number of messages have been sent, there will be no pending messages. ![](_page_442_Picture_0.jpeg) If we define a joint distribution over observed and latent variables, the corresponding distribution...
We show this by induction over the number of nodes in the tree-structured factor graph. First consider a graph with two nodes, in which case only two messages will be sent across the single edge, one in each direction. None of these messages will induce any pending messages and so the algorithm terminates. We then as...
1,004
8
8.3
medium
Consider three binary variables $a, b, c \in \{0, 1\}$ having the joint distribution given in Table 8.2. Show by direct evaluation that this distribution has the property that a and b are marginally dependent, so that $p(a,b) \neq p(a)p(b)$ , but that they become independent when conditioned on c, so that p(a,b|c) =...
Based on definition, we can obtain: $$p(a,b) = p(a,b,c=0) + p(a,b,c=1) = \begin{cases} 0.336, & \text{if } a = 0, b = 0\\ 0.264, & \text{if } a = 0, b = 1\\ 0.256, & \text{if } a = 1, b = 0\\ 0.144, & \text{if } a = 1, b = 1 \end{cases}$$ Similarly, we can obtain: $$p(a) = p(a, b = 0) + p(a, b = 1) =$$ $$\begin{cas...
2,153
8
8.4
hard
Evaluate the distributions p(a), p(b|c), and p(c|a) corresponding to the joint distribution given in Table 8.2. Hence show by direct evaluation that p(a,b,c) = p(a)p(c|a)p(b|c). Draw the corresponding directed graph.
This problem follows the previous one. We have already calculated p(a) and p(b|c), we rewrite it here. $$p(a) = p(a, b = 0) + p(a, b = 1) = \begin{cases} 0.6, & \text{if } a = 0 \\ 0.4, & \text{if } a = 1 \end{cases}$$ And $$p(b|c) = \frac{p(b,c)}{p(c)} = \begin{cases} 0.384/0.480 = 0.800, & \text{if } b = 0, c = 0 ...
903
8
8.5
easy
Draw a directed probabilistic graphical model corresponding to the relevance vector machine described by $p(\mathbf{t}|\mathbf{X}, \mathbf{w}, \beta) = \prod_{n=1}^{N} p(t_n|\mathbf{x}_n, \mathbf{w}, \beta^{-1}).$ and $p(\mathbf{w}|\boldsymbol{\alpha}) = \prod_{i=1}^{M} \mathcal{N}(w_i|0, \alpha_i^{-1})$.
It looks quite like Figure 8.6. The difference is that we introduce $\alpha_i$ for each $w_i$ , where i = 1, 2, ..., M. ![](_page_160_Picture_11.jpeg) Figure 1: probabilistic graphical model corresponding to the RVM described in $p(\mathbf{t}|\mathbf{X}, \mathbf{w}, \beta) = \prod_{n=1}^{N} p(t_n|\mathbf{x}_n, \ma...
493
8
8.7
medium
Using the recursion relations $\mathbb{E}[x_i] = \sum_{j \in \text{pa}_i} w_{ij} \mathbb{E}[x_j] + b_i.$ and (8.16), show that the mean and covariance of the joint distribution for the graph shown in Figure 8.14 are given by (8.17) and $\Sigma = \begin{pmatrix} v_1 & w_{21}v_1 & w_{32}w_{21}v_1 \\ w_{21}v_1 & v_2 + w_{...
Let's just follow the hint. We begin by calculating the mean $\mu$ . $$\mathbb{E}[x_1] = b_1$$ According to Eq $\mathbb{E}[x_i] = \sum_{j \in \text{pa}_i} w_{ij} \mathbb{E}[x_j] + b_i.$, we can obtain: $$\mathbb{E}[x_2] = \sum_{j \in pa_2} w_{2j} \mathbb{E}[x_j] + b_2 = w_{21}b_1 + b_2$$ Then we can obtain: $$\ma...
1,641
8
8.8
easy
Show that $a \perp \!\!\!\perp b, c \mid d$ implies $a \perp \!\!\!\!\perp b \mid d$ .
According to the definition, we can write: $$p(a,b,c|d) = p(a|d)p(b,c|d)$$ We marginalize both sides with respect to c, yielding: $$p(a,b|d) = p(a|d)p(b|d)$$ Just as required.
179
8
8.9
easy
Using the d-separation criterion, show that the conditional distribution for a node x in a directed graph, conditioned on all of the nodes in the Markov blanket, is independent of the remaining variables in the graph. Figure 8.54 Example of a graphical model used to explore the conditional independence properties of ...
This statement is easy to see but a little bit difficult to prove. We put Fig 8.26 here to give a better illustration. ![](_page_162_Picture_6.jpeg) Figure 2: Markov blanket of a node $x_i$ Markov blanket $\Phi$ of node $x_i$ is made up of three kinds of nodes:(i) the set $\Phi_1$ containing all the parents ...
2,219
9
9.1
easy
Consider the K-means algorithm discussed in Section 9.1. Show that as a consequence of there being a finite number of possible assignments for the set of discrete indicator variables $r_{nk}$ , and that for each such assignment there is a unique optimum for the $\{\mu_k\}$ , the K-means algorithm must converge after ...
For each $r_{nk}$ when n is fixed and k=1,2,...,K, only one of them equals 1 and others are all 0. Therefore, there are K possible choices. When N data are given, there are $K^N$ possible assignments for $\{r_{nk}; n=1,2,...,N; k=1,2,...,K\}$ . For each assignments, the optimal $\{\mu_k; k=1,2,...,K\}$ are well ...
915
9
9.10
medium
$ Consider a density model given by a mixture distribution $$p(\mathbf{x}) = \sum_{k=1}^{K} \pi_k p(\mathbf{x}|k)$$ $p(\mathbf{x}) = \sum_{k=1}^{K} \pi_k p(\mathbf{x}|k)$ and suppose that we partition the vector $\mathbf{x}$ into two parts so that $\mathbf{x} = (\mathbf{x}_a, \mathbf{x}_b)$ . Show that the condi...
According to the property of PDF, we know that: $$p(\mathbf{x}_b|\mathbf{x}_a) = \frac{p(\mathbf{x}_a, \mathbf{x}_b)}{p(\mathbf{x}_a)} = \frac{p(\mathbf{x})}{p(\mathbf{x}_a)} = \sum_{k=1}^K \frac{\pi_k}{p(\mathbf{x}_a)} \cdot p(\mathbf{x}|k)$$ Note that here $p(\mathbf{x}_a)$ can be viewed as a normalization consta...
553
9
9.11
easy
In Section 9.3.2, we obtained a relationship between K means and EM for Gaussian mixtures by considering a mixture model in which all components have covariance $\epsilon \mathbf{I}$ . Show that in the limit $\epsilon \to 0$ , maximizing the expected completedata log likelihood for this model, given by $\mathbb{E}_{\...
According to the problem description, the expectation, i.e., Eq(9.40), can now be written as: $$\mathbb{E}_{z}[\ln p] = \sum_{n=1}^{N} \sum_{k=1}^{K} \gamma(z_{nk}) \left\{ \ln \pi_{k} + \ln \mathcal{N}(\mathbf{x}_{n} | \boldsymbol{\mu}_{k}, \epsilon \mathbf{I}) \right\}$$ In the M-step, we are required to maximize t...
2,304
9
9.12
easy
Consider a mixture distribution of the form $$p(\mathbf{x}) = \sum_{k=1}^{K} \pi_k p(\mathbf{x}|k)$$ $p(\mathbf{x}) = \sum_{k=1}^{K} \pi_k p(\mathbf{x}|k)$ where the elements of $\mathbf{x}$ could be discrete or continuous or a combination of these. Denote the mean and covariance of $p(\mathbf{x}|k)$ by $\mu_k$...
First we calculate the mean $\mu_k$ : $$\mu_k = \int \mathbf{x} p(\mathbf{x}) d\mathbf{x}$$ $$= \int \mathbf{x} \sum_{k=1}^K \pi_k p(\mathbf{x}|k) d\mathbf{x}$$ $$= \sum_{k=1}^K \pi_k \int \mathbf{x} p(\mathbf{x}|k) d\mathbf{x}$$ $$= \sum_{k=1}^K \pi_k \mu_k$$ Then we deal with the covariance matrix. For an arbit...
1,926
9
9.13
medium
Using the re-estimation equations for the EM algorithm, show that a mixture of Bernoulli distributions, with its parameters set to values corresponding to a maximum of the likelihood function, has the property that $$\mathbb{E}[\mathbf{x}] = \frac{1}{N} \sum_{n=1}^{N} \mathbf{x}_n \equiv \overline{\mathbf{x}}.$$ $\ma...
First, let's make this problem more clear. In a mixture of Bernoulli distribution, whose complete-data log likelihood is given by Eq $\ln p(\mathbf{X}, \mathbf{Z} | \boldsymbol{\mu}, \boldsymbol{\pi}) = \sum_{n=1}^{N} \sum_{k=1}^{K} z_{nk} \left\{ \ln \pi_k + \sum_{i=1}^{D} \left[ x_{ni} \ln \mu_{ki} + (1 - x_{ni}) \ln...
3,576
9
9.14
easy
Consider the joint distribution of latent and observed variables for the Bernoulli distribution obtained by forming the product of $p(\mathbf{x}|\mathbf{z}, \boldsymbol{\mu})$ given by $p(\mathbf{x}|\mathbf{z}, \boldsymbol{\mu}) = \prod_{k=1}^{K} p(\mathbf{x}|\boldsymbol{\mu}_k)^{z_k}$ and $p(\mathbf{z}|\boldsymbol{...
Let's follow the hint. $$p(\mathbf{x}, \mathbf{z} | \boldsymbol{\mu}, \boldsymbol{\pi}) = p(\mathbf{x} | \mathbf{z}, \boldsymbol{\mu}) \cdot p(\mathbf{z} | \boldsymbol{\pi})$$ $$= \prod_{k=1}^{K} p(\mathbf{x} | \boldsymbol{\mu}_{k})^{z_{k}} \cdot \prod_{k=1}^{K} \pi_{k}^{z_{k}}$$ $$= \prod_{k=1}^{K} \left[ \pi_{k} p...
1,647
9
9.15
easy
Show that if we maximize the expected complete-data log likelihood function $\mathbb{E}_{\mathbf{Z}}[\ln p(\mathbf{X}, \mathbf{Z} | \boldsymbol{\mu}, \boldsymbol{\pi})] = \sum_{n=1}^{N} \sum_{k=1}^{K} \gamma(z_{nk}) \left\{ \ln \pi_{k} + \sum_{i=1}^{D} \left[ x_{ni} \ln \mu_{ki} + (1 - x_{ni}) \ln(1 - \mu_{ki}) \right]...
Noticing that $\pi_k$ doesn't depend on any $\mu_{ki}$ , we can omit the first term in the open brace when calculating the derivative of Eq $\mathbb{E}_{\mathbf{Z}}[\ln p(\mathbf{X}, \mathbf{Z} | \boldsymbol{\mu}, \boldsymbol{\pi})] = \sum_{n=1}^{N} \sum_{k=1}^{K} \gamma(z_{nk}) \left\{ \ln \pi_{k} + \sum_{i=1}^{D} ...
1,677
9
9.16
easy
Show that if we maximize the expected complete-data log likelihood function $\mathbb{E}_{\mathbf{Z}}[\ln p(\mathbf{X}, \mathbf{Z} | \boldsymbol{\mu}, \boldsymbol{\pi})] = \sum_{n=1}^{N} \sum_{k=1}^{K} \gamma(z_{nk}) \left\{ \ln \pi_{k} + \sum_{i=1}^{D} \left[ x_{ni} \ln \mu_{ki} + (1 - x_{ni}) \ln(1 - \mu_{ki}) \right]...
We follow the hint beginning by introducing a Lagrange multiplier: $$L = \mathbb{E}_{z}[\ln p(\mathbf{X}, \mathbf{Z} | \boldsymbol{\mu}, \boldsymbol{\pi})] + \lambda (\sum_{k=1}^{K} \pi_{k} - 1)$$ We calculate the derivative of L with respect to $\pi_k$ and then set it equal to 0: $$\frac{\partial L}{\partial \pi_...
1,423
9
9.17
easy
Show that as a consequence of the constraint $0 \le p(\mathbf{x}_n | \boldsymbol{\mu}_k) \le 1$ for the discrete variable $\mathbf{x}_n$ , the incomplete-data log likelihood function for a mixture of Bernoulli distributions is bounded above, and hence that there are no singularities for which the likelihood goes to ...
The incomplete-data log likelihood is given by Eq $\ln p(\mathbf{X}|\boldsymbol{\mu}, \boldsymbol{\pi}) = \sum_{n=1}^{N} \ln \left\{ \sum_{k=1}^{K} \pi_k p(\mathbf{x}_n | \boldsymbol{\mu}_k) \right\}.$, and $p(\mathbf{x}_n|\boldsymbol{\mu}_k)$ lies in the interval [0, 1], which can be easily verified by its definitio...
2,290
9
9.18
medium
Consider a Bernoulli mixture model as discussed in Section 9.3.3, together with a prior distribution $p(\mu_k|a_k,b_k)$ over each of the parameter vectors $\mu_k$ given by the beta distribution $(\mu|a,b) = \frac{\Gamma(a+b)}{\Gamma(a)\Gamma(b)} \mu^{a-1} (1-\mu)^{b-1}$, and a Dirichlet prior $p(\pi|\alpha)$ give...
In Prob.9.4, we have proved that if we want to maximize the posterior by EM, the only modification is that in the M-step, we need to maximize $Q'(\theta, \theta^{\text{old}}) = Q(\theta, \theta^{\text{old}}) + \ln p(\theta)$ . Here $Q(\theta, \theta^{\text{old}})$ has already been given by $\mathbb{E}_z[\ln p]$ , i...
5,170
9
9.19
medium
Consider a D-dimensional variable $\mathbf{x}$ each of whose components i is itself a multinomial variable of degree M so that $\mathbf{x}$ is a binary vector with components $x_{ij}$ where $i=1,\ldots,D$ and $j=1,\ldots,M$ , subject to the constraint that $\sum_j x_{ij}=1$ for all i. Suppose that the distri...
We first introduce a latent variable $\mathbf{z} = [z_1, z_2, ..., z_K]^T$ , only one of which equals 1 and others all 0. The conditional distribution of $\mathbf{x}$ is given by: $$p(\mathbf{x}|\mathbf{z}, \boldsymbol{\mu}) = \prod_{k=1}^{K} p(\mathbf{x}|\boldsymbol{\mu}_k)^{z_k}$$ The distribution of the latent ...
3,905
9
9.2
easy
Apply the Robbins-Monro sequential estimation procedure described in Section 2.3.5 to the problem of finding the roots of the regression function given by the derivatives of J in $J = \sum_{n=1}^{N} \sum_{k=1}^{K} r_{nk} \|\mathbf{x}_n - \boldsymbol{\mu}_k\|^2$ with respect to $\mu_k$ . Show that this leads to a stoch...
By analogy to Eq $J = \sum_{n=1}^{N} \sum_{k=1}^{K} r_{nk} \|\mathbf{x}_n - \boldsymbol{\mu}_k\|^2$, we can write down: $$J_N = J_{N-1} + \sum_{k=1}^{K} r_{Nk} ||\mathbf{x}_N - \boldsymbol{\mu}_k||^2$$ In the E-step, we still assign the N-th data $\mathbf{x}_N$ to the closet center and suppose that this closet cent...
1,795
9
9.20
easy
Show that maximization of the expected complete-data log likelihood function $\mathbb{E}\left[\ln p(\mathbf{t}, \mathbf{w} | \alpha, \beta)\right] = \frac{M}{2} \ln \left(\frac{\alpha}{2\pi}\right) - \frac{\alpha}{2} \mathbb{E}\left[\mathbf{w}^{\mathrm{T}} \mathbf{w}\right] + \frac{N}{2} \ln \left(\frac{\beta}{2\pi}\ri...
We first calculate the derivative of Eq $\mathbb{E}\left[\ln p(\mathbf{t}, \mathbf{w} | \alpha, \beta)\right] = \frac{M}{2} \ln \left(\frac{\alpha}{2\pi}\right) - \frac{\alpha}{2} \mathbb{E}\left[\mathbf{w}^{\mathrm{T}} \mathbf{w}\right] + \frac{N}{2} \ln \left(\frac{\beta}{2\pi}\right) - \frac{\beta}{2} \sum_{n=1}^{N}...
1,529
9
9.21
medium
Using the evidence framework of Section 3.5, derive the M-step re-estimation equations for the parameter $\beta$ in the Bayesian linear regression model, analogous to the result $\alpha = \frac{M}{\mathbb{E}\left[\mathbf{w}^{\mathrm{T}}\mathbf{w}\right]} = \frac{M}{\mathbf{m}_{N}^{\mathrm{T}}\mathbf{m}_{N} + \mathrm{...
We calculate the derivative of Eq $\mathbb{E}\left[\ln p(\mathbf{t}, \mathbf{w} | \alpha, \beta)\right] = \frac{M}{2} \ln \left(\frac{\alpha}{2\pi}\right) - \frac{\alpha}{2} \mathbb{E}\left[\mathbf{w}^{\mathrm{T}} \mathbf{w}\right] + \frac{N}{2} \ln \left(\frac{\beta}{2\pi}\right) - \frac{\beta}{2} \sum_{n=1}^{N} \math...
2,657
9
9.22
medium
By maximization of the expected complete-data log likelihood defined by $\mathbb{E}_{\mathbf{w}} \left[ \ln p(\mathbf{t}|\mathbf{X}, \mathbf{w}, \beta) p(\mathbf{w}|\alpha) \right]$, derive the M step equations $\alpha_i^{\text{new}} = \frac{1}{m_i^2 + \Sigma_{ii}}$ and $(\beta^{\text{new}})^{-1} = \frac{\|\mathbf{t} -...
First let's expand the complete-data log likelihood using Eq $p(\mathbf{t}|\mathbf{X}, \mathbf{w}, \beta) = \prod_{n=1}^{N} p(t_n|\mathbf{x}_n, \mathbf{w}, \beta^{-1}).$, Eq $p(\mathbf{w}|\boldsymbol{\alpha}) = \prod_{i=1}^{M} \mathcal{N}(w_i|0, \alpha_i^{-1})$ and Eq $p(t|\mathbf{x}, \mathbf{w}, \beta) = \mathcal{N}(t...
5,656
9
9.23
medium
In Section 7.2.1 we used direct maximization of the marginal likelihood to derive the re-estimation equations $\alpha_i^{\text{new}} = \frac{\gamma_i}{m_i^2}$ and $(\beta^{\text{new}})^{-1} = \frac{\|\mathbf{t} - \mathbf{\Phi}\mathbf{m}\|^2}{N - \sum_{i} \gamma_i}$ for finding values of the hyperparameters $\alpha$ a...
Some clarifications must be made here, Eq (7.87)-(7.88) only gives the same stationary points, i.e., the same $\alpha^*$ and $\beta^*$ , as those given by Eq (9.67)-(9.68). However, the hyper-parameters estimated at some specific iteration may not be the same by those two different methods. When convergence is reac...
1,253
9
9.24
easy
Verify the relation $\ln p(\mathbf{X}|\boldsymbol{\theta}) = \mathcal{L}(q,\boldsymbol{\theta}) + \mathrm{KL}(q||p)$ in which $\mathcal{L}(q, \theta)$ and $\mathrm{KL}(q||p)$ are defined by $\mathcal{L}(q, \boldsymbol{\theta}) = \sum_{\mathbf{Z}} q(\mathbf{Z}) \ln \left\{ \frac{p(\mathbf{X}, \mathbf{Z} | \boldsymbo...
We substitute Eq $\mathcal{L}(q, \boldsymbol{\theta}) = \sum_{\mathbf{Z}} q(\mathbf{Z}) \ln \left\{ \frac{p(\mathbf{X}, \mathbf{Z} | \boldsymbol{\theta})}{q(\mathbf{Z})} \right\}$ and Eq $KL(q||p) = -\sum_{\mathbf{Z}} q(\mathbf{Z}) \ln \left\{ \frac{p(\mathbf{Z}|\mathbf{X}, \boldsymbol{\theta})}{q(\mathbf{Z})} \right\}...
1,096
9
9.25
easy
Show that the lower bound $\mathcal{L}(q, \theta)$ given by $\mathcal{L}(q, \boldsymbol{\theta}) = \sum_{\mathbf{Z}} q(\mathbf{Z}) \ln \left\{ \frac{p(\mathbf{X}, \mathbf{Z} | \boldsymbol{\theta})}{q(\mathbf{Z})} \right\}$, with $q(\mathbf{Z}) = p(\mathbf{Z}|\mathbf{X}, \boldsymbol{\theta}^{(\text{old})})$ , has the...
We calculate the derivative of Eq $\mathcal{L}(q, \boldsymbol{\theta}) = \sum_{\mathbf{Z}} q(\mathbf{Z}) \ln \left\{ \frac{p(\mathbf{X}, \mathbf{Z} | \boldsymbol{\theta})}{q(\mathbf{Z})} \right\}$ with respect to $\theta$ , given $q(\mathbf{Z}) = p(\mathbf{Z}|\mathbf{X}, \boldsymbol{\theta}^{(\text{old})})$ : $$\beg...
6,224
9
9.26
easy
Consider the incremental form of the EM algorithm for a mixture of Gaussians, in which the responsibilities are recomputed only for a specific data point $\mathbf{x}_m$ . Starting from the M-step formulae $\boldsymbol{\mu}_k = \frac{1}{N_k} \sum_{n=1}^{N} \gamma(z_{nk}) \mathbf{x}_n$ and $N_k = \sum_{n=1}^{N} \gamma(z...
From Eq $N_k = \sum_{n=1}^{N} \gamma(z_{nk}).$, we have: $$N_k^{\mathrm{old}} = \sum_n \gamma^{\mathrm{old}}(z_{nk})$$ If now we just re-evaluate the responsibilities for one data point $\mathbf{x}_m$ , we can obtain: $$\begin{split} N_k^{\text{new}} &= \sum_{n \neq m} \gamma^{\text{old}}(z_{nk}) + \gamma^{\text{ne...
2,600
9
9.27
medium
Derive M-step formulae for updating the covariance matrices and mixing coefficients in a Gaussian mixture model when the responsibilities are updated incrementally, analogous to the result $\boldsymbol{\mu}_{k}^{\text{new}} = \boldsymbol{\mu}_{k}^{\text{old}} + \left(\frac{\gamma^{\text{new}}(z_{mk}) - \gamma^{\text{ol...
By analogy to the previous problem, we use Eq (9.24)-Eq(9.27), beginning by first deriving an update formula for mixing coefficients $\pi_k$ : $$\begin{split} \pi_k^{\text{new}} &= \frac{N_k^{\text{new}}}{N} = \frac{1}{N} \Big\{ N_k^{\text{old}} + \gamma^{\text{new}}(z_{mk}) - \gamma^{\text{old}}(z_{mk}) \Big\} \\ &=...
5,281
9
9.3
easy
Consider a Gaussian mixture model in which the marginal distribution $p(\mathbf{z})$ for the latent variable is given by $p(\mathbf{z}) = \prod_{k=1}^{K} \pi_k^{z_k}.$, and the conditional distribution $p(\mathbf{x}|\mathbf{z})$ for the observed variable is given by $p(\mathbf{x}|\mathbf{z}) = \prod_{k=1}^{K} \math...
We simply follow the hint. $$p(\mathbf{x}) = \sum_{\mathbf{z}} p(\mathbf{z}) p(\mathbf{x}|\mathbf{z})$$ $$= \sum_{\mathbf{z}} \prod_{k=1}^{K} \left[ (\pi_k \mathcal{N}(\mathbf{x}|\boldsymbol{\mu}_k, \boldsymbol{\Sigma}_k)) \right]^{z_k}$$ Note that we have used 1-of-K coding scheme for $\mathbf{z} = [z_1, z_2, ..., ...
985
9
9.4
easy
Suppose we wish to use the EM algorithm to maximize the posterior distribution over parameters $p(\theta|\mathbf{X})$ for a model containing latent variables, where $\mathbf{X}$ is the observed data set. Show that the E step remains the same as in the maximum likelihood case, whereas in the M step the quantity to b...
According to Bayes' Theorem, we can write: $$p(\boldsymbol{\theta}|\mathbf{X}) \propto p(\mathbf{X}|\boldsymbol{\theta})p(\boldsymbol{\theta})$$ Taking logarithm on both sides, we can write: $$\ln p(\boldsymbol{\theta}|\mathbf{X}) \propto \ln p(\mathbf{X}|\boldsymbol{\theta}) + \ln p(\boldsymbol{\theta})$$ Further ...
2,859
9
9.5
easy
- 9.5 (\*) Consider the directed graph for a Gaussian mixture model shown in Figure 9.6. By making use of the d-separation criterion discussed in Section 8.2, show that the posterior distribution of the latent variables factorizes with respect to the different data points so that $$p(\mathbf{Z}|\mathbf{X}, \boldsymbol...
Notice that the condition on $\mu$ , $\Sigma$ and $\pi$ can be omitted here, and we only need to prove $p(\mathbf{Z}|\mathbf{X})$ can be written as the product of $p(\mathbf{z}_n|\mathbf{x}_n)$ . Correspondingly, the small dots representing $\mu$ , $\Sigma$ and $\pi$ can also be omitted in Fig 9.6. Observi...
1,984
9
9.6
medium
- 9.6 (\*\*) Consider a special case of a Gaussian mixture model in which the covariance matrices Σ<sub>k</sub> of the components are all constrained to have a common value Σ. Derive the EM equations for maximizing the likelihood function under such a model.
By analogy to Eq $\Sigma_k = \frac{1}{N_k} \sum_{n=1}^N \gamma(z_{nk}) (\mathbf{x}_n - \boldsymbol{\mu}_k) (\mathbf{x}_n - \boldsymbol{\mu}_k)^{\mathrm{T}}$, we calculate the derivative of Eq $\ln p(\mathbf{X}|\boldsymbol{\pi}, \boldsymbol{\mu}, \boldsymbol{\Sigma}) = \sum_{n=1}^{N} \ln \left\{ \sum_{k=1}^{K} \pi_k \ma...
3,394
9
9.7
easy
Verify that maximization of the complete-data log likelihood $\ln p(\mathbf{X}, \mathbf{Z} | \boldsymbol{\mu}, \boldsymbol{\Sigma}, \boldsymbol{\pi}) = \sum_{n=1}^{N} \sum_{k=1}^{K} z_{nk} \left\{ \ln \pi_k + \ln \mathcal{N}(\mathbf{x}_n | \boldsymbol{\mu}_k, \boldsymbol{\Sigma}_k) \right\}.$ for a Gaussian mixture mod...
We begin by calculating the derivative of Eq $\ln p(\mathbf{X}, \mathbf{Z} | \boldsymbol{\mu}, \boldsymbol{\Sigma}, \boldsymbol{\pi}) = \sum_{n=1}^{N} \sum_{k=1}^{K} z_{nk} \left\{ \ln \pi_k + \ln \mathcal{N}(\mathbf{x}_n | \boldsymbol{\mu}_k, \boldsymbol{\Sigma}_k) \right\}.$ with respect to $\mu_k$ : $$\frac{\parti...
2,243
9
9.8
easy
Show that if we maximize $\mathbb{E}_{\mathbf{Z}}[\ln p(\mathbf{X}, \mathbf{Z} | \boldsymbol{\mu}, \boldsymbol{\Sigma}, \boldsymbol{\pi})] = \sum_{n=1}^{N} \sum_{k=1}^{K} \gamma(z_{nk}) \left\{ \ln \pi_k + \ln \mathcal{N}(\mathbf{x}_n | \boldsymbol{\mu}_k, \boldsymbol{\Sigma}_k) \right\}. \quad$ with respect to $\mu_k...
Since $\gamma(z_{nk})$ is fixed, the only dependency of Eq $\mathbb{E}_{\mathbf{Z}}[\ln p(\mathbf{X}, \mathbf{Z} | \boldsymbol{\mu}, \boldsymbol{\Sigma}, \boldsymbol{\pi})] = \sum_{n=1}^{N} \sum_{k=1}^{K} \gamma(z_{nk}) \left\{ \ln \pi_k + \ln \mathcal{N}(\mathbf{x}_n | \boldsymbol{\mu}_k, \boldsymbol{\Sigma}_k) \rig...
1,705
9
9.9
easy
Show that if we maximize $\mathbb{E}_{\mathbf{Z}}[\ln p(\mathbf{X}, \mathbf{Z} | \boldsymbol{\mu}, \boldsymbol{\Sigma}, \boldsymbol{\pi})] = \sum_{n=1}^{N} \sum_{k=1}^{K} \gamma(z_{nk}) \left\{ \ln \pi_k + \ln \mathcal{N}(\mathbf{x}_n | \boldsymbol{\mu}_k, \boldsymbol{\Sigma}_k) \right\}. \quad$ with respect to $\Sigm...
We first calculate the derivative of Eq $\mathbb{E}_{\mathbf{Z}}[\ln p(\mathbf{X}, \mathbf{Z} | \boldsymbol{\mu}, \boldsymbol{\Sigma}, \boldsymbol{\pi})] = \sum_{n=1}^{N} \sum_{k=1}^{K} \gamma(z_{nk}) \left\{ \ln \pi_k + \ln \mathcal{N}(\mathbf{x}_n | \boldsymbol{\mu}_k, \boldsymbol{\Sigma}_k) \right\}. \quad$ with res...
2,658
10
10.1
easy
Verify that the log marginal distribution of the observed data $\ln p(\mathbf{X})$ can be decomposed into two terms in the form $\ln p(\mathbf{X}) = \mathcal{L}(q) + \mathrm{KL}(q||p)$ where $\mathcal{L}(q)$ is given by $\mathcal{L}(q) = \int q(\mathbf{Z}) \ln \left\{ \frac{p(\mathbf{X}, \mathbf{Z})}{q(\mathbf{Z})}...
This problem is very similar to Prob.9.24. We substitute Eq $\mathcal{L}(q) = \int q(\mathbf{Z}) \ln \left\{ \frac{p(\mathbf{X}, \mathbf{Z})}{q(\mathbf{Z})} \right\} d\mathbf{Z}$ and Eq $KL(q||p) = -\int q(\mathbf{Z}) \ln \left\{ \frac{p(\mathbf{Z}|\mathbf{X})}{q(\mathbf{Z})} \right\} d\mathbf{Z}.$ into Eq (10.2): $$L...
977
10
10.10
easy
Derive the decomposition given by (10.34) that is used to find approximate posterior distributions over models using variational inference.
We substitute $\mathcal{L}_m$ , i.e., Eq $\mathcal{L}_{m} = \sum_{m} \sum_{\mathbf{Z}} q(\mathbf{Z}|m)q(m) \ln \left\{ \frac{p(\mathbf{Z}, \mathbf{X}, m)}{q(\mathbf{Z}|m)q(m)} \right\}.$, back into the right hand side of Eq (10.34), yielding: (right) $$= \sum_{m} \sum_{\mathbf{Z}} q(\mathbf{Z}|m) q(m) \left\{ \ln \f...
716
10
10.11
medium
By using a Lagrange multiplier to enforce the normalization constraint on the distribution q(m), show that the maximum of the lower bound $\mathcal{L}_{m} = \sum_{m} \sum_{\mathbf{Z}} q(\mathbf{Z}|m)q(m) \ln \left\{ \frac{p(\mathbf{Z}, \mathbf{X}, m)}{q(\mathbf{Z}|m)q(m)} \right\}.$ is given by (10.36).
We introduce the Lagrange Multiplier: $$\begin{split} L &= \sum_{m} \sum_{\mathbf{Z}} q(\mathbf{Z}|m) q(m) \ln \left\{ \frac{p(\mathbf{Z}, \mathbf{X}, m)}{q(\mathbf{Z}|m) q(m)} \right\} - \lambda \left\{ \sum_{m} q(m) - 1 \right\} \\ &= \sum_{m} \sum_{\mathbf{Z}} q(\mathbf{Z}|m) q(m) \ln \left\{ p(\mathbf{Z}, \mathbf{...
5,164
10
10.12
medium
Starting from the joint distribution $p(\mathbf{X}, \mathbf{Z}, \boldsymbol{\pi}, \boldsymbol{\mu}, \boldsymbol{\Lambda}) = p(\mathbf{X}|\mathbf{Z}, \boldsymbol{\mu}, \boldsymbol{\Lambda})p(\mathbf{Z}|\boldsymbol{\pi})p(\boldsymbol{\pi})p(\boldsymbol{\mu}|\boldsymbol{\Lambda})p(\boldsymbol{\Lambda})$, and applying the ...
The solution procedure has already been given in Eq $\ln q^{}(\mathbf{Z}) = \mathbb{E}_{\pi,\mu,\Lambda}[\ln p(\mathbf{X}, \mathbf{Z}, \pi, \mu, \Lambda)] + \text{const.}$ - $r_{nk} = \frac{\rho_{nk}}{\sum_{j=1}^{K} \rho_{nj}}.$, so here we explain it in more details, starting from Eq (10.43): $$\begin{split} & \ln q^...
5,396
10
10.13
medium
Starting from $+\sum_{k=1}^{K}\sum_{n=1}^{N}\mathbb{E}[z_{nk}]\ln\mathcal{N}\left(\mathbf{x}_{n}|\boldsymbol{\mu}_{k},\boldsymbol{\Lambda}_{k}^{-1}\right)+\text{const.}$, derive the result $q^{}(\boldsymbol{\mu}_{k}, \boldsymbol{\Lambda}_{k}) = \mathcal{N}\left(\boldsymbol{\mu}_{k} | \mathbf{m}_{k}, (\beta_{k} \boldsym...
Let's start from Eq $+\sum_{k=1}^{K}\sum_{n=1}^{N}\mathbb{E}[z_{nk}]\ln\mathcal{N}\left(\mathbf{x}_{n}|\boldsymbol{\mu}_{k},\boldsymbol{\Lambda}_{k}^{-1}\right)+\text{const.}$. $$\begin{split} \ln q^{}(\boldsymbol{\pi},\boldsymbol{\mu},\boldsymbol{\Lambda}) &\propto & \ln p(\boldsymbol{\pi}) + \sum_{k=1}^{K} \ln p(\bo...
11,294
10
10.14
medium
Using the distribution $q^{}(\boldsymbol{\mu}_{k}, \boldsymbol{\Lambda}_{k}) = \mathcal{N}\left(\boldsymbol{\mu}_{k} | \mathbf{m}_{k}, (\beta_{k} \boldsymbol{\Lambda}_{k})^{-1}\right) \, \mathcal{W}(\boldsymbol{\Lambda}_{k} | \mathbf{W}_{k}, \nu_{k})$, verify the result $= D\beta_{k}^{-1} + \nu_{k}(\mathbf{x}_{n}-\math...
Let's begin by definition. $$\begin{split} \mathbb{E}_{\boldsymbol{\mu}_{k},\boldsymbol{\Lambda}_{k}}[(\mathbf{x}_{n}-\boldsymbol{\mu}_{k})^{T}\boldsymbol{\Lambda}_{k}(\mathbf{x}_{n}-\boldsymbol{\mu}_{k})] &= \int \int (\mathbf{x}_{n}-\boldsymbol{\mu}_{k})^{T}\boldsymbol{\Lambda}_{k}(\mathbf{x}_{n}-\boldsymbol{\mu}_{k...
3,025
10
10.15
easy
Using the result (B.17), show that the expected value of the mixing coefficients in the variational mixture of Gaussians is given by (10.69).
There is a typo in Eq (10.69). The numerator should be $\alpha_0 + N_k$ . Let's substitute Eq $\alpha_k = \alpha_0 + N_k.$ into (B.17): $$\mathbb{E}[\pi_k] = \frac{\alpha_k}{\sum_k \alpha_k} = \frac{\alpha_0 + N_k}{K\alpha_0 + \sum_k N_k} = \frac{\alpha_0 + N_k}{K\alpha_0 + N}$$
290
10
10.16
medium
Verify the results $\mathbb{E}[\ln p(\mathbf{X}|\mathbf{Z}, \boldsymbol{\mu}, \boldsymbol{\Lambda})] = \frac{1}{2} \sum_{k=1}^{K} N_k \left\{ \ln \widetilde{\Lambda}_k - D\beta_k^{-1} - \nu_k \text{Tr}(\mathbf{S}_k \mathbf{W}_k) - \nu_k (\overline{\mathbf{x}}_k - \mathbf{m}_k)^{\mathrm{T}} \mathbf{W}_k (\overline{\math...
According to Eq $p(\mathbf{X}|\mathbf{Z}, \boldsymbol{\mu}, \boldsymbol{\Lambda}) = \prod_{n=1}^{N} \prod_{k=1}^{K} \mathcal{N} \left( \mathbf{x}_{n} | \boldsymbol{\mu}_{k}, \boldsymbol{\Lambda}_{k}^{-1} \right)^{z_{nk}}$, we can obtain: $$\mathbb{E}[\ln p(\mathbf{X}|\mathbf{Z}, \boldsymbol{\mu}, \boldsymbol{\Lambda})...
5,950
10
10.17
hard
Verify the results (10.73)–(10.77) for the remaining terms in the lower bound for the variational Gaussian mixture model given by $-\mathbb{E}[\ln q(\mathbf{Z})] - \mathbb{E}[\ln q(\boldsymbol{\pi})] - \mathbb{E}[\ln q(\boldsymbol{\mu}, \boldsymbol{\Lambda})]$.
According to Eq $p(\boldsymbol{\pi}) = \operatorname{Dir}(\boldsymbol{\pi}|\boldsymbol{\alpha}_0) = C(\boldsymbol{\alpha}_0) \prod_{k=1}^K \pi_k^{\alpha_0 - 1}$, we have: $$\mathbb{E}[\ln p(\pi)] = \ln C(\boldsymbol{\alpha}_0) + (\alpha_0 - 1) \sum_{k=1}^K \mathbb{E}[\ln \pi_k]$$ $$= \ln C(\boldsymbol{\alpha}_0) + (\a...
7,815
10
10.18
hard
In this exercise, we shall derive the variational re-estimation equations for the Gaussian mixture model by direct differentiation of the lower bound. To do this we assume that the variational distribution has the factorization defined by $q(\mathbf{Z}, \boldsymbol{\pi}, \boldsymbol{\mu}, \boldsymbol{\Lambda}) = q(\mat...
This problem is very complicated. Let's explain it in details. In section 10.2.1, we have obtained the update formula for all the coefficients using the general framework of variational inference. For more details you can see Prob.10.12 and Prob.10.13. Moreover, in the previous problem, we have shown that $\mathcal{L...
16,606
10
10.19
medium
$ Derive the result $p(\widehat{\mathbf{x}}|\mathbf{X}) = \frac{1}{\widehat{\alpha}} \sum_{k=1}^{K} \alpha_k \operatorname{St}(\widehat{\mathbf{x}}|\mathbf{m}_k, \mathbf{L}_k, \nu_k + 1 - D)$ for the predictive distribution in the variational treatment of the Bayesian mixture of Gaussians model.
Let's start from the definition, i.e., Eq $p(\widehat{\mathbf{x}}|\mathbf{X}) = \sum_{\widehat{\mathbf{z}}} \iiint p(\widehat{\mathbf{x}}|\widehat{\mathbf{z}}, \boldsymbol{\mu}, \boldsymbol{\Lambda}) p(\widehat{\mathbf{z}}|\boldsymbol{\pi}) p(\boldsymbol{\pi}, \boldsymbol{\mu}, \boldsymbol{\Lambda}|\mathbf{X}) \, \math...
7,684
10
10.2
easy
Use the properties $\mathbb{E}[z_1] = m_1$ and $\mathbb{E}[z_2] = m_2$ to solve the simultaneous equations $m_1 = \mu_1 - \Lambda_{11}^{-1} \Lambda_{12} \left( \mathbb{E}[z_2] - \mu_2 \right).$ and $m_2 = \mu_2 - \Lambda_{22}^{-1} \Lambda_{21} \left( \mathbb{E}[z_1] - \mu_1 \right).$, and hence show that, provided ...
To be more clear, we are required to solve: $$\begin{cases} m_1 = \mu_1 - \Lambda_{11}^{-1} \Lambda_{12} (m_2 - \mu_2) \\ m_2 = \mu_2 - \Lambda_{22}^{-1} \Lambda_{21} (m_1 - \mu_1) \end{cases}$$ To obtain the equation above, we need to substitute $\mathbb{E}[z_i] = m_i$ , where i = 1, 2, into Eq $m_1 = \mu_1 - \Lamb...
2,036
10
10.20
medium
- 10.20 (\*\*) This exercise explores the variational Bayes solution for the mixture of Gaussians model when the size N of the data set is large and shows that it reduces (as we would expect) to the maximum likelihood solution based on EM derived in Chapter 9. Note that results from Appendix B may be used to help answ...
Let's begin by dealing with $q^*(\Lambda_k)$ . When $N \to +\infty$ , we know that $N_k$ also approaches $+\infty$ based on Eq (10.51). Therefore, we know that $[\mathbf{W}_k]^{-1} \to N_k \mathbf{S}_k$ and $v_k \to N_k$ . Using (B.80), we conclude that $\mathbb{E}[\Lambda_k] = v_k \mathbf{W}_k \to \mathbf{S}...
4,988
10
10.21
easy
Show that the number of equivalent parameter settings due to interchange symmetries in a mixture model with K components is K!.
This can be verified directly. The total number of labeling equals assign K labels to K object. For the first label, we have K choice, K-1 choice for the second label, and so on. Therefore, the total number is given by K!.
222
10
10.22
medium
- 10.22 (\*\*) We have seen that each mode of the posterior distribution in a Gaussian mixture model is a member of a family of K! equivalent modes. Suppose that the result of running the variational inference algorithm is an approximate posterior distribution q that is localized in the neighbourhood of one of the mode...
Let's explain this problem in details. Suppose that now we have a mixture of Gaussian $p(\mathbf{Z}|\mathbf{X})$ , which are required to approximate. Moreover, it has K components and each of the modes is denoted as $\{\mu_1, \mu_2, ..., \mu_K\}$ . We use the variational inference, i.e., Eq $\mathcal{L}(q) = \int q(\...
5,702
10
10.23
medium
- 10.23 (\*\*) Consider a variational Gaussian mixture model in which there is no prior distribution over mixing coefficients $\{\pi_k\}$ . Instead, the mixing coefficients are treated as parameters, whose values are to be found by maximizing the variational lower bound on the log marginal likelihood. Show that maxim...
Let's go back to Eq $-\mathbb{E}[\ln q(\mathbf{Z})] - \mathbb{E}[\ln q(\boldsymbol{\pi})] - \mathbb{E}[\ln q(\boldsymbol{\mu}, \boldsymbol{\Lambda})]$. If now we treat $\pi_k$ as a parameter without a prior distribution, $\pi_k$ will only occur in the second term in Eq $-\mathbb{E}[\ln q(\mathbf{Z})] - \mathbb{E}[\...
1,718
10
10.24
medium
We have seen in Section 10.2 that the singularities arising in the maximum likelihood treatment of Gaussian mixture models do not arise in a Bayesian treatment. Discuss whether such singularities would arise if the Bayesian model were solved using maximum posterior (MAP) estimation.
Recall that the singularity in the maximum likelihood estimation of Gaussian mixture is caused by the determinant of the covariance matrix $\Sigma_k$ approaches 0, and thus the value in $\mathcal{N}(\mathbf{x}_n|\boldsymbol{\mu}_k,\boldsymbol{\Sigma}_k)$ will approach $+\infty$ . For more details, you can read Sec...
3,331
10
10.25
medium
- 10.25 (\*\*) The variational treatment of the Bayesian mixture of Gaussians, discussed in Section 10.2, made use of a factorized approximation $q(\mathbf{Z}) = \prod_{i=1}^{M} q_i(\mathbf{Z}_i).$ to the posterior distribution. As we saw in Figure 10.2, the factorized assumption causes the variance of the posterior di...
We qualitatively solve this problem. As the number of mixture components grows, so does the number of variables that may be correlated, but they are treated as independent under a variational approximation if Eq $q(\mathbf{Z}) = \prod_{i=1}^{M} q_i(\mathbf{Z}_i).$ has been used. Therefore, the proportion of probability...
1,016
10
10.26
hard
Extend the variational treatment of Bayesian linear regression to include a gamma hyperprior $\operatorname{Gam}(\beta|c_0,d_0)$ over $\beta$ and solve variationally, by assuming a factorized variational distribution of the form $q(\mathbf{w})q(\alpha)q(\beta)$ . Derive the variational update equations for the thr...
In this problem, we also need to consider the prior $p(\beta) = \text{Gam}(\beta|c_0, d_0)$ . To be more specific, based on the original joint distribution $p(\mathbf{t}, \mathbf{w}, \alpha)$ , i.e., Eq $p(\mathbf{t}, \mathbf{w}, \alpha) = p(\mathbf{t}|\mathbf{w})p(\mathbf{w}|\alpha)p(\alpha).$, the joint distributio...
7,754
10
10.27
medium
By making use of the formulae given in Appendix B show that the variational lower bound for the linear basis function regression model, defined by $-\mathbb{E}_{\alpha}[\ln q(\mathbf{w})]_{\mathbf{w}} - \mathbb{E}[\ln q(\alpha)].$, can be written in the form $-\mathbb{E}_{\alpha}[\ln q(\mathbf{w})]_{\mathbf{w}} - \math...
Let's deal with the terms in Eq(10.107) one by one. Noticing Eq $p(\mathbf{t}|\mathbf{w}) = \prod_{n=1}^{N} \mathcal{N}(t_n|\mathbf{w}^{\mathrm{T}}\boldsymbol{\phi}_n, \beta^{-1})$, we have: $$\begin{split} \mathbb{E}[\ln p(\mathbf{t}|\mathbf{w})]_{\mathbf{w}} &= -\frac{N}{2}\ln(2\pi) + \frac{N}{2}\ln\beta - \frac{\be...
3,772
10
10.29
easy
Show that the function $f(x) = \ln(x)$ is concave for $0 < x < \infty$ by computing its second derivative. Determine the form of the dual function $g(\lambda)$ defined by $g(\lambda) = \min_{x} \left\{ \lambda x - f(x) \right\}.$, and verify that minimization of $\lambda x g(\lambda)$ with respect to $\lambda$...
The second derivative of f(x) is given by: $$\frac{d^2}{dx^2}(\ln x) = \frac{d}{dx}(\frac{1}{x}) = -\frac{1}{x^2} < 0$$ Therefore, $f(x) = \ln x$ is concave for $0 < x < \infty$ . Based on definition, i.e., Eq $g(\lambda) = \min_{x} \left\{ \lambda x - f(x) \right\}.$, we can obtain: $$g(\lambda) = \min_{x} \{\la...
1,364
10
10.3
medium
- 10.3 (\*\*) Consider a factorized variational distribution $q(\mathbf{Z})$ of the form $q(\mathbf{Z}) = \prod_{i=1}^{M} q_i(\mathbf{Z}_i).$. By using the technique of Lagrange multipliers, verify that minimization of the Kullback-Leibler divergence $\mathrm{KL}(p\|q)$ with respect to one of the factors $q_i(\ma...
Let's start from the definition of KL divergence given in Eq $Q(\boldsymbol{\xi}, \boldsymbol{\xi}^{\text{old}}) = \sum_{n=1}^{N} \left\{ \ln \sigma(\xi_n) - \xi_n/2 - \lambda(\xi_n) (\boldsymbol{\phi}_n^{\text{T}} \mathbb{E}[\mathbf{w}\mathbf{w}^{\text{T}}] \boldsymbol{\phi}_n - \xi_n^2) \right\} + \text{const}$. $$\...
2,359
10
10.30
easy
By evaluating the second derivative, show that the log logistic function $f(x) = -\ln(1+e^{-x})$ is concave. Derive the variational upper bound $\sigma(x) \leqslant \exp(\lambda x - g(\lambda))$ directly by making a second order Taylor expansion of the log logistic function around a point $x=\xi$ . - 10.31 $( $ By...
We begin by calculating the first derivative: $$\frac{df(x)}{dx} = -\frac{-e^{-x}}{1 + e^{-x}} = \sigma(x) \cdot e^{-x}$$ Then we can obtain the second derivative: $$\frac{d^2f(x)}{dx^2} = \frac{-e^{-x}(1+e^{-x}) - e^{-x}(-e^{-x})}{(1+e^{-x})^2} = -[\sigma(x)]^2 \cdot e^{-x} < 0$$ Therefore, the log logistic functi...
1,489
10
10.33
easy
By differentiating the quantity $Q(\xi, \xi^{\text{old}})$ defined by (10.161) with respect to the variational parameter $\xi_n$ show that the update equation for $\xi_n$ for the Bayesian logistic regression model is given by $(\xi_n^{\text{new}})^2 = \boldsymbol{\phi}_n^{\text{T}} \mathbb{E}[\mathbf{w} \mathbf{w...
To prove Eq $(\xi_n^{\text{new}})^2 = \boldsymbol{\phi}_n^{\text{T}} \mathbb{E}[\mathbf{w} \mathbf{w}^{\text{T}}] \boldsymbol{\phi}_n = \boldsymbol{\phi}_n^{\text{T}} \left( \mathbf{S}_N + \mathbf{m}_N \mathbf{m}_N^{\text{T}} \right) \boldsymbol{\phi}_n$, we only need to prove Eq $0 = \lambda'(\xi_n)(\boldsymbol{\phi}_...
2,426
10
10.34
medium
- 10.34 (\*\*) In this exercise we derive re-estimation equations for the variational parameters $\xi$ in the Bayesian logistic regression model of Section 4.5 by direct maximization of the lower bound given by $\mathcal{L}(\boldsymbol{\xi}) = \frac{1}{2} \ln \frac{|\mathbf{S}_{N}|}{|\mathbf{S}_{0}|} - \frac{1}{2} \m...
First, we should clarify one thing and that is there is typos in Eq(10.164). It is not difficult to observe these error if we notice that for $q(\mathbf{w}) = \mathcal{N}(\mathbf{w}|\mathbf{m}_N, \mathbf{S}_N)$ , in its logarithm, i.e., $\ln q(\mathbf{w})$ , $\frac{1}{2} \ln |\mathbf{S}_N|$ should always have the sa...
5,188
10
10.35
medium
- 10.35 (\*\*) Derive the result $\mathcal{L}(\boldsymbol{\xi}) = \frac{1}{2} \ln \frac{|\mathbf{S}_{N}|}{|\mathbf{S}_{0}|} - \frac{1}{2} \mathbf{m}_{N}^{\mathrm{T}} \mathbf{S}_{N}^{-1} \mathbf{m}_{N} + \frac{1}{2} \mathbf{m}_{0}^{\mathrm{T}} \mathbf{S}_{0}^{-1} \mathbf{m}_{0} + \sum_{n=1}^{N} \left\{ \ln \sigma(\xi_{n...
There is a typo in Eq $\mathcal{L}(\boldsymbol{\xi}) = \frac{1}{2} \ln \frac{|\mathbf{S}_{N}|}{|\mathbf{S}_{0}|} - \frac{1}{2} \mathbf{m}_{N}^{\mathrm{T}} \mathbf{S}_{N}^{-1} \mathbf{m}_{N} + \frac{1}{2} \mathbf{m}_{0}^{\mathrm{T}} \mathbf{S}_{0}^{-1} \mathbf{m}_{0} + \sum_{n=1}^{N} \left\{ \ln \sigma(\xi_{n}) - \frac{...
4,295
10
10.36
medium
Consider the ADF approximation scheme discussed in Section 10.7, and show that inclusion of the factor $f_j(\theta)$ leads to an update of the model evidence of the form $$p_j(\mathcal{D}) \simeq p_{j-1}(\mathcal{D})Z_j$$ $p_j(\mathcal{D}) \simeq p_{j-1}(\mathcal{D})Z_j$ where $Z_j$ is the normalization constant...
Let's clarify this problem. What this problem wants us to prove is that suppose at beginning the joint distribution comprises a product of j-1 factors, i.e., $$p_{j-1}(D,\boldsymbol{\theta}) = \prod_{i=1}^{j-1} f_{j-1}(\boldsymbol{\theta})$$ and now the joint distribution comprises a product of *j* factors: $$p_j(D,...
1,766
10
10.37
easy
Consider the expectation propagation algorithm from Section 10.7, and suppose that one of the factors $f_0(\theta)$ in the definition $p(\mathcal{D}, \boldsymbol{\theta}) = \prod_{i} f_i(\boldsymbol{\theta}).$ has the same exponential family functional form as the approximating distribution $q(\theta)$ . Show that i...
Let's start from definition. q() will be initialized as $$q^{\text{init}}(\boldsymbol{\theta}) = \widetilde{f}_0(\boldsymbol{\theta}) \prod_{i \neq 0} \widetilde{f}_i(\boldsymbol{\theta}) = f_0(\boldsymbol{\theta}) \prod_{i \neq 0} \widetilde{f}_i(\boldsymbol{\theta})$$ Where we have used $\tilde{f}_0(\boldsymbol{\t...
1,849
10
10.38
hard
In this exercise and the next, we shall verify the results (10.214)–(10.224) for the expectation propagation algorithm applied to the clutter problem. Begin by using the division formula $q^{\setminus j}(\boldsymbol{\theta}) = \frac{q(\boldsymbol{\theta})}{\widetilde{f}_j(\boldsymbol{\theta})}.$ to derive the expressio...
Based on Eq $q^{\setminus j}(\boldsymbol{\theta}) = \frac{q(\boldsymbol{\theta})}{\widetilde{f}_j(\boldsymbol{\theta})}.$, $q(\boldsymbol{\theta}) = \mathcal{N}(\boldsymbol{\theta}|\mathbf{m}, v\mathbf{I}).$ and $\widetilde{f}_n(\boldsymbol{\theta}) = s_n \mathcal{N}(\boldsymbol{\theta}|\mathbf{m}_n, v_n \mathbf{I})$, ...
5,368
10
10.39
hard
$ Show that the mean and variance of $q^{\text{new}}(\theta)$ for EP applied to the clutter problem are given by $\mathbf{m} = \mathbf{m}^{n} + \rho_n \frac{v^{n}}{v^{n} + 1} (\mathbf{x}_n - \mathbf{m}^{n})$ and $v = v^{n} - \rho_n \frac{(v^{n})^2}{v^{n} + 1} + \rho_n (1 - \rho_n) \frac{(v^{n})^2 ||\mathbf{x}_n - \...
This problem is really complicated, but hint has already been given in Eq $\mathbb{E}[\boldsymbol{\theta}] = \mathbf{m}^{n} + v^{n} \nabla_{\mathbf{m}^{n}} \ln Z_{n}$ and (10.255). Notice that in Eq $\mathbb{E}[\boldsymbol{\theta}] = \mathbf{m}^{n} + v^{n} \nabla_{\mathbf{m}^{n}} \ln Z_{n}$, we have a quite complicated...
7,260
10
10.4
medium
Suppose that $p(\mathbf{x})$ is some fixed distribution and that we wish to approximate it using a Gaussian distribution $q(\mathbf{x}) = \mathcal{N}(\mathbf{x}|\boldsymbol{\mu}, \boldsymbol{\Sigma})$ . By writing down the form of the KL divergence $\mathrm{KL}(p\|q)$ for a Gaussian $q(\mathbf{x})$ and then diff...
We begin by writing down the KL divergence. $$\begin{aligned} \mathrm{KL}(p||q) &= -\int p(\mathbf{x}) \ln \left\{ \frac{q(\mathbf{x})}{p(\mathbf{x})} \right\} d\mathbf{x} \\ &= -\int p(\mathbf{x}) \ln q(\mathbf{x}) d\mathbf{x} + \mathrm{const} \\ &= -\int p(\mathbf{x}) \left[ -\frac{D}{2} \ln 2\pi - \frac{1}{2} \ln |...
3,594