Skip to main content

CausalQuery

Enum CausalQuery 

Source
#[non_exhaustive]
pub enum CausalQuery {
Show 14 variants AverageEffect(AverageEffectQuery), TemporalEffect(TemporalEffectQuery), Counterfactual(CounterfactualQuery), AnomalyAttribution(AnomalyAttributionQuery), ChangeAttribution(ChangeAttributionQuery), MechanismChange(MechanismChangeQuery), UnitChange(UnitChangeQuery), Mediation(MediationQuery), ConditionalEffect(ConditionalEffectQuery), Distribution(InterventionalDistributionQuery), PathSpecific(PathSpecificEffectQuery), Response(ResponseQuery), Transport(TransportQuery), Interference(InterferenceQuery),
}
Expand description

Top-level causal query enum.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

AverageEffect(AverageEffectQuery)

Average / population effect (static).

§

TemporalEffect(TemporalEffectQuery)

Temporal effect over a discrete horizon.

§

Counterfactual(CounterfactualQuery)

Counterfactual / unit-level what-if query .

§

AnomalyAttribution(AnomalyAttributionQuery)

Anomaly attribution for one or more units .

§

ChangeAttribution(ChangeAttributionQuery)

Distribution / population change attribution .

§

MechanismChange(MechanismChangeQuery)

Mechanism-change detection — not attribution .

§

UnitChange(UnitChangeQuery)

Per-unit change attribution .

§

Mediation(MediationQuery)

Mediation (direct / mediated / natural effects).

§

ConditionalEffect(ConditionalEffectQuery)

Conditional average effect given modifiers.

§

Distribution(InterventionalDistributionQuery)

Interventional distribution P(Y | do(…)).

§

PathSpecific(PathSpecificEffectQuery)

Path-specific effect / contribution.

§

Response(ResponseQuery)

Continuous response, derivative, policy response, or Jacobian.

§

Transport(TransportQuery)

Structurally transported response between populations.

§

Interference(InterferenceQuery)

Randomization-based causal effect under interference.

Implementations§

Source§

impl CausalQuery

Source

pub fn average_effect(query: AverageEffectQuery) -> Self

Construct an average-effect query.

Source

pub fn temporal_effect(query: TemporalEffectQuery) -> Self

Construct a temporal-effect query.

Source

pub fn counterfactual(query: CounterfactualQuery) -> Self

Construct a counterfactual query.

Source

pub fn anomaly_attribution(query: AnomalyAttributionQuery) -> Self

Construct an anomaly attribution query.

Source

pub fn change_attribution(query: ChangeAttributionQuery) -> Self

Construct a change attribution query.

Source

pub fn mechanism_change(query: MechanismChangeQuery) -> Self

Construct a mechanism-change detection query.

Source

pub fn unit_change(query: UnitChangeQuery) -> Self

Construct a unit-change attribution query.

Source

pub fn mediation(query: MediationQuery) -> Self

Construct a mediation query.

Source

pub fn conditional_effect(query: ConditionalEffectQuery) -> Self

Construct a conditional-effect query.

Source

pub fn distribution(query: InterventionalDistributionQuery) -> Self

Construct an interventional-distribution query.

Source

pub fn path_specific(query: PathSpecificEffectQuery) -> Self

Construct a path-specific effect query.

Source

pub fn response(query: ResponseQuery) -> Self

Construct a continuous-response query.

Source

pub fn transport(query: TransportQuery) -> Self

Construct a transportability query.

Source

pub fn interference(query: InterferenceQuery) -> Self

Construct an interference query.

Source§

impl CausalQuery

Source

pub const fn is_static_ate(&self) -> bool

Whether this query is the static ATE path.

Source

pub const fn is_temporal_effect(&self) -> bool

Whether this query is a temporal effect.

Source

pub const fn is_counterfactual(&self) -> bool

Whether this query is counterfactual.

Source

pub const fn is_mediation(&self) -> bool

Whether this query is mediation.

Source

pub const fn is_conditional_effect(&self) -> bool

Whether this query is a conditional effect.

Source

pub const fn is_distribution(&self) -> bool

Whether this query is an interventional distribution.

Source

pub const fn is_path_specific(&self) -> bool

Whether this query is path-specific.

Source

pub fn validate(&self) -> Result<(), QueryError>

Validate the inner query.

§Errors

Propagates inner QueryError.

Trait Implementations§

Source§

impl Clone for CausalQuery

Source§

fn clone(&self) -> CausalQuery

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CausalQuery

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<AnomalyAttributionQuery> for CausalQuery

Source§

fn from(query: AnomalyAttributionQuery) -> Self

Converts to this type from the input type.
Source§

impl From<AverageEffectQuery> for CausalQuery

Source§

fn from(query: AverageEffectQuery) -> Self

Converts to this type from the input type.
Source§

impl From<ChangeAttributionQuery> for CausalQuery

Source§

fn from(query: ChangeAttributionQuery) -> Self

Converts to this type from the input type.
Source§

impl From<ConditionalEffectQuery> for CausalQuery

Source§

fn from(query: ConditionalEffectQuery) -> Self

Converts to this type from the input type.
Source§

impl From<CounterfactualQuery> for CausalQuery

Source§

fn from(query: CounterfactualQuery) -> Self

Converts to this type from the input type.
Source§

impl From<InterferenceQuery> for CausalQuery

Source§

fn from(query: InterferenceQuery) -> Self

Converts to this type from the input type.
Source§

impl From<InterventionalDistributionQuery> for CausalQuery

Source§

fn from(query: InterventionalDistributionQuery) -> Self

Converts to this type from the input type.
Source§

impl From<MechanismChangeQuery> for CausalQuery

Source§

fn from(query: MechanismChangeQuery) -> Self

Converts to this type from the input type.
Source§

impl From<MediationQuery> for CausalQuery

Source§

fn from(query: MediationQuery) -> Self

Converts to this type from the input type.
Source§

impl From<PathSpecificEffectQuery> for CausalQuery

Source§

fn from(query: PathSpecificEffectQuery) -> Self

Converts to this type from the input type.
Source§

impl From<ResponseQuery> for CausalQuery

Source§

fn from(query: ResponseQuery) -> Self

Converts to this type from the input type.
Source§

impl From<TemporalEffectQuery> for CausalQuery

Source§

fn from(query: TemporalEffectQuery) -> Self

Converts to this type from the input type.
Source§

impl From<TransportQuery> for CausalQuery

Source§

fn from(query: TransportQuery) -> Self

Converts to this type from the input type.
Source§

impl From<UnitChangeQuery> for CausalQuery

Source§

fn from(query: UnitChangeQuery) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for CausalQuery

Source§

fn eq(&self, other: &CausalQuery) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CausalQuery

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.