causalcompass.datasets.nonstationary.simulate_nonstationary_var_timevarying_coef

causalcompass.datasets.nonstationary.simulate_nonstationary_var_timevarying_coef(p, T, lag=3, sparsity=0.2, sd=0.1, beta_value=1.0, noise_std=1.0, mean_log_sigma=1.0, coef_noise_std=0.3, burn_in=100, seed=0)[source]

Generate VAR data with both time-varying coefficients and time-varying noise.

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

  • sd (float, default 0.1) – Noise standard deviation

  • beta_value (float, default 1.0) – Coefficient value

  • noise_std (float, default 1.0) – Standard deviation of the GP

  • mean_log_sigma (float, default 1.0) – Mean of the GP

  • coef_noise_std (float, default 0.3) – Standard deviation of coefficient perturbation

  • burn_in (int, default 100) – Burn-in period

  • seed (int, default 0) – Random seed

Returns:

(data, beta_t, sigma_t, GC, beta_base)— time series array of shape (T, p), time-varying VAR coefficient matrices of shape (T, p, p*lag), time-varying noise scaling factor of shape (T, p), ground-truth causal graph of shape (p, p), and base (stationary) VAR coefficient matrix before time-varying perturbation.

Return type:

tuple