pub struct PriorSensitivity {
pub scales: Arc<[f64]>,
pub alphas: Arc<[f64]>,
pub max_relative_range: f64,
}Expand description
Prior sensitivity grid: isotropic scales or external α multipliers.
Fields§
§scales: Arc<[f64]>Prior scales (σ of isotropic Gaussian coefficient prior). Empty in α mode.
alphas: Arc<[f64]>Multipliers on post-conflict applied alphas. Empty in isotropic scale mode.
max_relative_range: f64Fail when (max−min) / scale exceeds this, where scale is
max(|means…|, |original_ate|, ε).
Implementations§
Source§impl PriorSensitivity
impl PriorSensitivity
Sourcepub fn standard_grid() -> Self
pub fn standard_grid() -> Self
Standard isotropic grid {0.5, 1, 2, 5, 10, 20} with DEFAULT_MAX_RELATIVE_PRIOR_RANGE.
Sourcepub fn standard_alpha_grid() -> Self
pub fn standard_alpha_grid() -> Self
Standard external-α multiplier grid {0, 0.25, 0.5, 0.75, 1}.
Multiplier 0 is baseline-only; 1 uses full post-conflict applied alphas.
Sourcepub fn evaluate(
&self,
estimator: &BayesianGComputationAte,
problem: &PreparedBayesianProblem,
identification: IdentificationStatus,
workspace: &mut BayesianGCompWorkspace,
ctx: &ExecutionContext,
) -> Result<(PriorSensitivitySummary, Vec<CausalPosterior>), ValidationError>
pub fn evaluate( &self, estimator: &BayesianGComputationAte, problem: &PreparedBayesianProblem, identification: IdentificationStatus, workspace: &mut BayesianGCompWorkspace, ctx: &ExecutionContext, ) -> Result<(PriorSensitivitySummary, Vec<CausalPosterior>), ValidationError>
Refit Bayesian g-comp at each prior scale; return sensitivity summary.
§Errors
Fit failures or empty scale grid.
Sourcepub fn evaluate_external_alpha(
&self,
estimator: &BayesianGComputationAte,
problem: &PreparedBayesianProblem,
identification: IdentificationStatus,
workspace: &mut BayesianGCompWorkspace,
ctx: &ExecutionContext,
external: ExternalAlphaSensitivity<'_>,
) -> Result<(PriorSensitivitySummary, Vec<CausalPosterior>), ValidationError>
pub fn evaluate_external_alpha( &self, estimator: &BayesianGComputationAte, problem: &PreparedBayesianProblem, identification: IdentificationStatus, workspace: &mut BayesianGCompWorkspace, ctx: &ExecutionContext, external: ExternalAlphaSensitivity<'_>, ) -> Result<(PriorSensitivitySummary, Vec<CausalPosterior>), ValidationError>
Refit at each α-multiplier on post-conflict applied alphas (external prior bank).
For multiplier m, composed alphas are m * alphas_applied[k] (clamped to [0, 1]).
§Errors
Empty α grid, length mismatch, compose failures, or fit failures.
Sourcepub fn to_report(
&self,
summary: &PriorSensitivitySummary,
original_ate: f64,
) -> RefutationReport
pub fn to_report( &self, summary: &PriorSensitivitySummary, original_ate: f64, ) -> RefutationReport
Convert sensitivity range into a refutation-style report.
Passes when the relative range of effect means is finite and
≤ max_relative_range.
Trait Implementations§
Source§impl Clone for PriorSensitivity
impl Clone for PriorSensitivity
Source§fn clone(&self) -> PriorSensitivity
fn clone(&self) -> PriorSensitivity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PriorSensitivity
impl Debug for PriorSensitivity
Auto Trait Implementations§
impl Freeze for PriorSensitivity
impl RefUnwindSafe for PriorSensitivity
impl Send for PriorSensitivity
impl Sync for PriorSensitivity
impl Unpin for PriorSensitivity
impl UnsafeUnpin for PriorSensitivity
impl UnwindSafe for PriorSensitivity
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> ForeignBufferOwner for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more