**5.5 Hierarchical priors**

One last extension is the case where *f*, itself depends on another hidden variable *z*. So that we have:

$$p(\mathbf{f}, \mathbf{z}, \boldsymbol{\theta} | \mathbf{g}) \propto p(\mathbf{g} | \mathbf{f}, \boldsymbol{\theta}\_1) p(\mathbf{f} | \mathbf{z}, \boldsymbol{\theta}\_2) p(\mathbf{z} | \boldsymbol{\theta}\_3) p(\boldsymbol{\theta}), \tag{38}$$

where *θ* ¼ ð Þ *θ*1, *θ*2, *θ*<sup>3</sup> *:* This situation is shown in **Figure 8**. Again, here, we may only be interested to *f* or (*f*, *z*) or to all the three variables (*f*, *z*, *θ*). Here too, we can either use methods of JMAP, marginalization or VBA to infer on these unknowns.
