MINERAL NEWS
Contains news and
information of mineral producing countries. Daily global updates.
more...

UNDERSTANDING MINING
Mineral concepts were included to assist our math-oriented readers
explain minerals as elements produced in a natural form on earth.
more...

MINERAL FORUM
This forum encompass mining issues. It's easy. You write, you comment and we all enjoy!
more...

In order to test the Polynomial Fit Method as defined above, a new TestPolynomialFit()
static method has been added and executed. Supporting code and methods are not shown.

static void TestPolynomialFit();
{
ListBox1.Items.Clear();
double[] xarray = new double[] { t1, t2, t3, t4, t5, t6 };
double[] yarray = new double[] { t7, t8, t9, t10, t11, t12 };
{
double sigma = 0.0;
VectorR results = CurveFitting.PolynomialFit(xarray, yarray, m, out sigma);
ListBox1.Items.Add("\nOrder of polynomial m = " + m.ToString() + ",
Standard deviation = " + sigma.ToString());
ListBox1.Items.Add("Coefficients = " + results.ToString());
ListBox1.Items.Add(" ");
}
}

As a sample we provide the input data points using two double arrays x-array and y-array. We used the
same input function as in ("Straight Line Fit Method"). Running this
example generates results shown above. Note the order of the polynomial is given by simple iteration from 1 to 3.

From these results we see that the quadratic polynomial with m = 2:

f(x) = 1.2857 + 1.6x - 0.2857x^{2}

produces the smallest deviation, which can be considered as the best fit to the data.

The user can manipulate all values and try variations on the arrays themselves by
specifying new estimate values.