Skip to main content

decompose_effect

Function decompose_effect 

Source
pub fn decompose_effect(
    delta: &Vector9,
    sigma_n: &Matrix9,
    prior_sigmas: (f64, f64),
) -> EffectDecomposition
Expand description

Decompose timing differences into shift and tail effects (spec §3.4.6).

Uses Bayesian linear regression with the same model as the Bayesian layer:

  • Design matrix X = [ones | b_tail] (9×2)
  • Gaussian prior on β: N(0, Λ₀), Λ₀ = diag(σ_μ², σ_τ²)
  • Likelihood: Δ | β ~ N(Xβ, Σ_n)

§Arguments

  • delta - Observed quantile differences (9-vector, baseline - sample)
  • sigma_n - Covariance matrix (already scaled for inference sample size)
  • prior_sigmas - Prior standard deviations (σ_μ, σ_τ) in nanoseconds

§Returns

An EffectDecomposition with posterior estimates and credible intervals.

§Note

This function duplicates some computation with compute_bayes_gibbs. In the adaptive architecture, prefer using BayesResult.beta_mean and BayesResult.beta_cov directly, then calling classify_pattern for the pattern classification.