How is the acceptance probability of MH algorithm computed in practice?

Dear UQworld community,

I am currently reading the fundamentals of Bayesian inversion in order to fully understand what UQ[py]Lab has in its core. (I am using it to solve an inverse problem in hydrogeophysics).

I think I understood most of the basics and how bayesian inference naturally applies to inverse problems once we consider the parameters we want to estimate and the discrepancy between the model output and the data as random variables.

One point remains a little blurry for now : How is the acceptance probability of MH algorithm computed in practice ?

If we take the example of the basic random walk metropolis algorithm, the acceptance probability of a proposition is :

\alpha = min \left( 1,\frac{\pi (x^{(*)}|\mathcal{Y})}{\pi (x^{(t)}|\mathcal{Y})} \right)

My question is then : how is \pi (x^{(*)}|\mathcal{Y}) computed ?

Does it require to make an assumption on the discrepancy model such as the assumptions discussed in sections 1.2.2 and 1.2.3 of the bayesian inversion user manual ?

Then equation (1.18) holds if we take the example of the first assumption discussed in section 1.2.3 and as mentioned in the manual, Z vanishes out of the equation and we are left with :

\alpha = min \left( 1,\frac{\pi(x_{\mathcal{M}}^{(*)}) \pi(\sigma^{2(*)})\mathcal{L}(x_{\mathcal{M}}^{(*)},\sigma^{2(*)};\mathcal{Y})}{\pi(x_{\mathcal{M}}^{(t)}) \pi(\sigma^{2(t)})\mathcal{L}(x_{\mathcal{M}}^{(t)},\sigma^{2(t)};\mathcal{Y})} \right)

which we can compute as we know the value of each term of the second element in the min(.,.) function.

If I got this right, this is what is done in the discrepancy model definition step in uq[py]Lab.

Then another question arises: if we make such a hypothesis, then the equation (1.18) holds and we do have an analytical solution to the problem. Does the need to use MCMC algorithms stem from the fact that the integral defining Z is not tractable ? Or is there something else I might be missing ?

Best regards,
Guillaume Gru
PhD student at ITES, Strasbourg university, France