causalcompass.datasets.vanilla.simulate_var
- causalcompass.datasets.vanilla.simulate_var(p, T, lag=3, sparsity=0.2, beta_value=1.0, sd=0.1, burn_in=100, seed=0)[source]
Generate time series data from a Vector Autoregressive (VAR) model.
References
https://github.com/iancovert/Neural-GC
- Parameters:
p (int) – Number of variables
T (int) – Number of time points
lag (int, default 3) – Number of lags in the VAR model
sparsity (float, default 0.2) – Sparsity of the causal graph
beta_value (float, default 1.0) – Coefficient value
sd (float, default 0.1) – Noise standard deviation
burn_in (int, default 100) – Burn-in period
seed (int, default 0) – Random seed
- Returns:
(data, beta, GC) — time series array of shape (T, p), coefficient matrix, and ground-truth causal graph of shape (p, p).
- Return type:
tuple