lair.background.rolling_baseline#

lair.background.rolling_baseline(data, window='24h', q=0.01, min_periods=1, center=True)[source]#

Calculate the baseline concentration as the {q} quantile of a rolling window of size {window} hours.

Parameters:
  • data (pd.Series) – Time series of data to calculate the baseline from.

  • window (Any, optional) – Window size for the rolling calculation. Must be passable to pd.Timedelta. Default is ‘24h’.

  • q (float, optional) – Quantile to calculate the baseline from. Default is 0.01.

  • min_periods (int, optional) – Minimum number of periods within each window required to have a value. Default is 1.

  • center (bool, optional) – Center the window on the timestamp. Default is True.

Returns:

pd.Series – Baseline concentration

Return type:

Series