statistics_polynomial_fit 函数
使用最小二乘法对成对数值数据拟合指定次数的多项式。
语法
Statistics:-PolynomialFit([[x1, y1], ...], x)Statistics:-PolynomialFit(data, x, degree = n)Statistics:-PolynomialFit(xValues, yValues, x, degree = n)
参数与选项
data | 点对 [[x1, y1], ...],或分别给出的 x 与 y 列表。 |
|---|---|
var | 变量名称。 |
degree | 可选的多项式次数;默认为 1,且必须小于数据点数量。 |
示例
- 二次回归拟合
Statistics:-PolynomialFit([[0, 1], [1, 3], [2, 7]], x, degree = 2)返回 x^2 + x + 1。