# series_seasonal()series_seasonal()

## 语法Syntax

`series_seasonal(`series `[,` period`])``series_seasonal(`series `[,` period`])`

## 参数Arguments

• series：输入数值动态数组series : Input numeric dynamic array
• period（可选）：每个周期的整数 bin 数，可能值：period (optional): Integer number of bins in each seasonal period, possible values:
• -1（默认值）：使用阈值为 0.7 的 series_periods_detect() 自动检测期间。-1 (default): Autodetects the period by using series_periods_detect() with a threshold of 0.7 . 如果未检测到周期性，则返回零Returns zeroes if seasonality isn't detected
• 正整数：用作周期性组件的期间Positive integer: Used as the period for the seasonal component
• 任何其他值：忽略周期性，返回一系列零Any other value: Ignores seasonality and returns a series of zeroes

## 示例Examples

### 自动检测期间Auto detect the period

``````print s=dynamic([2,5,3,4,3,2,1,2,3,4,3,2,1,2,3,4,3,2,1,2,3,4,3,2,1])
| union (print s=dynamic([8,12,14,12,10,10,12,14,12,10,10,12,14,12,10,10,12,14,12,10]))
| union (print s=dynamic([1,3,5,2,4,6,1,3,5,2,4,6]))
| extend s_seasonal = series_seasonal(s)
``````
ss s_seasonals_seasonal
[2,5,3,4,3,2,1,2,3,4,3,2,1,2,3,4,3,2,1,2,3,4,3,2,1][2,5,3,4,3,2,1,2,3,4,3,2,1,2,3,4,3,2,1,2,3,4,3,2,1] [1.0,2.0,3.0,4.0,3.0,2.0,1.0,2.0,3.0,4.0,3.0,2.0,1.0,2.0,3.0,4.0,3.0,2.0,1.0,2.0,3.0,4.0,3.0,2.0,1.0][1.0,2.0,3.0,4.0,3.0,2.0,1.0,2.0,3.0,4.0,3.0,2.0,1.0,2.0,3.0,4.0,3.0,2.0,1.0,2.0,3.0,4.0,3.0,2.0,1.0]
[8,12,14,12,10,10,12,14,12,10,10,12,14,12,10,10,12,14,12,10][8,12,14,12,10,10,12,14,12,10,10,12,14,12,10,10,12,14,12,10] [10.0,12.0,14.0,12.0,10.0,10.0,12.0,14.0,12.0,10.0,10.0,12.0,14.0,12.0,10.0,10.0,12.0,14.0,12.0,10.0][10.0,12.0,14.0,12.0,10.0,10.0,12.0,14.0,12.0,10.0,10.0,12.0,14.0,12.0,10.0,10.0,12.0,14.0,12.0,10.0]
[1,3,5,2,4,6,1,3,5,2,4,6][1,3,5,2,4,6,1,3,5,2,4,6] [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0][0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]

### 强制使用期间Force a period

``````print s=dynamic([1,3,5,1,3,5,2,4,6])
| union (print s=dynamic([1,3,5,2,4,6,1,3,5,2,4,6]))
| extend s_seasonal = series_seasonal(s,3)
``````
ss s_seasonals_seasonal
[1,3,5,1,3,5,2,4,6][1,3,5,1,3,5,2,4,6] [1.0,3.0,5.0,1.0,3.0,5.0,1.0,3.0,5.0][1.0,3.0,5.0,1.0,3.0,5.0,1.0,3.0,5.0]
[1,3,5,2,4,6,1,3,5,2,4,6][1,3,5,2,4,6,1,3,5,2,4,6] [1.5,3.5,5.5,1.5,3.5,5.5,1.5,3.5,5.5,1.5,3.5,5.5][1.5,3.5,5.5,1.5,3.5,5.5,1.5,3.5,5.5,1.5,3.5,5.5]