0

I have a data set that I intend to perform a Linear Least Square Optimization Third Order Polynomial fit using the linalg.net library. I have already installed the library from Nuget packages and my problem is using the method

polynomialfit(double[] x, 
    double[] y,
    int n, 
    int m,
    out int info, 
    out alglib.barycentricinterpolant, 
    out alglib.polynomialfitreport )
{}

to compute the polynomial fit because it seems the method has no overload for accepting two parameters, I happen to have only two parameters that I can feed into that for the polynomial fit, the double[] x and the double[] y. If anyone has experience on how to use alglib.net library to compute the problem at hand, your help is greatly appreciated.

Code

namespace LinearLeastSquares
{
    class Program
    {
        static void Main(string[] args)
        {
            //define the double array holding the values of x
            double[] x = new double[] {1,2,3,4,5,6 };
            //define the double array values holding the values of y
            double[] y = new double[] {-0.6,8.3,26,57,108,173 };
            //use the lin alg library to compute the
            //third order polynomial fit using the linear least squares
            //optimization problem
              //below lies my problem I just do not know what parameters to feed
             //into this method to get what i want, please help
            alglib.polynomialfit();
        }
    }

}
Zafor
  • 347
  • 2
  • 8
Son of Man
  • 1,213
  • 2
  • 7
  • 27

0 Answers0