Bug 224202

Summary: fit linear plugin doesn't work when one or more points are not valid
Product: [Applications] kst Reporter: freebody.kst
Component: generalAssignee: kst
Status: RESOLVED NOT A BUG    
Severity: normal    
Priority: NOR    
Version: 1.x   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description freebody.kst 2010-01-25 19:29:21 UTC
Version:            (using Devel)
OS:                Linux
Installed from:    Compiled sources

PROBLEM:
fit linear plugin cannot produce fit result when one or more points are not valid
 
STEPS TO REPRODUCE:
1. Create 3 vectors X, Y, DelY from source file 'fittest.dat' located in graphics/kst/tests/data_files
Data --> New Vector...
configure: data starts at line 0 (by doing so, the first point of all 3 vectors will be invalid)
2. construct a curve
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
Create a new tab: “fitting demo” from the New... button in the Placement panel
Click OK to view the curve

3. curve fitting
Click anywhere on the plot 
Choose Fit --> Y in the appearing context menu
Choose Fit linear(v0.1) in the drop down list of Plugin Selection
Click OK 


 
RESULTS:
no fit result
 
EXPECTED RESULTS:
the plugin should ignore these invalid points. The 'fit linear weighted' plugin is able to ignore these invalid points and produce a result in this case.
Comment 1 Andrew Walker 2010-01-25 20:01:17 UTC
The linear fit, as expected, does not work for vectors with NaN values.

The weighted linear fit works only in that the NaN value's contriubution to the fit is driven to zero by the corrresponding NaN weight. Attempting a weighted linear fit with a NaN value and corresponding non-NaN weight will also "not work".

All of this is expected behaviour.