This project has moved. For the latest updates, please go here.

Polynomial fitting in VB.NET

May 4, 2012 at 8:49 AM


I have been trying to implement the function, FitToPolynomial and had no success so far.

The approach works when trying to fit a curve of order 1.

My code is as follows:

dim data = new UncertainMeasurementSample()

dim result as FitResult






result = data.FitToPolynomial(2)


The error message is "operation is not valid due to the current state of the object"

Could you resolve my problem at the earliest? The feature of including the errors is a highlight of this method.

May 6, 2012 at 9:06 AM


My apologies. I found the method, FitToPolynomial to work when my values in the X-axis are not so large.

For example, my data is something like (2010.56,0.4568) and so on.

Hence, I made the value in the X-axis to look something like 0.56,1.4,2.3 ... by referring it to a particular value.

I then managed to compensate for the referenced value to get back to the original state.

However, my question now is, should it be possible to include such high values during fitting?