From: Charles R H. <cha...@gm...> - 2006-10-13 20:58:41
|
On 10/13/06, A. M. Archibald <per...@gm...> wrote: > > On 12/10/06, Charles R Harris <cha...@gm...> wrote: > > Hi all, > > > > I note that polyfit looks like it should work for single and double, > real > > and complex, polynomials. On the otherhand, the default rcond needs to > > depend on the underlying precision. On the other, other hand, all the > svd > > computations are done with dgelsd or zgelsd, i.e., double precision. > Even so > > problems can arise from inherent errors of the input data if it is > single > > precision to start with. I also think the final degree of the fit should > be > > available somewhere if wanted, as it is an indication of what is going > on. > > Sooo, any suggestions as to what to do? My initial impulse would be to > set > > rcond=1e-6 for single, 1e-14 for double, make rcond a keyword, and kick > the > > can down the road on returning the actual degree of the fit. > > I'd also be inclined to output a warning (which the user can ignore, > read or trap as necessary) if the condition number is too bad or they > supplied an rcond that is too small for the precision of their data. That sounds good, but how to do it? Should I raise an exception? I would also have to modify lstsq so it returns the degree of the fit which would mess up the current interface. Chuck |