You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
y, interval, min_window, trigger, sampler, reset, weights, False, recalc
292
307
)
293
308
294
-
in_seq=None
295
-
ifxisnoty:
296
-
in_seq=_in_sequence_check(x, y)
297
-
298
309
return (
299
310
series,
300
311
interval,
@@ -2181,25 +2192,27 @@ def cov(
2181
2192
reset: ts[object] =None,
2182
2193
recalc: ts[object] =None,
2183
2194
min_data_points: int=0,
2195
+
allow_non_overlapping: bool=False,
2184
2196
) ->ts[Union[float, np.ndarray]]:
2185
2197
"""
2186
2198
2187
2199
Returns the covariance between two in-sequence time-series within the given window. If the time-series are of type np.ndarray, the covariance is calculated elementwise.
2188
2200
2189
2201
Inputs
2190
-
x: time series data, of type float or np.ndarray
2191
-
y: time series data, of type float or np.ndarray, which ticks at the same time as x
2192
-
interval: the window interval (either time or tick specified)
2193
-
min_window: the minimum window (either time or tick specified) before statistics are returned. Must be the same type as interval
2194
-
ddof: delta degrees of freedom
2195
-
ignore_na: if True, will treat NaN values as missing data. If False, a NaN present in the window will make the computed statistic NaN as well
2196
-
trigger: another time-series which specifies when you want to recalculate the statistic
2197
-
weights: another time-series which specifies the weights to use on each x value, if a weighted covariance is desired
2198
-
sampler: another time-series which specifies when x should tick. If x ticks when sampler does not, the data is ignored. If sampler ticks when x does not,
2199
-
the data point is treated as NaN
2200
-
reset: another time-series which will clear the data in the window when it ticks
2201
-
recalc: another time-series which triggers a clean recalculation of the window statistic, and in doing so clears any accumulated floating-point error
2202
-
min_data_points: minimum number of current ticks in the interval needed for a valid computation. If there are fewer ticks, NaN is returned.
2202
+
x: time series data, of type float or np.ndarray
2203
+
y: time series data, of type float or np.ndarray, which ticks at the same time as x
2204
+
interval: the window interval (either time or tick specified)
2205
+
min_window: the minimum window (either time or tick specified) before statistics are returned. Must be the same type as interval
2206
+
ddof: delta degrees of freedom
2207
+
ignore_na: if True, will treat NaN values as missing data. If False, a NaN present in the window will make the computed statistic NaN as well
2208
+
trigger: another time-series which specifies when you want to recalculate the statistic
2209
+
weights: another time-series which specifies the weights to use on each x value, if a weighted covariance is desired
2210
+
sampler: another time-series which specifies when x should tick. If x ticks when sampler does not, the data is ignored. If sampler ticks when x does not,
2211
+
the data point is treated as NaN
2212
+
reset: another time-series which will clear the data in the window when it ticks
2213
+
recalc: another time-series which triggers a clean recalculation of the window statistic, and in doing so clears any accumulated floating-point error
2214
+
min_data_points: minimum number of current ticks in the interval needed for a valid computation. If there are fewer ticks, NaN is returned.
2215
+
allow_non_overlapping: if True, discard any ticks of x and y that occur out-of-sync with one another. If False, raise an exception on any out-of-sync ticks.
Returns the correlation between x and y within the given window. If the time-series are of type np.ndarray, the correlation is calculated elementwise.
2550
2564
2551
2565
Inputs
2552
-
x: time series data, of type float or np.ndarray
2553
-
y: time series data, of type float or np.ndarray, which ticks at the same time x ticks
2554
-
interval: the window interval (either time or tick specified)
2555
-
min_window: the minimum window (either time or tick specified) before statistics are returned. Must be the same type as interval
2556
-
ignore_na: if True, will treat NaN values as missing data. If False, a NaN present in the window will make the computed statistic NaN as well
2557
-
trigger: another time-series which specifies when you want to recalculate the statistic
2558
-
weights: another time-series which specifies the weights to use on each x value, if a weighted correlation is desired
2559
-
sampler: another time-series which specifies when x should tick. If x ticks when sampler does not, the data is ignored. If sampler ticks when x does not,
2560
-
the data point is treated as NaN
2561
-
reset: another time-series which will clear the data in the window when it ticks
2562
-
recalc: another time-series which triggers a clean recalculation of the window statistic, and in doing so clears any accumulated floating-point error
2563
-
min_data_points: minimum number of current ticks in the interval needed for a valid computation. If there are fewer ticks, NaN is returned.
2566
+
x: time series data, of type float or np.ndarray
2567
+
y: time series data, of type float or np.ndarray, which ticks at the same time x ticks
2568
+
interval: the window interval (either time or tick specified)
2569
+
min_window: the minimum window (either time or tick specified) before statistics are returned. Must be the same type as interval
2570
+
ignore_na: if True, will treat NaN values as missing data. If False, a NaN present in the window will make the computed statistic NaN as well
2571
+
trigger: another time-series which specifies when you want to recalculate the statistic
2572
+
weights: another time-series which specifies the weights to use on each x value, if a weighted correlation is desired
2573
+
sampler: another time-series which specifies when x should tick. If x ticks when sampler does not, the data is ignored. If sampler ticks when x does not,
2574
+
the data point is treated as NaN
2575
+
reset: another time-series which will clear the data in the window when it ticks
2576
+
recalc: another time-series which triggers a clean recalculation of the window statistic, and in doing so clears any accumulated floating-point error
2577
+
min_data_points: minimum number of current ticks in the interval needed for a valid computation. If there are fewer ticks, NaN is returned.
2578
+
allow_non_overlapping: if True, discard any ticks of x and y that occur out-of-sync with one another. If False, raise an exception on any out-of-sync ticks.
Returns the exponential moving covariance between two time series.
2972
2988
2973
2989
Inputs
2974
-
x: time series data, of type float or np.ndarray
2975
-
y: time series data, of type float or np.ndarray, which ticks at the same time as x
2976
-
min_periods: the minimum number of data points before statistics are returned
2977
-
alpha: specify the decay parameter in terms of alpha
2978
-
span: specify the decay parameter in terms of span
2979
-
com: specify the decay parameter in terms of com
2980
-
halflife: specify the decay parameter in terms of halflife
2981
-
adjust: if True, an adjusted EMA will be computed. If False, a standard (unadjusted) EMA will be computed
2982
-
horizon: if specified, values that are older than the horizon will be removed entirely from the computation (essentially making EMA a window computation)
2983
-
bias: if True, a biased EMA covariance is computed. If False, the covariance estimate is unbiased
2984
-
ignore_na: if True, NaNs will be ignored and have no effect on the computation. If False, a NaN will shift the observation window once new non-NaN data comes in
2985
-
trigger: another time-series which specifies when you want to recalculate the statistic
2986
-
sampler: another time-series which specifies when x should tick. If x ticks when sampler does not, the data is ignored. If sampler ticks when x does not,
2987
-
the data point is treated as NaN
2988
-
reset: another time-series which will clear the data in the window when it ticks
2989
-
recalc: only valid when a finite-horizon EMA is used. Another time-series which triggers a clean recalculation of the window statistic, and in doing so clears any accumulated floating-point error
2990
-
min_data_points: minimum number of current ticks in the interval needed for a valid computation. If there are fewer ticks, NaN is returned.
2990
+
x: time series data, of type float or np.ndarray
2991
+
y: time series data, of type float or np.ndarray, which ticks at the same time as x
2992
+
min_periods: the minimum number of data points before statistics are returned
2993
+
alpha: specify the decay parameter in terms of alpha
2994
+
span: specify the decay parameter in terms of span
2995
+
com: specify the decay parameter in terms of com
2996
+
halflife: specify the decay parameter in terms of halflife
2997
+
adjust: if True, an adjusted EMA will be computed. If False, a standard (unadjusted) EMA will be computed
2998
+
horizon: if specified, values that are older than the horizon will be removed entirely from the computation (essentially making EMA a window computation)
2999
+
bias: if True, a biased EMA covariance is computed. If False, the covariance estimate is unbiased
3000
+
ignore_na: if True, NaNs will be ignored and have no effect on the computation. If False, a NaN will shift the observation window once new non-NaN data comes in
3001
+
trigger: another time-series which specifies when you want to recalculate the statistic
3002
+
sampler: another time-series which specifies when x should tick. If x ticks when sampler does not, the data is ignored. If sampler ticks when x does not,
3003
+
the data point is treated as NaN
3004
+
reset: another time-series which will clear the data in the window when it ticks
3005
+
recalc: only valid when a finite-horizon EMA is used. Another time-series which triggers a clean recalculation of the window statistic, and in doing so clears any accumulated floating-point error
3006
+
min_data_points: minimum number of current ticks in the interval needed for a valid computation. If there are fewer ticks, NaN is returned.
3007
+
allow_non_overlapping: if True, discard any ticks of x and y that occur out-of-sync with one another. If False, raise an exception on any out-of-sync ticks.
0 commit comments