superstats.transition.stochastic.levy_flight#

Lévy-flight transition models.

Classes

LevyFlight([bounds, initial_prior, sigma, ...])

Lévy-flight transition with alpha-stable noise and optional drift.

class superstats.transition.stochastic.levy_flight.LevyFlight(bounds=None, initial_prior=None, sigma=None, delta=None, alpha=None, beta=None)[source]#

Bases: StochasticTransition

Lévy-flight transition with alpha-stable noise and optional drift.

Like a random walk, but the Gaussian increments are replaced with alpha-stable increments, introducing a stability index alpha that controls tail heaviness. alpha=2 recovers Gaussian-like behavior; smaller alpha produces heavy-tailed jumps.

Parameters:
boundstuple or None, optional, default: None

Lower and upper bounds for the latent state.

initial_priorPrior or None, optional, default: None

Prior for the initial latent state.

sigmafloat or Prior or None, optional, default: None

Scale of the alpha-stable increments.

deltafloat or Prior or None, optional, default: None

Additive drift term.

alphafloat or Prior or None, optional, default: None

Stability index in (0, 2] controlling tail heaviness.

betafloat or Prior or None, optional, default: None

Skewness in [-1, 1]. Defaults to 0 (symmetric) if left unset.

Parameters:

Notes

The sample method returns a dict with keys local_params, hyper_params and fixed_params. Use sample_one_step to advance a single time-step given numeric params.

sample(batch_size, num_steps)[source]#

Draw batch_size Lévy-flight trajectories of length num_steps.

Parameters:
batch_sizeint

Number of independent trajectories to draw.

num_stepsint

Number of time steps per trajectory.

Returns:
resultdict - dictionary with keys local_params,

hyper_params, and fixed_params

Parameters:
  • batch_size (int)

  • num_steps (int)

Return type:

Dict[str, Any]

sample_one_step(x, params)[source]#

Advance a single step of the Lévy flight.

Parameters:
xfloat

Previous latent state.

paramsdict

Expected keys: sigma, delta, alpha, beta.

Returns:
x_nextfloat - the next latent state
Parameters:
Return type:

float