tag:blogger.com,1999:blog-1369432396898204613.post2510817695440576455..comments2023-01-15T10:39:00.543+01:00Comments on Lighthouse in the Sky: Curve Fitting part 4: Validating Bayesian CodeUnknownnoreply@blogger.comBlogger8125tag:blogger.com,1999:blog-1369432396898204613.post-88090201957095871062009-12-22T19:18:17.557+01:002009-12-22T19:18:17.557+01:00My open source project Python Equations uses Pytho...My open source project Python Equations uses Python, Scipy and Numpy - and already has ODR coded for use. It may be of some use to you.<br /><br />http://code.google.com/p/pythonequations/downloads/list<br /><br /> James Phillips<br /> http://zunzun.com<br /> zunzun@zunzun.comJames Philipshttps://www.blogger.com/profile/00004436246444548440noreply@blogger.comtag:blogger.com,1999:blog-1369432396898204613.post-41115630509527409602009-11-29T00:31:26.235+01:002009-11-29T00:31:26.235+01:00I thought ordinary least squares was for fixed x, ...I thought ordinary least squares was for fixed x, but then read the wikipedia article and it claims that a normally distributed predictor leads to the same result as for a fixed one (I don't remember that from any of my math classes). <br /><br />Your reply got me to look further into the docs for OLS and I found <a href="http://docs.scipy.org/doc/scipy/reference/odr.html" rel="nofollow">scipy.odr</a> which I think will do what I want.<br /><br />Thanks.Joshua Stultshttps://www.blogger.com/profile/03506970399027046387noreply@blogger.comtag:blogger.com,1999:blog-1369432396898204613.post-37732917673625220952009-11-28T23:58:58.160+01:002009-11-28T23:58:58.160+01:00@jstults: If I understand you correctly, you'r...@jstults: If I understand you correctly, you're looking to fit a model to data where both independent and dependent variables are uncertain. If you're fitting a linear model, I think OLS in scipy will do that for you. If you want some more complicated nonlinear model, I don't know of any general algorithm short of treating the errors on the independent variables as additional parameters to fit for.Anonymoushttps://www.blogger.com/profile/00764119699293212898noreply@blogger.comtag:blogger.com,1999:blog-1369432396898204613.post-19751931459598110242009-11-28T19:15:53.300+01:002009-11-28T19:15:53.300+01:00Hi Anne,
You seem to be really familiar with scip...Hi Anne,<br /><br />You seem to be really familiar with scipy, I wonder if you could recommend a tool for fitting a regression with uncertain predictor and response? I think you could define a model and use pymc (which I've never used, only browsed the docs), but I thought maybe it's a common enough problem that there's already something coded up in one of scipy's packages? Thanks for any tips.Joshua Stultshttps://www.blogger.com/profile/03506970399027046387noreply@blogger.comtag:blogger.com,1999:blog-1369432396898204613.post-2486634667486195612009-11-17T01:58:00.360+01:002009-11-17T01:58:00.360+01:00@jstults: To be honest I haven't run it a hund...@jstults: To be honest I haven't run it a hundred times. But I know that the hypothesis testing one will probably not fail that often - it's only testing a lower limit, and that lower limit is not very strict. The credible regions test should probably fail that often, though.<br /><br />I usually use two decorators to work around this issue: one called "seed" that seeds the random number generator before running the test, and a second called double_check that reruns the test (once) if it fails.Anonymoushttps://www.blogger.com/profile/00764119699293212898noreply@blogger.comtag:blogger.com,1999:blog-1369432396898204613.post-80422984916555212422009-11-17T01:45:57.731+01:002009-11-17T01:45:57.731+01:00So does your unit test fail 1% of the time?So does your unit test fail 1% of the time?Joshua Stultshttps://www.blogger.com/profile/03506970399027046387noreply@blogger.comtag:blogger.com,1999:blog-1369432396898204613.post-33297509216187445992009-11-13T08:54:44.544+01:002009-11-13T08:54:44.544+01:00That is an interesting article. I avoid the proble...That is an interesting article. I avoid the problems they're talking about by sticking to a two-dimensional problem and using ultra-simple numerical integration, but that's only possible because I use such a simple toy problem. But their procedure looks almost perfect - you could plug it right in to a pymc model, possibly even simply using the results of a simulation you'd already run.Anonymoushttps://www.blogger.com/profile/00764119699293212898noreply@blogger.comtag:blogger.com,1999:blog-1369432396898204613.post-15440998009986563232009-11-12T18:53:32.148+01:002009-11-12T18:53:32.148+01:00Just saw this on arxiv (0911.2150) and thought you...Just saw this on arxiv (0911.2150) and thought you might be interested given you work (which I read about in your posts to the scipy list).<br /><br />http://arxiv.org/abs/0911.2150robanhttps://www.blogger.com/profile/08785488915400359918noreply@blogger.com