causalcompass.datasets.mixed_data.generate_mixed_lorenz_96

causalcompass.datasets.mixed_data.generate_mixed_lorenz_96(p, T, F=10.0, delta_t=0.1, sd=0.1, burn_in=1000, typeflag=None, discrete_ratio=0.5, seed=0, length_per_batch=50, device=torch.device('cuda:0'))[source]

Generate Lorenz-96 data where a proportion of variables are discretized.

References

https://github.com/chunhuiz/MiTCD

Parameters:
  • p (int) – Number of variables

  • T (int) – Number of time points

  • F (float, default 10.0) – Forcing parameter

  • delta_t (float, default 0.1) – Time step for ODE solver

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

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

  • typeflag (list or None, default None) – Manual specification of variable types (0=discrete, 1=continuous). If None, automatically generated based on discrete_ratio

  • discrete_ratio (float, default 0.5) – Ratio of discrete variables

  • seed (int, default 0) – Random seed

  • length_per_batch (int, default 50) – Length of each batch for instance normalization

  • device (torch.device, default torch.device('cuda:0')) – Device for tensor computation

Returns:

(data_bin_global, data_bin_inst, GC) — globally binarized time series of shape (T, p), instance-normalized and binarized time series of shape (num_batches, length_per_batch, p), and ground-truth causal graph of shape (p, p). data_bin_inst is used as input for the MiTCD algorithm, while all other algorithms use data_bin_global as input.

Return type:

tuple