-
statsmodels.tsa.tsatools.detrend(x, order=
1, axis=0)[source]
对一个沿轴0或1具有给定阶数趋势的数组进行去趋势处理。
- Parameters:
- xarray_like, 1d or 2d
数据,如果是二维的,那么每一行或每一列都独立地使用相同的趋势阶数进行去趋势处理,但趋势估计是独立的。
- order
int 趋势的多项式阶数,零是常数,一是线性趋势,二是二次趋势。
- axis
int 轴可以是0,按行观察,或者是1,按列观察。
- Returns:
ndarray去趋势序列是数据在给定阶数的趋势上的线性回归的残差。
Last update:
Oct 16, 2024