# series_fit_2lines_dynamic()series_fit_2lines_dynamic()

• `rsquare`：R 平方是用于衡量拟合质量的标准。`rsquare`: R-squared is a standard measure of the fit quality. 它是 [0-1] 范围内的一个数字，其中 1 表示拟合质量可能最佳，0 表示数据是无序的，无法与任何线拟合。It's a number in the range of [0-1], where 1 is the best possible fit, and 0 means the data is unordered and do not fit any line.
• `split_idx`：两段的拆分点的索引（从零开始）。`split_idx`: the index of breaking point to two segments (zero-based).
• `variance`：输入数据的方差。`variance`: variance of the input data.
• `rvariance`：残差方差，即输入数据值和近似数据值之间的方差（按两个线段）。`rvariance`: residual variance that is the variance between the input data values the approximated ones (by the two line segments).
• `line_fit`：数值数组，其中包含拟合度最好的直线的一系列值。`line_fit`: numerical array holding a series of values of the best fitted line. 序列长度等于输入数组的长度。The series length is equal to the length of the input array. 它用于绘制图表。It is used for charting.
• `right.rsquare`：拆分点右侧直线的相关系数平方，请参阅 series_fit_line()series_fit_line_dynamic()`right.rsquare`: r-square of the line on the right side of the split, see series_fit_line() or series_fit_line_dynamic().
• `right.slope`：右近似线（形式为 y=ax+b）的斜率。`right.slope`: slope of the right approximated line (of the form y=ax+b).
• `right.interception`：左近似线的截距（即 y=ax+b 中的 b）。`right.interception`: interception of the approximated left line (b from y=ax+b).
• `right.variance`：拆分点右侧输入数据的方差。`right.variance`: variance of the input data on the right side of the split.
• `right.rvariance`：拆分点右侧输入数据的残差方差。`right.rvariance`: residual variance of the input data on the right side of the split.
• `left.rsquare`：拆分点左侧直线的相关系数平方，请参阅 [series_fit_line()].(series-fit-linefunction.md) 或 series_fit_line_dynamic()`left.rsquare`: r-square of the line on the left side of the split, see [series_fit_line()].(series-fit-linefunction.md) or series_fit_line_dynamic().
• `left.slope`：左近似线（形式为 y=ax+b）的斜率。`left.slope`: slope of the left approximated line (of the form y=ax+b).
• `left.interception`：左近似线（形式为 y=ax+b）的截距。`left.interception`: interception of the approximated left line (of the form y=ax+b).
• `left.variance`：拆分点左侧输入数据的方差。`left.variance`: variance of the input data on the left side of the split.
• `left.rvariance`：拆分点左侧输入数据的残差方差。`left.rvariance`: residual variance of the input data on the left side of the split.

## 语法Syntax

`series_fit_2lines_dynamic(`x`)``series_fit_2lines_dynamic(`x`)`

## 参数Arguments

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

## 示例Example

``````print id=' ', x=range(bin(now(), 1h)-11h, bin(now(), 1h), 1h), y=dynamic([1,2.2, 2.5, 4.7, 5.0, 12, 10.3, 10.3, 9, 8.3, 6.2])
| extend LineFit=series_fit_line_dynamic(y).line_fit, LineFit2=series_fit_2lines_dynamic(y).line_fit
| project id, x, y, LineFit, LineFit2
| render timechart
``````