LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

GoodnessOfFit misbehaving

Hi,

 

I found an issue with the Advanced Analysis Library function GoodnessOfFit, which I use to calculate R^2.

 

For a given data set it returns SSE = NaN, R^2 = NaN, and RMSE = NaN, while the return status is NoAnalError.

 

I can not see any mathematical sitation which might yield NaN for SSE, the summation of square error....

 

Moreover, if problems arise with the involved calculations, I would expect the function to return an error condition.

 

Hence I suppose it might be a bug...

 

The occurence of this 'situation' depends on the data set.

 

Wolfgang

0 Kudos
Message 1 of 3
(2,943 Views)

Hi Wolfgang,

 

could you post an example so I can see what input values you are using?

 

Regards,

Andreas Stark
LabVIEW Lead @ Rocket Factory Augsburg
0 Kudos
Message 2 of 3
(2,902 Views)

Hi Andreas,

 

thanks to the assistance of Luis who pointed out how to save variable values to a file I can now provide one data set showing 'unexpected' behavior.

This is not the original problem as outlined above but it could be related.

 

OK, after fitting a data set I am calling

 

GoodnessOfFit ( y_selected, y_fit_1, weights, fit_points, ( fit_points - coefficients_1 ), &sse, &r_square, &rmse );

 

and receive a r_square value that is negative... For me this is unexpected if I believe in the name square....

 

The return status is 'No Analysis Error' (0).

 

I am attaching the data that shows this result, with fit_points = 24064, coefficients_1 = 3 and the result r_square = -8.719...e-1

 

Wolfgang

Download All
0 Kudos
Message 3 of 3
(2,831 Views)