Detrending

Detrending#

Time series detrending is an essential preparatory step that helps to standardize data, remove trends, and make different time series comparable. delaynet provides several detrending methods that can be applied to time series data. Depending on the data source and connectivity measure you might want to choose a specific detrending method. First, the available methods are listed below with explanation and code examples. The last paragraph presents the convenience API for applying these methods.

Using Detrending Methods#

delaynet provides a consistent interface detrend() for all detrending methods. You can refer to each method by its full name or by its shorthand:

The full list can easily be pretty printed using dn.show_detrending_methods().

import delaynet as dn

# Detrend using the delta method
detrended_ts = dn.detrend(time_series, method="delta", window_size=10)

# Detrend using the Z-Score method
detrended_ts = dn.detrend(time_series, method="zs", periodicity=24)

For details about these detrending methods, see the next subsections. Otherwise continue to read the connectivity methods.