我有一个数据集,我打算使用 linalg.net 库执行线性最小二乘优化三阶多项式拟合。我已经从 Nuget 包安装了库,我的问题是使用该方法
polynomialfit(double[] x,
double[] y,
int n,
int m,
out int info,
out alglib.barycentricinterpolant,
out alglib.polynomialfitreport )
{}
要计算多项式拟合,因为该方法似乎没有接受两个参数的重载,我碰巧只有两个参数可以输入到多项式拟合中,thedouble[] x
和double[] y
. 如果有人对如何使用 alglib.net 库来计算手头的问题有经验,我们将非常感谢您的帮助。
代码
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();
}
}
}