Timeseries Package¶
Algebra¶
|
Absolute value of each element in series |
|
Add two series or scalars |
|
Logical "and" of two or more boolean series. |
|
Cap series at maximum value |
|
Divide two series or scalars |
|
Exponential of series |
|
Removes values where comparison with the operator and value combination results in true, defaults to removing missing values from the series |
|
Removes dates where comparison with the operator and dates combination results in true, defaults to removing missing values from the series |
|
Floor series at minimum value |
|
Floor divide two series or scalars |
|
Returns a series s. |
|
Natural logarithm of series |
|
Multiply two series or scalars |
|
Logical negation of a single boolean series. |
|
Logical "or" of two or more boolean series. |
|
Raise each element in series to power |
|
Square root of (a) each element in a series or (b) a real number |
|
Add two series or scalars |
|
Calculate a weighted sum. |
Analysis¶
|
Diff observations with given lag |
|
First value of series |
|
Last value of series (as a series) |
|
Last value of series (as a scalar) |
|
Count observations in series |
|
Lag timeseries by a number of observations or a relative date. |
Backtesting¶
|
Calculates a basket return series. |
|
Construct a basket of stocks |
Date / Time¶
|
Align dates of two series or scalars |
|
Interpolate over specified dates or times |
|
Value at specified date or time |
|
Day of each value in series |
|
Weekday of each value in series |
|
Month of each value in series |
|
Year of each value in series |
|
Quarter of each value in series |
|
Create a time series from a (sub-)range of dates in an existing time series. |
|
Prepend data series |
|
Fill in missing dates or times of one series with another |
|
Bucketize a series and apply aggregate function to each bucket |
|
Create a Window with size and ramp up to use. |
Econometrics¶
|
Annualize series based on sample observation frequency |
|
Rolling beta of price series and benchmark |
|
Arithmetic series normalization |
|
Rolling correlation of two price series |
|
Calculate excess returns |
|
Geometric series normalization |
|
Compute the maximum peak to trough drawdown over a rolling window as a ratio. |
|
Calculate price levels from returns series |
|
Calculate returns from price series |
|
Calculate Sharpe ratio |
|
Realized volatility of price series |
Statistics¶
|
Rolling co-variance of series over given window |
|
Exponentially weighted standard deviation |
|
Generate sample timeseries |
|
Maximum value of series over given window |
|
Arithmetic mean of series over given window |
|
Median value of series over given window |
|
Minimum value of series over given window |
|
Most common value in series over given window |
|
Returns the nth percentile of a series. |
|
Rolling percentiles over given window |
|
Rolling product of series over given window |
|
Range of series over given window |
|
Rolling standard deviation of series over given window |
|
Rolling sum of series over given window |
|
Rolling variance of series over given window |
|
Limit extreme values in series |
|
Rolling z-scores over a given window |
|
Fit an Ordinary least squares (OLS) linear regression model. |
|
Fit a rolling ordinary least squares (OLS) linear regression model. |
|
SIR Compartmental model for transmission of infectious disease |
|
SEIR Compartmental model for transmission of infectious disease |
Technical Analysis¶
|
Bollinger bands with given window and width |
|
Moving average over specified window |
|
Exponentially weighted moving average |
|
Exponentially weighted volatility |
|
Exponentially weighted spread volatility |
|
Smoothed moving average over specified window |
|
Relative Strength Index |
|
Moving average convergence divergence (MACD). |