What should be (computationally) the value of the intercept in this case? Nan seems right to me, but the slope /should/ be inf. Any comments? On Jun 11, 2012 12:59 AM, "John A. Crow" <[email protected]> wrote:
> What you're seeing is an artifact of how gsl_fit_linear() is doing its > calculations. Here's an executive summary of what's happening: > > o c1 -- the slope -- is being computed as m_dxdy / m_dx2 (see the code > for details). In your case, both numerator and denominator are zero; the 0 > / 0 results in NaN for c1. > > o c0 -- the intercept -- ought to be 50 in your case, but isn't. That's > because c1 is used in its calculation, so it ends up being NaN too. > > There are other ways one might compute the coefficients, but I suspect > this situation was felt to be pathological, so no special handling was > built in. Good luck, and a fair question too. > > > >
