Simulations#
TVAR Coefficient Schedules#
- NeuralFieldManifold.generators.sinusoid(T, p, rng, freq_jitter=0.15, amp_jitter=0.15)[source]#
Sinusoidal coefficient schedule with per-lag variation.
Each lag gets a distinct base frequency, amplitude, and offset with small random jitter for stochastic diversity across samples.
- Parameters:
- Returns:
a – Time-varying AR coefficients of shape
(T, p).- Return type:
np.ndarray
- NeuralFieldManifold.generators.fourier(T, p, rng, M=3, amp_jitter=0.2)[source]#
Fourier-series coefficient schedule with decaying harmonics.
Each lag is represented by a truncated Fourier series with M harmonics whose amplitudes decay as
1 / m^1.2.- Parameters:
- Returns:
a – Time-varying AR coefficients of shape
(T, p).- Return type:
np.ndarray
- NeuralFieldManifold.generators.quasiperiodic(T, p, rng, freq_jitter=0.15)[source]#
Quasiperiodic coefficient schedule with two incommensurate frequencies.
Each lag combines two sinusoidal components whose frequency ratio is irrational, producing non-repeating oscillatory patterns.
- Parameters:
- Returns:
a – Time-varying AR coefficients of shape
(T, p).- Return type:
np.ndarray
- NeuralFieldManifold.generators.polynomial_drift(T, p, rng, degree=3, coef_jitter=0.3)[source]#
Polynomial-drift coefficient schedule.
Each lag’s trajectory is a random polynomial of the given degree centred on the lag-specific offset.
- Parameters:
- Returns:
a – Time-varying AR coefficients of shape
(T, p).- Return type:
np.ndarray
- NeuralFieldManifold.generators.logistic_transition(T, p, rng)[source]#
Single logistic-transition coefficient schedule.
Each lag transitions between two distinct levels via a sigmoid whose centre and steepness are randomised.
- NeuralFieldManifold.generators.multi_sigmoid(T, p, rng, J=3)[source]#
Multi-sigmoid step coefficient schedule.
Superimposes J sigmoid transitions of random magnitude and steepness around each lag’s baseline offset.
- NeuralFieldManifold.generators.gaussian_bumps(T, p, rng, J=4)[source]#
Gaussian-bump coefficient schedule.
Overlays J Gaussian-shaped bumps of random centre, width, and sign on each lag’s baseline offset.
Dynamical Systems & Noise#
- NeuralFieldManifold.generators.tvvar(n_steps: int, burn_in: int = 300, alpha: Array = None, beta: Array = None, rotation_period1: float = 500.0, rotation_period2: float = 900.0, noise_scale: float = 1.0, seed: int = 0) Array[source]#
3D Time-Varying VAR(2) with rotating coupling matrices.
Ensures stability by using orthogonal rotations to preserve eigenvalues while the coupling structure evolves smoothly over time.
- Parameters:
n_steps (int) – Number of time steps (after burn-in).
burn_in (int) – Number of initial samples to discard.
alpha (jnp.ndarray or None) – Eigenvalues for first-lag matrix A1 (length 3). Default: [0.45, 0.35, 0.30]
beta (jnp.ndarray or None) – Eigenvalues for second-lag matrix A2 (length 3). Negative values help with damping. Default: [-0.10, -0.08, -0.06]
rotation_period1 (float) – Period for first rotation (samples).
rotation_period2 (float) – Period for second rotation (samples).
noise_scale (float) – Scale of innovation noise.
seed (int) – Random seed.
- Returns:
Signal of shape (n_steps, 3).
- Return type:
jnp.ndarray
Example
>>> data = tvvar(5000) # (5000, 3) >>> X1, X2, X3 = data[:, 0], data[:, 1], data[:, 2]
- NeuralFieldManifold.generators.lorenz(T_steps=12000, dt=0.005, sigma=10.0, rho=28.0, beta=2.6666666666666665, x0=(1.0, 1.0, 1.0))[source]#
Lorenz system generator using 4th order Runge-Kutta integration.
- Parameters:
- Returns:
Arrays containing the x, y, and z coordinates of the Lorenz system trajectory.
- Return type:
tuple of np.ndarray
Example
>>> x, y, z = lorenz()
- NeuralFieldManifold.generators.ou_exact(n_steps: int, dt: float = 0.005, theta: float = 2.0, mu: float = 0.0, sigma: float = 1.0, x0: float = 0.0, seed: int = 0)[source]#
Ornstein-Uhlenbeck process using exact analytical solution.
- The conditional distribution P(x_{t+dt} | x_t) is Gaussian with:
mean = x_t * exp(-θ*dt) + μ * (1 - exp(-θ*dt)) var = σ² / (2θ) * (1 - exp(-2θ*dt))
- Parameters:
- Returns:
Signal of shape (n_steps,).
- Return type:
jnp.ndarray
Example
>>> x = ou_exact(10000, dt=0.005, theta=2.0)
- NeuralFieldManifold.generators.ou_euler(n_steps: int, dt: float = 0.005, theta: float = 2.0, mu: float = 0.0, sigma: float = 1.0, x0: float = 0.0, seed: int = 0)[source]#
Ornstein-Uhlenbeck process using Euler-Maruyama approximation.
- Approximation (first-order in dt):
x_{t+dt} ≈ x_t - θ*dt*(x_t - μ) + σ*sqrt(dt)*ε
- Parameters:
- Returns:
Signal of shape (n_steps,).
- Return type:
jnp.ndarray
Example
>>> x = ou_euler(10000, dt=0.005, theta=2.0)
- NeuralFieldManifold.generators.white_noise(n_steps: int, seed: int = 0)[source]#
Generate white noise (flat PSD).
- Parameters:
- Returns:
Noise signal of shape (n_steps,), zero mean, unit variance.
- Return type:
jnp.ndarray
Example
>>> x = white_noise(10000)
- NeuralFieldManifold.generators.pink_noise(n_steps: int, seed: int = 0)[source]#
Generate pink (1/f) noise.
- Parameters:
- Returns:
Noise signal of shape (n_steps,), zero mean, unit variance.
- Return type:
jnp.ndarray
Example
>>> x = pink_noise(10000)
- NeuralFieldManifold.generators.brown_noise(n_steps: int, seed: int = 0)[source]#
Generate brown/red (1/f²) noise.
- Parameters:
- Returns:
Noise signal of shape (n_steps,), zero mean, unit variance.
- Return type:
jnp.ndarray
Example
>>> x = brown_noise(10000)
- NeuralFieldManifold.generators.colored_noise(n_steps: int, alpha: float = 1.0, seed: int = 0)[source]#
Generate 1/f^α colored noise via spectral shaping.
- Parameters:
- Returns:
Noise signal of shape (n_steps,), zero mean, unit variance.
- Return type:
jnp.ndarray
Example
>>> x = colored_noise(10000, alpha=1.5)