API reference

andrey.data.sample_context_series#

andrey.data.sample_context_series(n_system=5, n_time=2, n_space=1, *, n_datasets=10, n_steps=100, tau_max=2, n_links=None, observed=1.0, seed=0)[source]#

Draw linear time series from n_datasets datasets with shared contexts.

Each system variable has a link to its own past with weight in [0.3, 0.8]. n_links further links, n_system by default, and one link from each context, into distinct system variables, have weights in [0.5, 0.9]; half are at lag 0 and the rest uniform in 1 to tau_max, and a space context’s is at lag 0. The noise is standard normal. Each system variable is rescaled to variance one across the datasets, so its variance does not tell the causal order. observed is the fraction of the contexts the datasets hold, the rest chosen at random.

Raises ValueError when there are more contexts than system variables or more links than pairs of them, or when no draw of the weights is stationary.

Return type:

ContextSeries