Learning Bayesian stats for the first time; as an angle towards understanding MCMC I wondered: is it doing something that fundamentally can't be done another way, or is it just doing something far more efficiently than the alternatives?
By way of illustration, suppose we're trying to compute the probability of our parameters given the data $P(x,y,z|D)$ given a model that computes the opposite, $P(D|x,y,z)$. To calculate this directly with Bayes' theorem we need the denominator $P(D)$ as pointed out here. But could we compute that by integration, say as follows:
p_d = 0. for x in range(xmin,xmax,dx): for y in range(ymin,ymax,dy): for z in range(zmin,zmax,dz): p_d_given_x_y_z = cdf(model(x,y,z),d) p_d += p_d_given_x_y_z * dx * dy * dz
Would that work (albeit very inefficiently with higher numbers of variables) or is there something else that would cause this approach to fail?