-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Description
Lines 57 to 75 in 8f8c494
| def first_neg_pair_start(chain: VectorType) -> IntType: | |
| """ | |
| Return the index of first element of the sequence whose sum with the following | |
| element is negative, or the length of the sequence if there is no such element. | |
| Parameters: | |
| chain: input sequence | |
| Return: | |
| index of first element whose sum with following element is negative, or | |
| the number of elements if there is no such element | |
| """ | |
| N = len(chain) | |
| n = 0 | |
| while n + 1 < N: | |
| if chain[n] + chain[n + 1] < 0: | |
| return n | |
| n = n + 2 | |
| return N |
I think line 74 should be n = n + 1 instead of n = n + 2 to be consistent with the description of the function. Also, with n = n + 2 I confirmed that you can get negative contributions to the area under the ACF.
Metadata
Metadata
Assignees
Labels
No labels