|
From: | Ben Abbott |
Subject: | Re: Polyfit with scaling |
Date: | Mon, 4 Feb 2008 19:16:02 -0500 |
On Feb 4, 2008, at 4:21 PM, Dmitri A. Sergatskov wrote:
-- if std(x) == 0 then it means that all x are the same number (I would also argue that one may want to compare to eps rather than 0). In that case we cannot do any fits, so probaly should just exit with an error.
Moving the bar to something greater than zero will be a problem if the x values are small to begin with. Instead, I think we should make a comparison relative to the mean.
How about "if std(x) < mean(x)*eps" ?Regarding returning an error, if the algorithm functions without error, I'd prefer not to artificially introduce one. For example, if the order of the polynomial is zero, then constant values of x and/or y are not a problem.
Ben
[Prev in Thread] | Current Thread | [Next in Thread] |