LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Linear Fit using Bisquare method fails on certain data sets.

I noticed some behavior that I didn't understand, so I thought I'd post it.  I'm using Linear Fit.vi in LabVIEW 8.2 to calculate a slope and offset.  This VI has a method input that accepts an enum.  When I select the "Bisquare" method on some data sets I get error -20104 (Analysis:  Input parameters have at least one NaN element).  I think that if some data sets don't work with certain algorithms, this should be mentioned in the help.  This took quite some time to track down.
Here is an example of a data set that doesn't work with Linear Fit.
X: Y:
0.40336656 -4.04062388
0.20171238 -2.01997989
0.00072204 -0.00951483
-0.20006598 1.99094268
-0.39979904 3.99578023
0 Kudos
Message 1 of 7
(4,578 Views)
Hello SWalpole.
Can you please pass a small reference VI with the exact numbers in it (use "Make Current Values Default")?
Thanks, Guenter


0 Kudos
Message 2 of 7
(4,576 Views)
Example VI attached.  Note: This works fine on Mac OSX LabVIEW 8.2. (NaN not returned).  I see the problem on Windows XP LabVIEW 8.2.
0 Kudos
Message 3 of 7
(4,569 Views)

I can reproduce the problem.

Interestingly, it works fine if you increase the tolerance input a little bit, e.g. to 0.0004 (from the default 0.0001). It also starts working if you change the data a little bit.

Curious that it works on the Mac. There must be something pathalogical with this exact data set. Maybe it cause an unhandled division by zero in one of the iterations.

0 Kudos
Message 4 of 7
(4,560 Views)
Hello all,

This was reported to R&D (# 474GJUQ0) for further investigation. Thanks for the feedback!

Cheers.

| Michael K | Project Manager | LabVIEW R&D | National Instruments |

Message 5 of 7
(4,454 Views)


@Riconquistiamola wrote:
This was reported to R&D (# 474GJUQ0) for further investigation. Thanks for the feedback!

Small correction, but makes all the difference when searching - The actual CAR# is 474GJUQO (ends with letter O, not number 0).

Roy

Message 6 of 7
(4,352 Views)
Oops. Sorry guys. Thanks Roy.

| Michael K | Project Manager | LabVIEW R&D | National Instruments |

0 Kudos
Message 7 of 7
(4,323 Views)