ODR residual variance and reduced chi^2 - do the beta uncertainties represent confidence intervals? I'm looking for the relationship between residual variance of an Orthogonal Distance Regression (ODR) fit (as implemented in scipy.odr) and reduced $\chi^2$.
I'm getting similar values for some of my test cases, which I attribute to the uncertainty in the x values which I do not take into account - I saw one answer validating this is indeed $\chi^2$.
Finally, how is the standard beta deviation of the parameters related to their confidence intervals, in terms of percentiles? That is, by how much is the residual variance ($\chi^2$?) allowed to vary when computing this value (sd_beta), and what is the associated interval?
My data is of the form x,dx,y,dy, with a simple linear fit being done. The answers I find are either too simple (people just looking for what to quote as an uncertainty) or too complex (the mathematics involved in the general procedure). I'm looking for something in between, relating to the specific algorithm.
 A: Since this site is quite sleepy, here is what I found. I am by no means an expert, so please amend my/suggest improvements to/add your own solution.
The scipy.odr doc is very limited unfortunately, but digging around I finally found the original odrpack guide by Paul T. Boggs, Richard H. Byrd, Janet E. Rogers and Robert B. Schnabel from NIST, NISTIR 4834, 1992.
Page 74, on the covariance matrix explains how to compute the confidence interval from the parameter standard deviation (sd_beta in your scipy ODR result, returned from run.). This is the diagonal covariance matrix element scaled which in itself is scaled by the residual variance (which is almost $\chi^2/DOF$ from what I can tell, see link in question as well), or at least it should be - as of posting this the covariance matrix in scipy.odr is not scaled by the residual variance, which is a bug. sd_beta is good though.
Take this, and multiply by the the appropriate student's t test for the confidence interval you're looking for and degrees of freedom. The link is to Wikipedia which as far as I can tell has a good table, though more robust and extensive sources are easily found - These can be calculated in advance, or taken straight from the table.
The short version:

*

*Say r=odr.ODR(data,model,beta0=(initial params)).run()


*Lookup the appropriate student's T value for the confidence interval you want and given your DOF (for a normal system this is the amount of data points - amount of (non fixed) parameters in your model, stored in r.iwork[-15] see page 94 IWORK(IDFI)) just Google student's T table, or use https://en.wikipedia.org/wiki/Student%27s_t-distribution#Table_of_selected_values. EDIT: scipy has something built in, see below.


*Say you want a double sided 99% confidence interval for two degrees of freedom, you would get t=9.925.


*Confidence interval for parameter i is given by:
r.beta[i]+-t*r.sd_beta[i]
So the confidence interval is not found directly by varying the residual variance, but linked to it through the parameter std.
Getting t-value
I should have guessed scipy has something so trivial built in:
>>>from scipy.stats import t as studentt
>>>studentt.interval(0.95,9)
(-2.2621571627409915, 2.2621571627409915)

would give the t value appropriate for 95% confidence region (double sided) with 9 DOF - 2.262.
