statsmodels.tsa.tsatools.detrend#
- statsmodels.tsa.tsatools.detrend(x, order=1, axis=0)[source]#
Detrend an array with a trend of given order along axis 0 or 1
- Parameters:
- x
ndarray Data, 1d or 2d. If 2d, then each row or column is independently detrended with the same trendorder, but independent trend estimates.
- order
int,optional The polynomial order of the trend, zero is constant, one is linear trend, two is quadratic trend.
- axis
int,optional Axis can be either 0, observations by rows, or 1, observations by columns.
- x
- Returns:
ndarrayThe detrended series is the residual of the linear regression of the data on the trend of given order.