Implement the formula for Bayesian curve fitting in python