causalcompass.datasets.measurement_error.simulate_var_with_measure_error
- causalcompass.datasets.measurement_error.simulate_var_with_measure_error(p, T, lag=3, gamma=1.2, sparsity=0.2, beta_value=1.0, sd=0.1, burn_in=100, seed=0)[source]
Generate VAR data with measurement error proportional to data variance.
- Parameters:
p (int) – Number of variables
T (int) – Number of time points
lag (int, default 3) – Number of lags in the VAR model
gamma (float, default 1.2) – Scale factor for measurement error variance
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