pub struct Posterior {
pub delta_post: Vector9,
pub lambda_post: Matrix9,
pub delta_draws: Vec<Vector9>,
pub leak_probability: f64,
pub theta: 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.
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.
delta_draws: Vec<Vector9>Retained δ draws from the Gibbs sampler.
Used for effect estimation via compute_effect_estimate.
leak_probability: f64Leak probability: P(max_k |δ_k| > θ | Δ). Computed via Monte Carlo integration over the 9D posterior.
theta: f64Effect threshold used for leak probability computation.
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,
delta_draws: Vec<Vector9>,
leak_probability: f64,
theta: f64,
n: usize,
) -> Self
pub fn new( delta_post: Vector9, lambda_post: Matrix9, delta_draws: Vec<Vector9>, leak_probability: f64, theta: f64, n: usize, ) -> Self
Create a new posterior with given parameters.
Sourcepub fn new_with_gibbs(
delta_post: Vector9,
lambda_post: Matrix9,
delta_draws: Vec<Vector9>,
leak_probability: f64,
theta: 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, delta_draws: Vec<Vector9>, leak_probability: f64, theta: 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 from posterior mean.
Sourcepub fn to_effect_estimate(&self) -> EffectEstimate
pub fn to_effect_estimate(&self) -> EffectEstimate
Build an EffectEstimate from this posterior.
Uses delta draws if available, otherwise uses analytical approximation.
Sourcepub fn measurement_quality(&self) -> MeasurementQuality
pub fn measurement_quality(&self) -> MeasurementQuality
Get measurement quality based on the posterior uncertainty.
Quality is determined by the minimum detectable effect (MDE), which is approximately the maximum marginal standard deviation.
Sourcepub fn to_summary(&self) -> PosteriorSummary
pub fn to_summary(&self) -> PosteriorSummary
Convert to an FFI-friendly summary containing only scalar fields.
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.