jump_diffusion_prior_signal

Function jump_diffusion_prior_signal 

pub fn jump_diffusion_prior_signal(
    prices: &[f64],
    profile: &FinanceProfile,
    config: JumpDiffusionPriorConfig,
) -> Result<FinanceSignal<JumpDiffusionPriorResult>>
Expand description

Estimate a physical-measure Merton jump prior (λ, μ_J, σ_J) from price observations.

Detection reuses the jump_event_signal substrate (MODWT/DWT wavelet jump statistic, bipower-robust threshold), then aggregates the consolidated detections into the parametric triple:

  • λ̂ = N / T jumps per year, with N consolidated detections over T = valid returns / annualization factor years; SE(λ̂) = √N / T (Poisson).
  • μ̂_J, σ̂_J are the sample mean and (Bessel-corrected) std of the log jump sizes ln(1 + rᵢ) at the detected returns, with the optional diffusion-variance correction of JumpDiffusionPriorConfig::diffusion_correction; SE(μ̂_J) = s_raw/√N, SE(σ̂_J) = σ̂_J/√(2(N−1)).

This is a detection-conditional (threshold-truncated) estimator: jumps below the detection threshold contribute to neither N nor the size moments, so λ̂ estimates the intensity of detectable jumps. The realized QV − BV legs carried on the result let consumers verify the prior against the model-free jump variance (FerroRisk’s jump_prior_cross_check).

The profile must carry an annualization factor (daily EOD and portfolio profiles do): daily closes are the designed resolution. Intraday/HFT profiles without one are rejected loudly rather than emitting λ in unknowable units.

Fail-loud contract: too little history returns an InsufficientHistory envelope; fewer than min_jump_count detections or a non-identifiable jump-size dispersion returns Unavailable with a diagnostic. A payload is only ever a real estimate.