Skip to main content

causality

Perform Granger causality test to determine if X 'causes' y.

The Granger causality test is a statistical hypothesis test to determine if one time series is useful in forecasting another. While 'causality' in this context does not imply a cause-and-effect relationship in the philosophical sense, it does test whether changes in one variable are systematically followed by changes in another variable, suggesting a predictive relationship. By specifying a lag, you set the number of periods to look back in the time series to assess this relationship. This test is particularly useful in economic and financial data analysis, where understanding the lead-lag relationship between indicators can inform investment decisions and policy making.

Parameters

data: list[openbb_core.provider.abstract.data.Data]

Input dataset.

Optional: False


y_column: str

Target column.

Optional: False


x_column: str

Columns to use as exogenous variables.

Optional: False


lag: int

Number of lags to use in the test.

Default: 3

Optional: True


Returns

results: list[Data]

Serializable results.


provider: None

Provider name.


warnings: Optional[list[Warning_]]

list of warnings.


chart: Optional[Chart]

Chart object.


extra: dict[str, Any]

Extra info.


On this page