和顺 / 知几 返回所属 Agent
ZJ-05.03

解释差异

原能力

找出竞争解释对未来观察作出的不同预期,供反证和情景角色使用。(细化版 p.4–5)

首选项目

DoWhy(MIT)。 DoWhy

匹配范围

Identification/refutation 比较已定义因果模型的行为。

源码

DoWhy · def refute_estimate(

dowhy/causal_model.py · 474–487 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
    def refute_estimate(self, estimand, estimate, method_name=None, show_progress_bar=False, **kwargs):
        """Refute an estimated causal effect.

        method_name must be specified. Examples of refutation methods include:
            * Adding a randomly-generated confounder: "random_common_cause"
            * Adding a confounder that is associated with both treatment and outcome: "add_unobserved_common_cause"
            * Replacing the treatment with a placebo (random) variable): "placebo_treatment_refuter"
            * Removing a random subset of the data: "data_subset_refuter"
            * Bootstrap the data: "bootstrap_refuter"
            * Replace outcome with a dummy (random) variable: "dummy_outcome_refuter"
        For available refuters, see modules under dowhy.causal_refuters.

        :param estimand: target estimand, an instance of the IdentifiedEstimand class
            (typically the output of identify_effect)

DoWhy · def identify_effect(

dowhy/causal_model.py · 234–247 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
    def identify_effect(
        self, estimand_type=None, method_name="default", proceed_when_unidentifiable=None, optimize_backdoor=False
    ):
        """Identify the causal effect to be estimated, using properties of the causal graph.

        :param method_name: Method name for identification algorithm. ("id-algorithm" or "default")
        :param proceed_when_unidentifiable: Binary flag indicating whether identification should proceed in the presence of (potential) unobserved confounders.
        :returns: a probability expression (estimand) for the causal effect if identified, else NULL

        """
        if proceed_when_unidentifiable is None:
            proceed_when_unidentifiable = self._proceed_when_unidentifiable
        if estimand_type is None:
            estimand_type = self._estimand_type

实现与验收要点

从候选机制推导可区分的后续观测并组织实证。