pub struct Posterior {Show 14 fields
pub delta_post: Vector9,
pub lambda_post: Matrix9,
pub beta_proj: Vector2,
pub beta_proj_cov: Matrix2,
pub beta_draws: Vec<Vector2>,
pub leak_probability: f64,
pub projection_mismatch_q: f64,
pub n: usize,
pub lambda_mean: Option<f64>,
pub lambda_mixing_ok: Option<bool>,
pub kappa_mean: Option<f64>,
pub kappa_cv: Option<f64>,
pub kappa_ess: Option<f64>,
pub kappa_mixing_ok: Option<bool>,
}Expand description
Posterior distribution parameters for the 9D effect vector δ.
The posterior is Gaussian: δ | Δ ~ N(δ_post, Λ_post) where each δ_k represents the timing difference at decile k.
The 2D projection β_proj = (μ, τ) provides shift/tail decomposition.
Uses Student’s t prior (ν=4) via Gibbs sampling for robust inference.
Fields§
§delta_post: Vector99D posterior mean δ_post in nanoseconds.
lambda_post: Matrix99D posterior covariance Λ_post.
beta_proj: Vector22D GLS projection β = (μ, τ) for interpretability.
- β[0] = μ (uniform shift)
- β[1] = τ (tail effect)
beta_proj_cov: Matrix22D projection covariance (empirical, from draws).
beta_draws: Vec<Vector2>Retained β draws for dominance-based classification (spec §3.4.6). Each draw is β^(s) = A·δ^(s) where A is the GLS projection matrix.
leak_probability: f64Leak probability: P(max_k |δ_k| > θ | Δ). Computed via Monte Carlo integration over the 9D posterior.
projection_mismatch_q: f64Projection mismatch Q statistic. Q = r’Σ_n⁻¹r where r = δ_post - X β_proj. High values indicate the 2D summary is approximate.
n: usizeNumber of samples used in this posterior computation.
lambda_mean: Option<f64>Posterior mean of latent scale λ.
None if using simple posterior (no Gibbs sampler).
lambda_mixing_ok: Option<bool>Whether the Gibbs sampler’s lambda chain mixed well.
None if using simple posterior.
When Some(false), indicates potential posterior unreliability.
kappa_mean: Option<f64>Posterior mean of likelihood precision κ.
None if using simple posterior.
kappa_cv: Option<f64>Coefficient of variation of κ.
None if using simple posterior.
kappa_ess: Option<f64>Effective sample size of κ chain.
None if using simple posterior.
kappa_mixing_ok: Option<bool>Whether the Gibbs sampler’s kappa chain mixed well.
None if using simple posterior.
Implementations§
Source§impl Posterior
impl Posterior
Sourcepub fn new(
delta_post: Vector9,
lambda_post: Matrix9,
beta_proj: Vector2,
beta_proj_cov: Matrix2,
beta_draws: Vec<Vector2>,
leak_probability: f64,
projection_mismatch_q: f64,
n: usize,
) -> Self
pub fn new( delta_post: Vector9, lambda_post: Matrix9, beta_proj: Vector2, beta_proj_cov: Matrix2, beta_draws: Vec<Vector2>, leak_probability: f64, projection_mismatch_q: f64, n: usize, ) -> Self
Create a new posterior with given parameters.
Sourcepub fn new_with_gibbs(
delta_post: Vector9,
lambda_post: Matrix9,
beta_proj: Vector2,
beta_proj_cov: Matrix2,
beta_draws: Vec<Vector2>,
leak_probability: f64,
projection_mismatch_q: f64,
n: usize,
lambda_mean: f64,
lambda_mixing_ok: bool,
kappa_mean: f64,
kappa_cv: f64,
kappa_ess: f64,
kappa_mixing_ok: bool,
) -> Self
pub fn new_with_gibbs( delta_post: Vector9, lambda_post: Matrix9, beta_proj: Vector2, beta_proj_cov: Matrix2, beta_draws: Vec<Vector2>, leak_probability: f64, projection_mismatch_q: f64, n: usize, lambda_mean: f64, lambda_mixing_ok: bool, kappa_mean: f64, kappa_cv: f64, kappa_ess: f64, kappa_mixing_ok: bool, ) -> Self
Create a new posterior with Gibbs sampler diagnostics (v5.4, v5.6).
Sourcepub fn max_effect_ns(&self) -> f64
pub fn max_effect_ns(&self) -> f64
Get the max absolute effect across all deciles.
Sourcepub fn to_effect_estimate(&self) -> EffectEstimate
pub fn to_effect_estimate(&self) -> EffectEstimate
Build an EffectEstimate from this posterior.
This computes the credible interval and classifies the effect pattern using dominance-based classification from the β draws (spec §3.4.6).
Sourcepub fn measurement_quality(&self) -> MeasurementQuality
pub fn measurement_quality(&self) -> MeasurementQuality
Get measurement quality based on the effect standard error.
Quality is determined by the minimum detectable effect (MDE), which is approximately 2x the effect standard error.
Sourcepub fn to_summary(&self) -> PosteriorSummary
pub fn to_summary(&self) -> PosteriorSummary
Convert to an FFI-friendly summary containing only scalar fields.
This uses the canonical effect pattern classification from draws (spec §3.4.6) rather than the simpler heuristics that were previously duplicated in bindings.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Posterior
impl RefUnwindSafe for Posterior
impl Send for Posterior
impl Sync for Posterior
impl Unpin for Posterior
impl UnwindSafe for Posterior
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.