Skip to main content

CopulaGenerator

Bases: BaseGenerator Generate correlated time series using Gaussian or t copulas. Copulas model the dependence structure between variables independently of their marginal distributions. Sampling proceeds in two steps:
  1. Draw correlated uniforms from the copula. Gaussian copula: z ~ N(0, R), u_i = Phi(z_i). t copula: z ~ N(0, R), w ~ chi2(df), u_i = T_df(z_i * sqrt(df / w)) (the chi-square mixing is shared across variables, which creates tail dependence).
  2. Map each uniform through the inverse CDF of its marginal: x_i = F_i^{-1}(u_i).
For the Gaussian copula the rank correlations satisfy spearman = (6 / pi) * arcsin(rho / 2) and for both copulas kendall_tau = (2 / pi) * arcsin(rho). generate(n_series) creates n_series correlated variables sharing one length; each variable is one unique_id in the long-format output. Samples are i.i.d. over time (no serial dependence). Parameters:

CopulaGenerator.generate_single_series

Generate values for a single univariate series. Provided for compatibility with BaseGenerator; use generate(n_series) for multivariate output. Parameters: Returns:

CopulaGenerator.generate

Generate n_series correlated series with copula dependence. Overrides the base generate() for multivariate output: n_series is the number of correlated variables, all sharing a single length. Generation is inherently joint, so n_jobs has no effect. Parameters: Returns:

VARGenerator

Bases: BaseGenerator Generate correlated time series using a Vector Autoregression model. A VAR(p) process models each variable as a linear function of past values of all variables:
The process is stable (stationary) iff the companion matrix
has spectral radius < 1, in which case the stationary mean is (I - A_1 - ... - A_p)^{-1} c. Innovations are drawn from the configured innovation distribution and correlated via the Cholesky factor of Sigma. A burn-in of 100 steps is discarded. generate(n_series) creates n_series correlated variables sharing one length; each variable is one unique_id in the long-format output. Parameters:

VARGenerator.generate_single_series

Generate values for a single (univariate) VAR series. Provided for compatibility with BaseGenerator; use generate(n_series) for multivariate output. Parameters: Returns:

VARGenerator.generate

Generate n_series correlated time series using the VAR model. Overrides the base generate() for multivariate output: n_series is the number of correlated variables, all sharing a single length. Generation is inherently joint, so n_jobs has no effect. Parameters: Returns:

GaussianProcessGenerator

Bases: BaseGenerator Generate time series by sampling from a Gaussian Process. Samples f ~ GP(mean, k) on the integer grid t = 0..length-1, so the marginal distribution is N(mean, amplitude^2 + noise_variance) and the correlation at lag r is k(r) / k(0). Kernels (r = |t - t’|, l = length_scale, a = amplitude):
  • rbf: a^2 exp(-r^2 / (2 l^2)) — infinitely differentiable, very smooth paths
  • matern_0.5: a^2 exp(-r/l) — rough, Ornstein-Uhlenbeck-like
  • matern_1.5: a^2 (1+s) exp(-s), s = sqrt(3) r / l — once-differentiable
  • matern_2.5: a^2 (1+s+s^2/3) exp(-s), s = sqrt(5) r / l — twice-differentiable
  • periodic: a^2 exp(-2 sin^2(pi r / period) / l^2) — exact periodicity
Parameters:

GaussianProcessGenerator.generate_single_series

Generate a single GP sample path. Parameters: Returns:

GaussianProcessGenerator.get_model_info

Return information about the GP configuration.