**5.1 Joint maximum a posteriori (JMAP)**

Rewriting the expression of the joint posterior law:

$$p(\mathbf{f},\theta|\mathbf{g}) = \frac{p(\mathbf{g}|\mathbf{f},\theta\_1)p(\mathbf{f}|\theta\_2)p(\theta)}{p(\mathbf{g})} \propto p(\mathbf{g}|\mathbf{f},\theta\_1)p(\mathbf{f},\theta\_2)p(\theta) \tag{24}$$

where ∝ means equal up to a constant factor which is 1*=p*ð Þ*g :* In this case, we can try to optimize it with respect to its two arguments:

$$\left(\hat{f}, \hat{\theta}\right) = \underset{(f, \theta)}{\text{arg}\, \text{max}} \left\{ p\left(f, \hat{\theta} | \mathbf{g}\right) \right\} \tag{25}$$

This can be done, for example, by alternate optimization:

$$\begin{cases} \hat{\boldsymbol{f}}^{(k+1)} = \arg\max\_{f} \left\{ p\left(\boldsymbol{f}, \hat{\boldsymbol{\theta}}^{(k)} \| \mathbf{g}\right) \right\} \\ \hat{\boldsymbol{\theta}}^{(k+1)} = \arg\max\_{\boldsymbol{\theta}} \left\{ p\left(\boldsymbol{f}^{(k)}, \hat{\boldsymbol{\theta}} \| \mathbf{g}\right) \right\} \end{cases} \tag{26}$$

When the optimization algorithm is successful, we have the optimal values of ^*f* and ^*θ:* This method can be summarized as follows:

$$\begin{array}{c} \hline \multicolumn{3}{c}{p(f, \theta | g)} \longrightarrow \mathcal{I} \\ \text{Joint or alternate optimization} \longrightarrow \widetilde{\theta} \\ \end{array}$$
