Skip to content

Commit

Permalink
Fix docstring of c3 (#590)
Browse files Browse the repository at this point in the history
There were two issues:
 * sum index should start from 1 and not 0
 * x[i+2*lag] should not be squared

Fix #585.
  • Loading branch information
dbarbier authored and MaxBenChrist committed Nov 28, 2019
1 parent ceb6bd0 commit 0654cec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tsfresh/feature_extraction/feature_calculators.py
Original file line number Diff line number Diff line change
Expand Up @@ -1404,13 +1404,13 @@ def c3(x, lag):
.. math::
\\frac{1}{n-2lag} \\sum_{i=0}^{n-2lag} x_{i + 2 \\cdot lag}^2 \\cdot x_{i + lag} \\cdot x_{i}
\\frac{1}{n-2lag} \\sum_{i=1}^{n-2lag} x_{i + 2 \\cdot lag} \\cdot x_{i + lag} \\cdot x_{i}
which is
.. math::
\\mathbb{E}[L^2(X)^2 \\cdot L(X) \\cdot X]
\\mathbb{E}[L^2(X) \\cdot L(X) \\cdot X]
where :math:`\\mathbb{E}` is the mean and :math:`L` is the lag operator. It was proposed in [1] as a measure of
non linearity in the time series.
Expand Down

0 comments on commit 0654cec

Please sign in to comment.