# GSL: confidence intervals for nonlinear least squares parameters

I'm developing some application which uses nonlinear least squares fitting of experimental data to the calculated (from the ODE integration) curve.

The GSL library provides me an excellent Levenberg-Marquardt algorithm to do the task. I'm using unweighted regression because in general I don't know the variances of the individual experimental points. The fit works fine and parameters obtained are pretty good. But I completely stuck with the confidence interval for fit parameters. Documentation of this routines are not so good but here is one example. The small thing that the example deals with the weighted NLS.

I tried to apply it to my case. But chisq/dof value is too small and confidence intervals for fit parameters are too big:

Fit converged after 6 iterations
Least squares evaluations = 21
Reason for stopping: small gradient
Initial chi = 6,7385929246e-04
Final chi = 1,4967451110e-05
Degrees of freedom = 532
chi^2 / dof = 4,2109885852e-13 // very strange...


If using an example from book with weighted NLS all seems good... So I completely stuck on this problem. GSL have an built-in function for calculating chi value. How should I correct chi value obtained? How to get correct confidence intervals for fit parameters with set probability level?

Thank you!

## 1 Answer

Problem is actually solved. If I use weighted NLLS with standard deviations as weights then chi^2 / dof tends to 1 in case of good fit