I start to study MCMC and Bayesian inference. Bayesian inference method usually needs to estimate posterior probability,like below:
$P(\theta|y)=P(\theta)*P(y|\theta)/NormalizationFactor$
$y={y_1,y_2,y_3,...y_N}$ is already known random sequence,and $p(y|\theta)$ and $p(\theta)$ are also known.
To my knowledge, MCMC is mainly used to generate samples from some specific complex distribution.
I'm confused about MCMC usage in this scenario, so my question to ask is how to use MCMC to estimate the $P(\theta|y)$ based on the above sequence $y$?
Moreover, because $\theta$ is a random variable, different $\theta$ conresponds to different $P(\theta|y)$, how to select optimal $\theta$ as current best estimate?