Skip to content

Commit

Permalink
fixed double counting in bootstrap conf interval
Browse files Browse the repository at this point in the history
Signed-off-by: Amit Sharma <amit_sharma@live.com>
  • Loading branch information
amit-sharma committed Dec 21, 2023
1 parent e18d0f3 commit fbe99f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dowhy/causal_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def _estimate_confidence_intervals_with_bootstrap(
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)th and the (p)th variations, where p is the chosen confidence level
# 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))
Expand Down

0 comments on commit fbe99f8

Please sign in to comment.