EdgeFrame timeseries_augmented_dickey_fuller_test¶
-
timeseries_augmented_dickey_fuller_test
(self, ts_column, max_lag, regression='c')¶ Augmented Dickey-Fuller statistics test
Parameters: ts_column : unicode
Name of the column that contains the time series values to use with the ADF test.
max_lag : int32
The lag order to calculate the test statistic.
regression : unicode (default=c)
The method of regression that was used. Following MacKinnon’s notation, this can be “c” for constant, “nc” for no constant, “ct” for constant and trend, and “ctt” for constant, trend, and trend-squared.
Returns: : dict
Examples
In this example, we have a frame that contains time series values. The inspect command below shows a snippet of what the data looks like:
>>> frame.inspect() [#] date a b c ================================================================ [0] 2016-04-29T08:00:00.000Z 50 1.0 30.3600006104 [1] 2016-05-02T08:00:00.000Z -50 2.09999990463 30.6100006104 [2] 2016-05-03T08:00:00.000Z 50 3.0 30.3600006104 [3] 2016-05-04T08:00:00.000Z -50 3.90000009537 29.8500003815 [4] 2016-05-05T08:00:00.000Z 50 4.80000019073 29.8999996185 [5] 2016-05-06T08:00:00.000Z -50 6.0 30.0400009155 [6] 2016-05-09T08:00:00.000Z 50 7.19999980927 29.7999992371 [7] 2016-05-10T08:00:00.000Z -50 8.0 30.1399993896 [8] 2016-05-11T08:00:00.000Z 50 9.10000038147 30.0599994659 [9] 2016-05-12T08:00:00.000Z -50 10.1999998093 29.7600002289
Perform the augmented Dickey-Fuller test by specifying the name of the column that contains the time series values, the max lag, and optionally the method of regression (using MacKinnon’s notation). If no regression method is specified, it will default constant (“c”).
Calcuate the augmented Dickey-Fuller test statistic for column “b” with no lag:
>>> result = frame.timeseries_augmented_dickey_fuller_test("b", 0) [===Job Progress===]
>>> result["p_value"] 0.8318769494612004
>>> result["test_stat"] -0.7553870527334429