pub struct TemporalEffectQuery {
pub treatment: VariableId,
pub outcome: VariableId,
pub policy: TemporalPolicy,
pub control: Intervention,
pub active: Intervention,
pub horizon_steps: u32,
pub max_history_lag: Option<u32>,
pub target_population: TargetPopulation,
}Expand description
Temporal effect query over a discrete horizon.
Fields§
§treatment: VariableIdTreatment variable.
outcome: VariableIdOutcome variable.
policy: TemporalPolicyTemporal intervention policy.
control: InterventionControl intervention level on the treatment variable.
active: InterventionActive intervention level on the treatment variable.
horizon_steps: u32Outcome horizon in time steps after the policy origin (must be ≥ 1).
max_history_lag: Option<u32>Optional max history lag (steps) to retain when unfolding; None = planner default.
target_population: TargetPopulationTarget population.
Implementations§
Source§impl TemporalEffectQuery
impl TemporalEffectQuery
Sourcepub fn pulse(
treatment: VariableId,
outcome: VariableId,
active_level: f64,
) -> Self
pub fn pulse( treatment: VariableId, outcome: VariableId, active_level: f64, ) -> Self
Pulse intervention at step 0 with active float level; control is 0.0.
Sourcepub fn sustained(
treatment: VariableId,
outcome: VariableId,
until: i32,
active_level: f64,
) -> Self
pub fn sustained( treatment: VariableId, outcome: VariableId, until: i32, active_level: f64, ) -> Self
Sustained intervention on [0, until] with active float level; control is 0.0.
Sourcepub const fn with_horizon_steps(self, horizon_steps: u32) -> Self
pub const fn with_horizon_steps(self, horizon_steps: u32) -> Self
Set outcome evaluation horizon in time steps.
Sourcepub const fn with_max_history_lag(self, max_history_lag: Option<u32>) -> Self
pub const fn with_max_history_lag(self, max_history_lag: Option<u32>) -> Self
Set optional max history lag for unfolding.
Sourcepub fn with_policy(self, policy: TemporalPolicy) -> Self
pub fn with_policy(self, policy: TemporalPolicy) -> Self
Replace the temporal policy.
Sourcepub fn with_target_population(self, population: TargetPopulation) -> Self
pub fn with_target_population(self, population: TargetPopulation) -> Self
Set target population.
Sourcepub fn validate(&self) -> Result<(), QueryError>
pub fn validate(&self) -> Result<(), QueryError>
Validate treatment/outcome, interventions, policy, and horizon.
§Errors
Returns QueryError on inconsistent configuration.
Sourcepub fn treatment_offset(&self) -> i32
pub fn treatment_offset(&self) -> i32
Treatment time offset for Pulse at / Sustained from / Dynamic first active step.
Sourcepub fn try_treatment_offset(&self) -> Result<i32, QueryError>
pub fn try_treatment_offset(&self) -> Result<i32, QueryError>
Treatment time offset when the policy has a defined origin.
§Errors
QueryError::DynamicPolicyHasNoTreatmentOffset for an empty dynamic schedule.
Sourcepub fn outcome_offset(&self) -> i32
pub fn outcome_offset(&self) -> i32
Outcome evaluation offset: horizon_steps - 1 (absolute from window origin).
Trait Implementations§
Source§impl Clone for TemporalEffectQuery
impl Clone for TemporalEffectQuery
Source§fn clone(&self) -> TemporalEffectQuery
fn clone(&self) -> TemporalEffectQuery
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more