class_docstr: Base class for an estimator of causal effect.
  
  Subclasses implement different estimation methods. All estimation methods are in the package "dowhy.causal_estimators"
class_docstr_tok: ["Base","class","for","an","estimator","of","causal","effect",".","Subclasses","implement","different","estimation","methods",".","All","estimation","methods","are","in","the","package","``","dowhy.causal_estimators","''"]
docstr: Method to compute confidence interval using bootstrapped sampling.
  
  :param estimate_value: obtained estimate's value
  :param confidence_level: The level for which to compute CI (e.g., 95% confidence level translates to confidence_level=0.95)
  :param num_simulations: The number of simulations to be performed to get the bootstrap confidence intervals.
  :param sample_size_fraction: The fraction of the dataset to be resampled.
  :returns: confidence interval at the specified level.
  
  For more details on bootstrap or resampling statistics, refer to the following links:
  https://ocw.mit.edu/courses/mathematics/18-05-introduction-to-probability-and-statistics-spring-2014/readings/MIT18_05S14_Reading24.pdf
  https://projecteuclid.org/download/pdf_1/euclid.ss/1032280214
code: def _estimate_confidence_intervals_with_bootstrap(
      self,
      data: pd.DataFrame,
      estimate_value,
      confidence_level=None,
      num_simulations=None,
      sample_size_fraction=None,
  ):
      """
      Method to compute confidence interval using bootstrapped sampling.
  
      :param estimate_value: obtained estimate's value
      :param confidence_level: The level for which to compute CI (e.g., 95% confidence level translates to confidence_level=0.95)
      :param num_simulations: The number of simulations to be performed to get the bootstrap confidence intervals.
      :param sample_size_fraction: The fraction of the dataset to be resampled.
      :returns: confidence interval at the specified level.
  
      For more details on bootstrap or resampling statistics, refer to the following links:
      https://ocw.mit.edu/courses/mathematics/18-05-introduction-to-probability-and-statistics-spring-2014/readings/MIT18_05S14_Reading24.pdf
      https://projecteuclid.org/download/pdf_1/euclid.ss/1032280214
      """
      # Using class default parameters if not specified
      if num_simulations is None:
          num_simulations = self.num_simulations
      if sample_size_fraction is None:
          sample_size_fraction = self.sample_size_fraction
  
      # Checking if bootstrap_estimates are already computed
      if self._bootstrap_estimates is None:
          self._bootstrap_estimates = (
              self._generate_bootstrap_estimates(
                  data, num_simulations, sample_size_fraction
              )
          )
      elif CausalEstimator.is_bootstrap_parameter_changed(
          self._bootstrap_estimates.params, locals()
      ):
          # Checked if any parameter is changed from the previous std error estimate
          self._bootstrap_estimates = (
              self._generate_bootstrap_estimates(
                  data, num_simulations, sample_size_fraction
              )
          )
      # Now use the data obtained from the simulations to get the value of the confidence estimates
      bootstrap_estimates = self._bootstrap_estimates.estimates
      # Get the variations of each bootstrap estimate and sort
      bootstrap_variations = [
          bootstrap_estimate - estimate_value
          for bootstrap_estimate in bootstrap_estimates
      ]
      sorted_bootstrap_variations = np.sort(bootstrap_variations)
  
      # Now we take the (1-p)/2 th and the 1-(1-p)/2 th variations, where p is the chosen confidence level
      left_fraction = (1 - confidence_level) / 2
      right_fraction = 1 - left_fraction
      upper_bound_index = int(
          left_fraction * len(sorted_bootstrap_variations)
      )
      lower_bound_index = int(
          right_fraction * len(sorted_bootstrap_variations)
      )
  
      # Get the lower and upper bounds by subtracting the variations from the estimate
      lower_bound = (
          estimate_value
          - sorted_bootstrap_variations[lower_bound_index]
      )
      upper_bound = (
          estimate_value
          - sorted_bootstrap_variations[upper_bound_index]
      )
      return lower_bound, upper_bound
  
imports: import copy
  import logging
  from collections import namedtuple
  from typing import Dict, List, Optional, Union
  import numpy
  import pandas
  import sympy
  from sklearn.utils import resample
  import dowhy.interpreters
  from dowhy.causal_identifier.identified_estimand import IdentifiedEstimand
  from dowhy.utils.api import parse_state
label_desc: Use image node_id 12 for calling the CausalEstimator obj's underlying member method code with example usage: obj._estimate_confidence_intervals_with_bootstrap(data, estimate_value, confidence_level, num_simulations, sample_size_fraction) and returns: lower_bound,  upper_bound