class_docstr: Main class for storing the causal model state.
docstr: Estimate the identified causal effect.
  
  Currently requires an explicit method name to be specified. Method names follow the convention of identification method followed by the specific estimation method: "[backdoor/iv/frontdoor].estimation_method_name". For a list of supported methods, check out the :doc:`User Guide </user_guide/causal_tasks/estimating_causal_effects/index>`. Here are some examples.
  
      * Propensity Score Matching: "backdoor.propensity_score_matching"
      * Propensity Score Stratification: "backdoor.propensity_score_stratification"
      * Propensity Score-based Inverse Weighting: "backdoor.propensity_score_weighting"
      * Linear Regression: "backdoor.linear_regression"
      * Generalized Linear Models (e.g., logistic regression): "backdoor.generalized_linear_model"
      * Instrumental Variables: "iv.instrumental_variable"
      * Regression Discontinuity: "iv.regression_discontinuity"
      * Two Stage Regression: "frontdoor.two_stage_regression"
  
  In addition, you can directly call any of the EconML estimation methods. The convention is "[backdoor/iv].econml.path-to-estimator-class". For example, for the double machine learning estimator ("DML" class) that is located inside "dml" module of EconML, you can use the method name, "backdoor.econml.dml.DML". See :doc:`this demo notebook </example_notebooks/dowhy-conditional-treatment-effects>`.
  
  
  :param identified_estimand: a probability expression
      that represents the effect to be estimated. Output of
      CausalModel.identify_effect method
  :param method_name: name of the estimation method to be used.
  :param control_value: Value of the treatment in the control group, for effect estimation.  If treatment is multi-variate, this can be a list.
  :param treatment_value: Value of the treatment in the treated group, for effect estimation. If treatment is multi-variate, this can be a list.
  :param test_significance: Binary flag on whether to additionally do a statistical signficance test for the estimate.
  :param evaluate_effect_strength: (Experimental) Binary flag on whether to estimate the relative strength of the treatment's effect. This measure can be used to compare different treatments for the same outcome (by running this method with different treatments sequentially).
  :param confidence_intervals: (Experimental) Binary flag indicating whether confidence intervals should be computed.
  :param target_units: (Experimental) The units for which the treatment effect should be estimated. This can be of three types. (1) a string for common specifications of target units (namely, "ate", "att" and "atc"), (2) a lambda function that can be used as an index for the data (pandas DataFrame), or (3) a new DataFrame that contains values of the effect_modifiers and effect will be estimated only for this new data.
  :param effect_modifiers: Names of effect modifier variables can be (optionally) specified here too, since they do not affect identification. If None, the effect_modifiers from the CausalModel are used.
  :param fit_estimator: Boolean flag on whether to fit the estimator.
      Setting it to False is useful to estimate the effect on new data using a previously fitted estimator.
  :param method_params: Dictionary containing any method-specific parameters. These are passed directly to the estimating method. See the docs for each estimation method for allowed method-specific params.
  :returns: An instance of the CausalEstimate class, containing the causal effect estimate
      and other method-dependent information
