I have one simple model and one more complex model (both are PDEs that describe displacement, when different kind of forces and thermal effects take place). From those, given some data, I calculate through PyMC the posterior distribution of a parameter (elasticity). Now I want to calculate the Bayes' factor, and I am supposed to calculate it by directly calculating the two evidences, but I cannot find any information about how to do this. I use a uniform prior for my parameter (=a parameter of my partial differential equations system), and a normal likelihood with mean that depends on the physical parameter of interest, and precision Uniformly distributed.
Is there a way to calculate the denominator (evidence) of Bayes' formula?
Edit: In general my probabilistic Model-1 looks like this: (parameter of interest: E)
$E = Uniform$ #Prior for Hyperparameter
$\tau = Normal$ #Prior for parameter
$Deterministic: u_1(E)$
$Observed: DataLikelihood: Normal(\mu=u_1(E), \tau=\tau, value=data)$
For Model-2, everything is the same, except for the deterministic u. i.e.
$Observed: DataLikelihood: Normal(\mu=u_2(E), \tau=\tau, value=data)$
EDIT:
I used kernel density estimators scipy.stats.kde.gaussian_kde on the posteriors of the two different models. Now that I have the densities, I can evaluate them at the data points (i.e. find the likelihood for each data point for each model). So by taking the mean of those likelihoods I approximate the marginal likelihoods, right? So by dividing them I get the Bayes' factor. Please correct me if there is a flaw in this procedure.
Edit: I'm starting to believe that this is just model fitness comparison and not pure evidence, since no information about the prior were being used. Any suggestions are more than welcome.