Back to models
Transformer

Bollinger

Apply Bollinger bands to a time series.

The transformation works for univariate and multivariate timeseries.

Quickstart

python
from sktime.transformations.bollinger import Bollinger

estimator = Bollinger(window, k=1, memory='all')

Tags

Capabilities

  • Multivariate
  • Unequal-length series
  • Inverse transform: Not supported
  • Missing values: Not supported
  • Removes missing values: Not supported
  • Equalizes series length: Not supported

Properties

Input typescitype:transform-input
Series
Output typescitype:transform-output
Series
Label typescitype:transform-labels
None
Fit is emptyfit_is_empty
No
Keeps the time indextransform-returns-same-time-index
Yes
Requires Xrequires_X
Yes
Requires yrequires_y
No
X and y need the same indexX-y-must-have-same-index
No

Parameters(3)

windowint
The window over which to compute the moving average and the standard deviation.
k: float, default = 1
Multiplier to determine how many stds the upper and lower bounds are from the moving average.
memorystr, optional, default = “all”

how much of previously seen X to remember, for exact reconstruction of inverse.

  • “all”: estimator remembers all X, inverse is correct for all indices seen

  • “latest”: estimator only remembers latest X necessary for future

reconstruction. Inverses at any time stamps after fit are correct, but not past time stamps.

  • “none”: estimator does not remember any X, inverse is direct cumsum

Examples

>>> from sktime.transformations.bollinger import Bollinger
>>> from sktime.datasets import load_airline
>>> y = load_airline ()
>>> transformer = Bollinger (window = 12, k = 1)
>>> y_transform = transformer. fit_transform (y)