# series_fit_line_dynamic()series_fit_line_dynamic()

• `rsquare`：r-square 是用于衡量拟合质量的标准。`rsquare`: r-square is a standard measure of the fit quality. 它是 [0-1] 范围内的数字，其中 1 表示拟合度最好，0 表示数据无序，与任何直线均不拟合It's a number in the range [0-1], where 1 is the best possible fit, and 0 means the data is unordered and doesn't fit any line
• `slope`：近似直线的斜率（即 y=ax+b 中的 a 值）`slope`: Slope of the approximated line (the a -value from y=ax+b )
• `variance`：输入数据的方差`variance`: Variance of the input data
• `rvariance`：剩余方差，即输入数据值和近似数据值之间的方差。`rvariance`: Residual variance that is the variance between the input data values and the approximated ones.
• `interception`：近似直线的截距（即 y=ax+b 中的 b 值）`interception`: Interception of the approximated line (the b -value from y=ax+b )
• `line_fit`：数值数组，其中包含拟合度最好的直线的一系列值。`line_fit`: Numerical array containing a series of values of the best fit line. 序列长度等于输入数组的长度。The series length is equal to the length of the input array. 它主要用于绘制图表。It's used mainly for charting.

## 语法Syntax

`series_fit_line_dynamic(`x`)``series_fit_line_dynamic(`x`)`

## 参数Arguments

• x：数值的动态数组。x : Dynamic array of numeric values.

## 示例Examples

``````print id=' ', x=range(bin(now(), 1h)-11h, bin(now(), 1h), 1h), y=dynamic([2,5,6,8,11,15,17,18,25,26,30,30])
| extend fit=series_fit_line_dynamic(y)
| extend RSquare=fit.rsquare, Slope=fit.slope, Variance=fit.variance,RVariance=fit.rvariance,Interception=fit.interception,LineFit=fit.line_fit
| render timechart
``````

RSquareRSquare 斜率Slope VarianceVariance RVarianceRVariance InterceptionInterception LineFitLineFit
0.9820.982 2.7302.730 98.62898.628 1.6861.686 -1.666-1.666 1.064、3.7945、6.526、9.256、11.987、14.718、17.449、20.180、22.910、25.641、28.371、31.1021.064, 3.7945, 6.526, 9.256, 11.987, 14.718, 17.449, 20.180, 22.910, 25.641, 28.371, 31.102