Continuing on from this question and this question re BIC and its approximation to the Bayes factor with a unit information prior (Kass & Wasserman, 1995), I'm trying to quantify this relationship as a stepping stone into Bayesian stats. So far, my calculation of the BIC approximation of the Bayes factor (based upon my impression of Wagenmakers 2007) is linearly related to my Bayes factor that is calculated from my interpretation of the unit information prior using the INLA package in R. Good start! However, my BIC Bayes factor is ~ 3 times smaller than the Bayes factor calculated with INLA and I'm not sure why.
The prior I've used in the "inla" function is N(0, 1/(variance * n)) and this seems to me the likely place where I'm out. I'm not sure how I got the multiply by n in the formula, but it appears to work... roughly. Kass and Wasserman have N(0, variance / n) which when converted to precision would be N(0, n / variance), but this gives me a less good relationship.
Help based on other Bayesian packages is also welcome.
*Deleted code, see below answer instead*
So I'm pretty sure I've figured out the one sample case. I would still appreciate help for the two sample case and the regression case (which I'll start working on now).