riantr/moonbit_dowhy/estimators does not have a README file

    CausalEstimator

    pub struct CausalEstimator {
    target_estimand :
    IdentifiedEstimand

    kind : EstimatorKind
    weighting_scheme : WeightingScheme
    min_ps_score : Double
    max_ps_score : Double
    num_strata : Int
    clipping_threshold : Int
    instrument_name : String
    rd_variable_name : String
    rd_threshold_value : Double
    rd_bandwidth : Double
    rd_local_data :
    DataFrame
    ?
    model :
    OlsFit

    glm_model :
    GlmFit

    glm_family :
    GlmFamily

    encoders :
    Encoders

    features : Array[String]
    propensities : Array[Double]
    propensity_beta : Array[Double]
    adjustment_names : Array[String]
    effect_modifier_names : Array[String]
    treatment_name : String
    outcome_name : String
    treatment_value : Double
    control_value : Double
    confidence_level : Double
    num_simulations : Int
    sample_size_fraction : Double
    compute_confidence_intervals : Bool
    test_significance : Bool
    }

    A causal estimator.

    The estimator owns the identified estimand and the state that fit produced; estimate_effect turns a data frame into a CausalEstimate.

    CausalEstimator::adjustment_set

    fn CausalEstimator::adjustment_set(self : CausalEstimator) -> Array[String]

    The adjustment variables the estimator uses.

    CausalEstimator::doubly_robust

    fn CausalEstimator::doubly_robust(estimand :
    IdentifiedEstimand
    , min_ps_score : Double, max_ps_score : Double) -> CausalEstimator

    A doubly robust estimator.

    CausalEstimator::estimand

    The estimand the estimator was built for.

    CausalEstimator::estimate_effect

    fn CausalEstimator::estimate_effect(self : CausalEstimator, data :
    DataFrame
    , treatment_value : Double, control_value : Double, target_units : String) ->
    CausalEstimate

    Estimate the treatment effect.

    target_units is one of "ate", "att" or "atc".

    CausalEstimator::estimator_kind

    fn CausalEstimator::estimator_kind(self : CausalEstimator) -> EstimatorKind

    The algorithm of the estimator.

    CausalEstimator::fit

    fn CausalEstimator::fit(self : CausalEstimator, data :
    DataFrame
    , effect_modifier_names : Array[String]) -> Unit

    Fit the estimator on the given data.

    The estimator remembers the adjustment variables of its estimand, fits the model it needs and stores the propensity scores when it uses them.

    CausalEstimator::generalized_linear_model

    A generalised linear model estimator for the given estimand.

    The family decides the link of the model: a binomial family fits a logistic regression, a poisson family fits a count model and the gaussian family fits an ordinary least squares model.

    CausalEstimator::instrumental_variable

    fn CausalEstimator::instrumental_variable(estimand :
    IdentifiedEstimand
    , instrument_name : String) -> CausalEstimator

    An instrumental variable estimator.

    CausalEstimator::intervene

    fn CausalEstimator::intervene(self : CausalEstimator, value : Double, data :
    DataFrame
    ) -> Double

    The mean outcome of the intervention do(treatment = value).

    This is the port of the do operator of the upstream estimators: the treatment is set to the given value in every row of the data and the model predicts the outcome of the modified data.

    CausalEstimator::linear_regression

    An ordinary least squares estimator for the given estimand.

    CausalEstimator::outcome

    fn CausalEstimator::outcome(self : CausalEstimator) -> String

    The outcome column the estimator uses.

    CausalEstimator::propensity_score_matching

    A propensity score matching estimator.

    CausalEstimator::propensity_score_stratification

    fn CausalEstimator::propensity_score_stratification(estimand :
    IdentifiedEstimand
    , num_strata : Int, clipping_threshold : Int) -> CausalEstimator

    A propensity score stratification estimator.

    CausalEstimator::propensity_score_weighting

    fn CausalEstimator::propensity_score_weighting(estimand :
    IdentifiedEstimand
    , min_ps_score : Double, max_ps_score : Double, scheme : WeightingScheme) -> CausalEstimator

    An inverse propensity score weighting estimator.

    CausalEstimator::propensity_scores

    fn CausalEstimator::propensity_scores(self : CausalEstimator) -> Array[Double]

    The propensity scores the estimator computed.

    CausalEstimator::regression_discontinuity

    fn CausalEstimator::regression_discontinuity(estimand :
    IdentifiedEstimand
    , rd_variable_name : String, rd_threshold_value : Double, rd_bandwidth : Double) -> CausalEstimator

    A regression discontinuity estimator.

    CausalEstimator::set_compute_confidence_intervals

    fn CausalEstimator::set_compute_confidence_intervals(self : CausalEstimator, compute : Bool) -> Unit

    Ask the estimator to compute the confidence intervals.

    CausalEstimator::set_confidence_level

    fn CausalEstimator::set_confidence_level(self : CausalEstimator, level : Double) -> Unit

    Set the confidence level of the intervals.

    CausalEstimator::set_estimand

    Replace the estimand the estimator was built for.

    The refuters use this to estimate a different effect with the same estimator.

    CausalEstimator::set_num_simulations

    fn CausalEstimator::set_num_simulations(self : CausalEstimator, num_simulations : Int) -> Unit

    Set the number of bootstrap simulations.

    CausalEstimator::set_sample_size_fraction

    fn CausalEstimator::set_sample_size_fraction(self : CausalEstimator, fraction : Double) -> Unit

    Set the fraction of the sample a bootstrap resample takes.

    CausalEstimator::set_test_significance

    fn CausalEstimator::set_test_significance(self : CausalEstimator, do_test : Bool) -> Unit

    Ask the estimator to test the significance of the estimate.

    CausalEstimator::treatment

    fn CausalEstimator::treatment(self : CausalEstimator) -> String

    The treatment column the estimator uses.

    CausalEstimator::two_stage_regression

    A two stage regression estimator.

    CausalEstimator::with_estimand

    A copy of the estimator that estimates a different estimand.

    The refuters use this to re-estimate the effect with the same algorithm on modified data. The copy starts without any fitted state, so the estimator that was handed in keeps the model and the adjustment set it was fitted with.

    EstimatorKind

    pub enum EstimatorKind {
    LinearRegression
    PropensityScoreWeighting
    PropensityScoreMatching
    PropensityScoreStratification
    DoublyRobust
    InstrumentalVariable
    TwoStageRegression
    RegressionDiscontinuity
    GeneralizedLinearModel
    }

    The estimator family that DoWhy offers.

    The kind decides which algorithm fit and estimate_effect run; the estimator itself keeps the fitted state, exactly like the Python classes inherit from CausalEstimator.

    WeightingScheme

    pub enum WeightingScheme {
    IpsWeight
    IpsStabilizedWeight
    IpsNormalizedWeight
    }

    The weighting scheme of the propensity score weighting estimator.

    WeightingScheme::ips_normalized_weight

    fn WeightingScheme::ips_normalized_weight() -> WeightingScheme

    The normalised inverse propensity score weighting scheme.

    WeightingScheme::ips_stabilized_weight

    fn WeightingScheme::ips_stabilized_weight() -> WeightingScheme

    The stabilised inverse propensity score weighting scheme.

    WeightingScheme::ips_weight

    fn WeightingScheme::ips_weight() -> WeightingScheme

    The inverse propensity score weighting scheme.

    WeightingScheme::name

    fn WeightingScheme::name(self : WeightingScheme) -> String

    The name of the weighting scheme.

    DEFAULT_CONFIDENCE_LEVEL

    let DEFAULT_CONFIDENCE_LEVEL : Double

    The default confidence level.

    DEFAULT_NUMBER_OF_SIMULATIONS_CI

    let DEFAULT_NUMBER_OF_SIMULATIONS_CI : Int

    The default number of simulations used for the confidence intervals.

    DEFAULT_NUMBER_OF_SIMULATIONS_STAT_TEST

    let DEFAULT_NUMBER_OF_SIMULATIONS_STAT_TEST : Int

    The default number of simulations used for the significance test.

    NUM_QUANTILES_TO_DISCRETIZE_CONT_COLS

    let NUM_QUANTILES_TO_DISCRETIZE_CONT_COLS : Int

    The default number of quantiles a continuous effect modifier is split into.

    Powered by MoonBit

    Site sourceReport issueModulesSkillsBuild queueStatistics

    © 2026 mooncakes.io