# Objective function to determine posterior distribution.

I am trying to understand the effect of the density of a random variable $$a$$ which itself is a function of several other random variables $$a = f(x,y,z)$$, the following question is in accordance with the paper at reference here. The Bayesian model described in the paper is as follows,

\begin{align} \log(Y_t)|\Lambda,f_{t},\Psi \text{ }\sim & \text{ } \mathcal{N}_P(\log(\Lambda f_t),\Psi)\\ \lambda_{pk}\text{ } = & \text{ }\dfrac{\lambda_{pk}^\star}{\sum_{j=1}^{P}\lambda_{jk}^\star}\\ \lambda_{pk}^\star\text{ } \sim &\text{ } \text{Trunc}\mathcal{N}\left(\mu_{pk},\sigma_{pk}^2\right)\\ \log{(f_{kt})} \text{ } \sim & \text{ } \mathcal{N}\left(\gamma_k,\delta_k^2\right)\\ \psi_p \text{ } \sim & \text{ } \text{InvGamma}\left(\alpha_p,\beta_p\right) \end{align}

The likelihood function is of the form,

\begin{align} \log({Y_t}) | \Lambda,F,\Psi = & \prod_{t=1}^{T} \prod_{p=1}^{P} \left[\left(2\pi\psi_p^2\right)^{-1/2} \exp\left\{\dfrac{-1}{2\psi_p^2}\left(\log(y_{pt}) - \log\left(\sum_{k=1}^{K}\lambda_{pk}f_{kt}\right)\right)^2\right\}\right] \end{align}

Here, $$Y_t$$ is the data that we know, $$\Lambda,f_t,\Psi$$ are the priors that are obtained from some data,

I am trying to determine the objective function for the model minimizing/maximizing which, I'll be able to determine the distributions of $$\Lambda$$ and $$f_t$$.

With the basics of Bayes' theorem,

\begin{align} \mathcal{P}(\theta|d) &= \dfrac{\mathcal{P}(d|\theta)\mathcal{P}(\theta)}{\mathcal{P}(d)}\\ \mathcal{P}(\Lambda,f,\epsilon|\log Y) & = \dfrac{\mathcal{\mathcal{F}}(\log Y|\Lambda,f,\epsilon)\cdot\mathcal{P}(\Lambda,f,\epsilon)}{\mathcal{P}(Y)}\\ & \propto \mathcal{F}(\log Y|\Lambda,f,\epsilon)\mathcal{P}(\Lambda,f,\epsilon)\\ & \propto \mathcal{F}(\log Y|\Lambda,f,\epsilon)\cdot\mathcal{P}(\Lambda)\cdot\mathcal{P}(f)\cdot \mathcal{P}(\epsilon) \end{align}

Thus the posterior distribution that I propose is,

\begin{align} \mathcal{P}(\Lambda,f,\Psi|Y) \propto \underbrace{\left[\prod_{t=1}^{T}\prod_{p=1}^{P}\Theta\left(\log(y_{pt})| \log\left(\sum_{k=1}^{K}\left[\dfrac{f_{kt}\lambda^\star_{pk}}{\sum_{j=1}^{P}\lambda^\star_{jk}}\right]\right),\psi_{p}^2\right)\right]}_{\text{likelihood }\mathcal{L}(\log(Y_t)|\Lambda,f,\Psi) = \mathcal{F}_{\log (Y_t)}( \Lambda,f,\Psi)}\cdot \underbrace{\Xi(\lambda^\star_{pk}|\mu_{pk},\sigma_{pk}^2)}_{\lambda_{pk}^\star}\times \nonumber\\ \underbrace{\left[\dfrac{1}{\sqrt{2\pi\delta^2_k}}\exp\left\{-\dfrac{1}{2}\sum_{k=1}^{K}\dfrac{1}{\delta_k^2}\left(\log(f_{kt}) - \gamma_k\right)^2\right\}\right]}_{f_{kt}} \times \nonumber \\ \underbrace{\texttt{INVGAMMA}\left(\underbrace{\dfrac{T}{2}+\alpha_p}_{\text{shape parameter}}, \underbrace{\left[\dfrac{1}{2}\sum_{t=1}^{T}\left\{\log(y_{pt})-\log\left(\sum_{k=1}^{K}\lambda_{pk}f_{kt}\right)\right\}^2 + \beta_p \right]}_{\text{scale parameter}}\right)}_{\psi} \end{align}

I am not sure about the proposed solution, I tried looking up in several books, other answers on the stack exchange but was not able to understand.

Can someone please confirm if my attempt is correct and if not explain me the basic way to obtain the objective function which I can minimize/maximize using some non-linear optimization technique.

$$\log({Y_t}) = \log({\Lambda f_t}) + \log({\epsilon_t})$$
$$\log(\epsilon_t) \sim \mathcal{N}_p (\bar{\textbf{0}},\Psi)$$