adfuller

In [ ]:
adfuller(vdf,
         column: str,
         ts: str,
         by: list = [],
         p: int = 1, 
         with_trend: bool = False,
         regresults: bool = False)

Augmented Dickey-Fuller test (time series stationarity).

### Parameters
Name Type Optional Description
vdf
vDataFrame
❌
Input vDataFrame.
column
str
❌
Input vcolumn to test.
ts
str
❌
vcolumn used as timeline. It will be to use to order the data. It can be a numerical or type date like (date, datetime, timestamp...) vcolumn.
by
list
✓
vcolumns used in the partition.
p
int
✓
Number of lags to consider in the test.
with_trend
bool
✓
Adds a trend in the Regression.
regresults
bool
✓
If True, the full regression results are returned.

Returns

tablesample : An object containing the result. For more information, see utilities.tablesample.

Example

In [91]:
from verticapy import *
texas = vDataFrame("Texas")
texas["cases"].plot(ts = "date")
In [92]:
from verticapy.stats import adfuller
adfuller(texas,
         column = "cases",
         ts = "date",
         p = 1,
         with_trend = True)
Out[92]:
value
ADF Test Statistic0.06343664217560875
p_value0.949573193787402
# Lags used1
# Observations Used88
Critical Value (1%)-4.04
Critical Value (2.5%)-3.73
Critical Value (5%)-5.45
Critical Value (10%)-3.15
Stationarity (alpha = 1%)
❌
Rows: 1-9 | Columns: 2
In [94]:
# Result of the Regression
adfuller(texas,
         column = "cases",
         ts = "date",
         p = 5,
         regresults = True)
Out[94]:
Abc
predictor
Varchar(65000)
123
coefficient
Float
123
std_err
Float
123
t_value
Float
123
p_value
Float
1Intercept35.154546247333824.74730080933821.420540628579120.159594434054043
2lag10.0001548505141056730.003213581701120570.04818626956074480.961695880521294
3delta10.6395300714517590.1103385040211775.796073429897281.50637315783867e-07
4delta20.01732184470115690.1305385201716560.1326952739955910.894789754969035
5delta30.1403492927725430.1299563280040781.079972748754020.283615076813402
6delta4-0.2317556646879060.130969497671048-1.769539234776640.0808687521374672
7delta50.4199564344436230.1136317279415333.695767388661930.000414483273968402
Rows: 1-7 | Columns: 5