ljungbox¶
In [ ]:
ljungbox(vdf,
column: str,
ts: str,
by: list = [],
p: int = 1,
alpha: float = 0.05,
box_pierce: bool = False)
Ljung–Box test (whether any of a group of autocorrelations of a time series are different from zero).
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. |
alpha | float | ✓ | Significance Level. Probability to accept H0. |
box_pierce | bool | ✓ | If set to True, the Box-Pierce statistic will be used. |
Returns¶
tablesample : An object containing the result. For more information, see utilities.tablesample.
Example¶
In [103]:
from verticapy import *
texas = vDataFrame("Texas")
texas["cases"].plot(ts = "date")
In [104]:
from verticapy.stats import ljungbox
ljungbox(texas,
column = "cases",
ts = "date",
p = 10)
Out[104]:
In [105]:
# Box-Pierce
ljungbox(texas,
column = "cases",
ts = "date",
p = 10,
box_pierce = True)
Out[105]:
