Version: 1.9.0_devel (using Devel) OS: Linux Installed from: Compiled sources PROBLEM: I tried to plot and fit the same data file using gnuplot and kst, the fit results are different. STEPS TO REPRODUCE: 1. create a txt file containing the following data 2 3.5 0.55 4 7.2 0.65 6 9.5 0.74 8 17.1 0.5 10 20.0 0.85 12 25.5 0.6 this is an example from the following web page http://phobos.physics.uiowa.edu/~rlm/mathcad/linear%20fitting%20example%20with%20outlier.htm 2. construct a curve in kst 1.Data --> New Curve... Choose X from the drop-down list for the X axis vector Choose Y from the drop-down list for the Y axis vector Choose DelY from the drop-down list for the +Y error bar Check Show points in the Appearance panel Click OK to view the curve 3. curve fitting in kst Click anywhere on the plot Choose Fit --> Y in the appearing context menu Choose Fit linear weighted(v0.1) in the drop down list of Plugin Selection Click OK 4. fit in gnuplot f(x)=a*x+b a=1 b=1 fit f(x) 'fit.dat' using 1:2:3 via a,b RESULTS: in kst, gradient:2.2310; intercept:-1.9601 EXPECTED RESULTS: according to the webpage, the result of the weighted linear fit is gradient:2.23; intercept:-1.528. gnuplot confirms the same result.
For all weighted fits the expected input are x, y, and weight. Typically the weight is 1/yError^2. When using a weighted-fit-plugin directly it should be apparent to the user that a weight (as opposed to error) is required. However, this is not the case when fitting by right-clicking on a curve (with y-errors already specified) and selecting a weighted fit. In that case the weights field is automatically set to the yError values and also disabled.
SVN commit 1080293 by arwalker: CCBUG:224225 remove automatic assignment of weight vector in interactive non-linear fit from curve M +5 -8 kstfitdialog_i.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1080293
To avoid potential confusion on the part of the user the documentation should be modified to stress that the weight is not the same as the error. Typically the weight is given as 1/yError^2.
The docbook and website have been updated.