pub struct SimulationBasedCalibration {
pub n_reps: u32,
pub n_draws: usize,
pub seed: u64,
}Expand description
Simulation-based calibration ranks for a scalar posterior functional.
For each replicate: draw θ* from the prior predictive, simulate data, refit, and record the rank of θ* among posterior draws of the primary effect.
Fields§
§n_reps: u32Number of SBC replicates.
n_draws: usizeDraws per refit.
seed: u64RNG seed.
Implementations§
Source§impl SimulationBasedCalibration
impl SimulationBasedCalibration
Sourcepub fn check(
&self,
estimator: &BayesianGComputationAte,
problem: &PreparedBayesianProblem,
identification: IdentificationStatus,
workspace: &mut BayesianGCompWorkspace,
ctx: &ExecutionContext,
) -> Result<SbcReport, ValidationError>
pub fn check( &self, estimator: &BayesianGComputationAte, problem: &PreparedBayesianProblem, identification: IdentificationStatus, workspace: &mut BayesianGCompWorkspace, ctx: &ExecutionContext, ) -> Result<SbcReport, ValidationError>
Run SBC: draw θ from the prior, simulate y from the prior predictive under
the fixed design matrix, refit the Bayesian g-computation estimator, and
rank the true ATE among posterior effect draws.
§Errors
Fit failures.
Sourcepub fn to_report(
&self,
report: &SbcReport,
original_ate: f64,
) -> RefutationReport
pub fn to_report( &self, report: &SbcReport, original_ate: f64, ) -> RefutationReport
Convert to a refutation report.
Passes only when both hold:
- the mean rank fraction is in
[0.35, 0.65](catches gross location bias), and - the χ² uniformity statistic over the 10 rank bins is below
SBC_CHI2_CRITICAL_9DF_P99(catches symmetric-about-0.5 U/M-shaped rank distributions — overdispersed / underdispersed posteriors — that a mean-only band cannot see because they average out to ≈0.5).
Trait Implementations§
Source§impl Clone for SimulationBasedCalibration
impl Clone for SimulationBasedCalibration
Source§fn clone(&self) -> SimulationBasedCalibration
fn clone(&self) -> SimulationBasedCalibration
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SimulationBasedCalibration
impl Debug for SimulationBasedCalibration
Auto Trait Implementations§
impl Freeze for SimulationBasedCalibration
impl RefUnwindSafe for SimulationBasedCalibration
impl Send for SimulationBasedCalibration
impl Sync for SimulationBasedCalibration
impl Unpin for SimulationBasedCalibration
impl UnsafeUnpin for SimulationBasedCalibration
impl UnwindSafe for SimulationBasedCalibration
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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