Module calculus

Source
Expand description

Vector differential calculus over temporal trajectories.

Provides first and second order finite differences, drift quantification, and basic stochastic process characterization for embedding trajectories.

ยงConventions

  • Timestamps are in microseconds.
  • Velocity units: vector displacement per microsecond.
  • All functions operate on pre-sorted (timestamp, &[f32]) slices.

Structsยง

DriftReport
Drift report identifying the most changed dimensions.

Constantsยง

MIN_POINTS_ACCELERATION ๐Ÿ”’
Minimum number of points for acceleration computation.
MIN_POINTS_STOCHASTIC ๐Ÿ”’
Minimum number of points for stochastic characterization.
MIN_POINTS_VELOCITY ๐Ÿ”’
Minimum number of points for velocity computation.

Functionsยง

acceleration
Compute acceleration (second-order finite difference) at a target timestamp.
adf_statistic
Augmented Dickey-Fuller (ADF) test statistic for stationarity.
drift_magnitude_cosine
Compute cosine drift (1 - cosine_similarity) between two snapshots.
drift_magnitude_l2
Compute L2 drift magnitude between two snapshots.
drift_report
Generate a drift report between two snapshots.
find_closest_index ๐Ÿ”’
Find index of the closest point to a target timestamp.
hurst_exponent
Hurst exponent estimation via rescaled range (R/S) analysis.
linear_regression_slope ๐Ÿ”’
Simple linear regression slope.
realized_volatility
Realized volatility over a trajectory (standard deviation of returns).
rescaled_range ๐Ÿ”’
Rescaled range statistic for a given window size.
velocity
Compute velocity (first-order finite difference) at a target timestamp.