causalcompass.datasets.trendseason.simulate_var_with_trend_season

causalcompass.datasets.trendseason.simulate_var_with_trend_season(p, T, lag=3, sparsity=0.2, beta_value=1.0, sd=0.1, trend_strength=0.01, season_strength=0.5, season_periods=12, burn_in=100, seed=0)[source]

Generate VAR data with additive trend and seasonal components.

References

https://github.com/hferdous/TimeGraph

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

  • trend_strength (float, default 0.01) – Strength of the trend

  • season_strength (float, default 0.5) – Amplitude of the seasonal component

  • season_periods (int, default 12) – Seasonal period

  • 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