Data preparation#
Prepare a series before analysis: bars from ticks, fill or drop missing values, and despike outliers.
Bars & resampling#
Time, tick, volume, and dollar bars from a trade tape, and OHLC downsampling.
Function |
Description |
|---|---|
Causal windowed downsample of a 1-D or multi-column value stream. |
Missing data#
Filling and removing NaN values.
Function |
Description |
|---|---|
Drop events whose value is NaN. |
|
Replace NaN with the most recent non-NaN value. |
|
Replace NaN with a user-specified scalar. |
|
Returns 1.0 for finite values, 0.0 for NaN or inf. Does not propagate NaN. |
|
Returns 1.0 if the input is NaN, else 0.0. Does not propagate NaN. |
Outliers & robustness#
Despiking and robust estimators.
Function |
Description |
|---|---|
Bound each element below and/or above. |
|
Robust Hampel despiker, replace samples far from the window median (in MAD units). |
|
Causal impulse remover, detects spikes on the trend-free first difference. |
|
Trailing-window mean absolute deviation from the rolling mean. |
|
Trailing-window median. |
|
Rolling median absolute deviation, median(|x - median|), a robust scale estimate. |
|
Clip samples that lie beyond lower or upper standard deviations from the rolling mean, or replace them with NaN. |