4

I use least squares regression of data with measured errors in both x and y and use the reduced chi-square (mean square weighted deviation: mswd) as a measure of the fit. However, some of the assumptions for using reduced chi-squared likely are not met and I'd like to move towards an mcmc/bayesian approach using PyMC. I've searched the web but can't exactly seem to find what I'm looking for, most examples assume the data uncertainty is Gaussian, but here I have measured uncertainties in x and y.

It seems like I should be able to do this in PyMC2 or PyMC3 with glm.

Here's a typical dataset plotted up:

enter image description here

And the data to go with it:

# Data in Columns, Observations in Rows
# Measured values x versus y, 
# Measured standard deviations sx and sy.

       x          sx         y           sy
0.3779397 0.001889699 0.5130084 2.748546e-05
0.3659092 0.001829546 0.5129624 2.721838e-05
0.3430834 0.001715417 0.5129023 2.720073e-05
0.4121606 0.002060803 0.5130235 2.755231e-05
0.3075815 0.001537908 0.5128739 2.776967e-05
0.3794471 0.001897236 0.5129950 2.842079e-05
0.1447394 0.000723697 0.5126784 2.816200e-05

I'm looking for any examples and references where people have done this. Thanks in advance.

srmulcahy
  • 359
  • 1
  • 3
  • 18
  • What about [this](http://twiecki.github.io/blog/2013/08/27/bayesian-glms-2/) example? – aloctavodia Dec 02 '14 at 20:19
  • Take a look at the answer to my question, there you have errors in both X and Y : http://stackoverflow.com/questions/24804298/fit-a-non-linear-function-to-data-observations-with-pymcmc-pymc – Magnus Persson Feb 05 '15 at 09:21

0 Answers0