adjusted fit_polynomial_bayes to correct dimensions, tranposes etc