From: Thomas M. <mat...@ph...> - 2011-05-06 21:10:45
|
I stand corrected about two things: 1. Gnuplot fits have always done the "right" thing and divided chisquare by degrees of freedom rather than measurements. Sorry, I haven't looked at what gets printed out in a while; I mostly use my own fitting programs these days. 2. Gnuplot will indeed refuse to fit a constant function to a single data point, or a line to two points. Yes, I hadn't done the experiment. Sorry. However I regard item 2 as a bug not a feature. It is perfectly well defined to ask the question, what is the chisquare for agreement between data and model, as a function of the parameter values, for these cases. There is a perfectly well defined answer to that question. There is a perfectly well defined point of minimum chisquare, which gives the best fit parameters. And the curvature of the chisquare curve or surface gives the fit errors. Nothing anomalous happens in the case where the number of data points equals the number of parameters. I agree that in those two particular cases, it's not necessary to "do a fit" to find the parameters; it can easily be done by hand. But mathematically the fit is still well-defined. I hope we can all agree that when fitting a line to two data points that have errors, the slope and intercept DO have errors. But calculating them by hand is not as trivial as calculating the slope and intercept by hand. The easiest way to do that in practice is to run a fitting program. The "raw" errors from the fit give the answer. But gnuplot refuses to do that. And the only reason I can see for the refusal is that the "rescaled" errors wouldn't make sense in that case (while the raw errors would make sense, and are useful). Let's say I have several equal-size data sets, described by the same model, with the same amount of random noise in each. If I fit each data set, the parameters will vary (within the errors), but they all have equal amounts of information, so they SHOULD all give the same fit errors. The "raw" fit errors WILL be the (neglecting effects from nonlinearities which are usually small). But the "rescaled" fit errors will vary randomly, depending on the chisquare of the fit. For a case where someone has worked hard to make the input errors meaningful, it's wrong for the parameter error output to depend on randomness in the data. Is it really so much to ask to have both raw and rescaled errors printed? Cheers Prof. Thomas Mattison Hennings 276 University of British Columbia Dept. of Physics and Astronomy 6224 Agricultural Road Vancouver BC V6T 1Z1 CANADA mat...@ph... phone: 604-822-9690 fax:604-822-5324 |