GrangerCausalityAlgorithm<T>
Models & Types · AiDotNet.CausalDiscovery.TimeSeries
Granger Causality — time series causal discovery via predictive improvement.
Inheritance: CausalDiscoveryBase<T> → TimeSeriesCausalBase<T> → GrangerCausalityAlgorithm<T>
For Beginners
Imagine predicting tomorrow’s temperature. If knowing yesterday’s humidity helps predict temperature better than just knowing past temperatures alone, then humidity “Granger-causes” temperature. This doesn’t prove true causation but indicates a useful predictive relationship.
How It Works
Granger causality tests whether the past values of one variable X improve the prediction of another variable Y beyond what Y’s own past values provide. If so, X “Granger-causes” Y.
Test procedure for each pair (i → j):
- Fit a restricted model: Y_t = f(Y_{t-1}, …, Y_{t-L}) — autoregressive on Y only
- Fit an unrestricted model: Y_t = f(Y_{t-1}, …, Y_{t-L}, X_{t-1}, …, X_{t-L})
- Compare using F-test: F = ((RSS_r - RSS_u) / L) / (RSS_u / (n - 2L - 1))
- If F is significant (p < alpha), X Granger-causes Y
Reference: Granger (1969), “Investigating Causal Relations by Econometric Models and Cross-spectral Methods”, Econometrica.
Constructors
| Constructor | Summary |
|---|---|
GrangerCausalityAlgorithm(CausalDiscoveryOptions options) |
Initializes Granger Causality with optional configuration. |
Properties
| Property | Summary |
|---|---|
bool SupportsNonlinear { get; } |
|
string Name { get; } |