docstr_tok: ["Estimate","the","identified","causal","effect",".","Currently","requires","an","explicit","method","name","to","be","specified",".","Method","names","follow","the","convention","of","identification","method","followed","by","the","specific","estimation","method",":","``","[","backdoor\/iv\/frontdoor","]",".estimation_method_name","''",".","For","a","list","of","supported","methods",",","check","out","the",":","doc",":","`","User","Guide","<","\/user_guide\/causal_tasks\/estimating_causal_effects\/index",">","`",".","Here","are","some","examples",".","*","Propensity","Score","Matching",":","``","backdoor.propensity_score_matching","''","*","Propensity","Score","Stratification",":","``","backdoor.propensity_score_stratification","''","*","Propensity","Score-based","Inverse","Weighting",":","``","backdoor.propensity_score_weighting","''","*","Linear","Regression",":","``","backdoor.linear_regression","''","*","Generalized","Linear","Models","(","e.g.",",","logistic","regression",")",":","``","backdoor.generalized_linear_model","''","*","Instrumental","Variables",":","``","iv.instrumental_variable","''","*","Regression","Discontinuity",":","``","iv.regression_discontinuity","''","*","Two","Stage","Regression",":","``","frontdoor.two_stage_regression","''","In","addition",",","you","can","directly","call","any","of","the","EconML","estimation","methods",".","The","convention","is","``","[","backdoor\/iv","]",".econml.path-to-estimator-class","''",".","For","example",",","for","the","double","machine","learning","estimator","(","``","DML","''","class",")","that","is","located","inside","``","dml","''","module","of","EconML",",","you","can","use","the","method","name",",","``","backdoor.econml.dml.DML","''",".","See",":","doc",":","`","this","demo","notebook","<","\/example_notebooks\/dowhy-conditional-treatment-effects",">","`",".",":","param","identified_estimand",":","a","probability","expression","that","represents","the","effect","to","be","estimated",".","Output","of","CausalModel.identify_effect","method",":","param","method_name",":","name","of","the","estimation","method","to","be","used",".",":","param","control_value",":","Value","of","the","treatment","in","the","control","group",",","for","effect","estimation",".","If","treatment","is","multi-variate",",","this","can","be","a","list",".",":","param","treatment_value",":","Value","of","the","treatment","in","the","treated","group",",","for","effect","estimation",".","If","treatment","is","multi-variate",",","this","can","be","a","list",".",":","param","test_significance",":","Binary","flag","on","whether","to","additionally","do","a","statistical","signficance","test","for","the","estimate",".",":","param","evaluate_effect_strength",":","(","Experimental",")","Binary","flag","on","whether","to","estimate","the","relative","strength","of","the","treatment","'s","effect",".","This","measure","can","be","used","to","compare","different","treatments","for","the","same","outcome","(","by","running","this","method","with","different","treatments","sequentially",")",".",":","param","confidence_intervals",":","(","Experimental",")","Binary","flag","indicating","whether","confidence","intervals","should","be","computed",".",":","param","target_units",":","(","Experimental",")","The","units","for","which","the","treatment","effect","should","be","estimated",".","This","can","be","of","three","types",".","(","1",")","a","string","for","common","specifications","of","target","units","(","namely",",","``","ate","''",",","``","att","''","and","``","atc","''",")",",","(","2",")","a","lambda","function","that","can","be","used","as","an","index","for","the","data","(","pandas","DataFrame",")",",","or","(","3",")","a","new","DataFrame","that","contains","values","of","the","effect_modifiers","and","effect","will","be","estimated","only","for","this","new","data",".",":","param","effect_modifiers",":","Names","of","effect","modifier","variables","can","be","(","optionally",")","specified","here","too",",","since","they","do","not","affect","identification",".","If","None",",","the","effect_modifiers","from","the","CausalModel","are","used",".",":","param","fit_estimator",":","Boolean","flag","on","whether","to","fit","the","estimator",".","Setting","it","to","False","is","useful","to","estimate","the","effect","on","new","data","using","a","previously","fitted","estimator",".",":","param","method_params",":","Dictionary","containing","any","method-specific","parameters",".","These","are","passed","directly","to","the","estimating","method",".","See","the","docs","for","each","estimation","method","for","allowed","method-specific","params",".",":","returns",":","An","instance","of","the","CausalEstimate","class",",","containing","the","causal","effect","estimate","and","other","method-dependent","information"]
code: def estimate_effect(
      self,
      identified_estimand,
      method_name=None,
      control_value=0,
      treatment_value=1,
      test_significance=None,
      evaluate_effect_strength=False,
      confidence_intervals=False,
      target_units="ate",
      effect_modifiers=None,
      fit_estimator=True,
      method_params=None,
  ):
      """Estimate the identified causal effect.
  
      Currently requires an explicit method name to be specified. Method names follow the convention of identification method followed by the specific estimation method: "[backdoor/iv/frontdoor].estimation_method_name". For a list of supported methods, check out the :doc:`User Guide </user_guide/causal_tasks/estimating_causal_effects/index>`. Here are some examples.
  
          * Propensity Score Matching: "backdoor.propensity_score_matching"
          * Propensity Score Stratification: "backdoor.propensity_score_stratification"
          * Propensity Score-based Inverse Weighting: "backdoor.propensity_score_weighting"
          * Linear Regression: "backdoor.linear_regression"
          * Generalized Linear Models (e.g., logistic regression): "backdoor.generalized_linear_model"
          * Instrumental Variables: "iv.instrumental_variable"
          * Regression Discontinuity: "iv.regression_discontinuity"
          * Two Stage Regression: "frontdoor.two_stage_regression"
  
      In addition, you can directly call any of the EconML estimation methods. The convention is "[backdoor/iv].econml.path-to-estimator-class". For example, for the double machine learning estimator ("DML" class) that is located inside "dml" module of EconML, you can use the method name, "backdoor.econml.dml.DML". See :doc:`this demo notebook </example_notebooks/dowhy-conditional-treatment-effects>`.
  
  
      :param identified_estimand: a probability expression
          that represents the effect to be estimated. Output of
          CausalModel.identify_effect method
      :param method_name: name of the estimation method to be used.
      :param control_value: Value of the treatment in the control group, for effect estimation.  If treatment is multi-variate, this can be a list.
      :param treatment_value: Value of the treatment in the treated group, for effect estimation. If treatment is multi-variate, this can be a list.
      :param test_significance: Binary flag on whether to additionally do a statistical signficance test for the estimate.
      :param evaluate_effect_strength: (Experimental) Binary flag on whether to estimate the relative strength of the treatment's effect. This measure can be used to compare different treatments for the same outcome (by running this method with different treatments sequentially).
      :param confidence_intervals: (Experimental) Binary flag indicating whether confidence intervals should be computed.
      :param target_units: (Experimental) The units for which the treatment effect should be estimated. This can be of three types. (1) a string for common specifications of target units (namely, "ate", "att" and "atc"), (2) a lambda function that can be used as an index for the data (pandas DataFrame), or (3) a new DataFrame that contains values of the effect_modifiers and effect will be estimated only for this new data.
      :param effect_modifiers: Names of effect modifier variables can be (optionally) specified here too, since they do not affect identification. If None, the effect_modifiers from the CausalModel are used.
      :param fit_estimator: Boolean flag on whether to fit the estimator.
          Setting it to False is useful to estimate the effect on new data using a previously fitted estimator.
      :param method_params: Dictionary containing any method-specific parameters. These are passed directly to the estimating method. See the docs for each estimation method for allowed method-specific params.
      :returns: An instance of the CausalEstimate class, containing the causal effect estimate
          and other method-dependent information
  
      """
  
      if effect_modifiers is None:
          effect_modifiers = self._graph.get_effect_modifiers(
              self._treatment, self._outcome
          )
  
      if method_name is None:
          # TODO add propensity score as default backdoor method, iv as default iv method, add an informational message to show which method has been selected.
          pass
      else:
          # TODO add dowhy as a prefix to all dowhy estimators
          num_components = len(method_name.split("."))
          str_arr = method_name.split(".", maxsplit=1)
          identifier_name = str_arr[0]
          estimator_name = str_arr[1]
          # This is done as all dowhy estimators have two parts and external ones have two or more parts
          if num_components > 2:
              estimator_package = estimator_name.split(".")[0]
              if (
                  estimator_package == "dowhy"
              ):  # For updated dowhy methods
                  estimator_method = estimator_name.split(
                      ".", maxsplit=1
                  )[
                      1
                  ]  # discard dowhy from the full package name
                  causal_estimator_class = (
                      causal_estimators.get_class_object(
                          estimator_method + "_estimator"
                      )
                  )
              else:
                  third_party_estimator_package = estimator_package
                  causal_estimator_class = (
                      causal_estimators.get_class_object(
                          third_party_estimator_package, estimator_name
                      )
                  )
                  if method_params is None:
                      method_params = {}
                  # Define the third-party estimation method to be used
                  method_params[
                      third_party_estimator_package + "_estimator"
                  ] = estimator_name
          else:  # For older dowhy methods
              self.logger.info(estimator_name)
              # Process the dowhy estimators
              causal_estimator_class = (
                  causal_estimators.get_class_object(
                      estimator_name + "_estimator"
                  )
              )
  
          if method_params is not None and (
              num_components <= 2 or estimator_package == "dowhy"
          ):
              extra_args = method_params.get("init_params", {})
          else:
              extra_args = {}
          if method_params is None:
              method_params = {}
  
          identified_estimand.set_identifier_method(identifier_name)
  
          # If not fit_estimator, attempt to retrieve existing estimator.
          # Keep original behaviour to create new estimator if none found.
          causal_estimator = None
          if not fit_estimator:
              causal_estimator = self.get_estimator(method_name)
  
          if causal_estimator is None:
              causal_estimator = causal_estimator_class(
                  identified_estimand,
                  test_significance=test_significance,
                  evaluate_effect_strength=evaluate_effect_strength,
                  confidence_intervals=confidence_intervals,
                  **method_params,
                  **extra_args,
              )
  
              self._estimator_cache[method_name] = causal_estimator
  
      return estimate_effect(
          self._data,
          self._treatment,
          self._outcome,
          identifier_name,
          causal_estimator,
          control_value,
          treatment_value,
          target_units,
          effect_modifiers,
          fit_estimator,
          method_params,
      )
  
imports: import logging
  import typing
  import warnings
  from itertools import combinations
  from sympy import init_printing
  import dowhy.causal_estimators
  import dowhy.causal_refuters
  import dowhy.graph_learners
  from dowhy.causal_estimator import CausalEstimate, estimate_effect
  from dowhy.causal_graph import CausalGraph
  from dowhy.causal_identifier import AutoIdentifier, BackdoorAdjustment, IDIdentifier
  from dowhy.causal_identifier.identify_effect import EstimandType
  from dowhy.causal_refuters.graph_refuter import GraphRefuter
  from dowhy.utils.api import parse_state
label_desc: Use image node_id 9 for calling the CausalModel obj's underlying member method code with example usage: obj.estimate_effect(identified_estimand, method_name, control_value, treatment_value, test_significance, evaluate_effect_strength, confidence_intervals, target_units, effect_modifiers, fit_estimator, method_params) and returns: estimate_effect