cds2.timeseries
Time-series analysis on pandas.
Time-series analysis built on pandas and numpy.
DecompositionResult
dataclass
Classical decomposition of a series into trend/seasonal/residual.
Source code in src/cds2/timeseries.py
24 25 26 27 28 29 30 31 | |
moving_average(series, window)
Centered rolling mean of a series.
Source code in src/cds2/timeseries.py
39 40 41 42 43 44 45 | |
exponential_smoothing(series, alpha=0.3)
Simple exponential smoothing with smoothing factor alpha.
Source code in src/cds2/timeseries.py
48 49 50 51 52 53 | |
difference(series, lag=1)
Lag-differenced series with NaN entries dropped.
Source code in src/cds2/timeseries.py
56 57 58 59 60 61 62 | |
seasonal_decompose(series, period, model='additive')
Classical decomposition using a centered moving-average trend.
Source code in src/cds2/timeseries.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | |
acf(x, nlags=20)
Sample autocorrelation function (biased estimator), lags 0..nlags.
Source code in src/cds2/timeseries.py
101 102 103 104 105 106 107 108 109 110 111 112 113 | |
pacf(x, nlags=20)
Partial autocorrelation function via the Durbin-Levinson recursion.
Source code in src/cds2/timeseries.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | |
ljung_box(x, lags=10)
Ljung-Box portmanteau test for remaining autocorrelation.
Source code in src/cds2/timeseries.py
139 140 141 142 143 144 145 146 147 148 149 150 151 | |