You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to reproduce the experimental results of this example A Simple Example on Creating a Custom Refutation Using User-Defined Outcome Functions and replace it with a different refuter, i.e.placebo_treatment_refuter. Here is the graph structure.
Since I specified the parameter method_params={'iv_instrument_name': 'Z0'} in causal_estimate_iv_1, placebo_treatment_1 derived a very strange result of new effect value, which should have been close to zero, but turned out to be in the thousands and quite different from the result without specifying the parameter method_params (i.e. causal_estimate_iv_2 and placebo_treatment_2 ).
According to the document, the parameter method_params={'iv_instrument_name': 'Z0'} can be omitted in this scenario where there is only one instrumental variable Z0. So the inconsistency of the results must be due to the existence of a bug.
I spent a long time debugging to trace back the cause of the inconsistency. Eventually, I realized that the problem lied in the code at line 97-99 of \dowhy\causal_estimators\instrumental_variable_estimator.py.
In line 97, when executing placebo_treatment_refuter given instrumental_variable_estimator, self.estimating_instrument_names will be assigned ['placebo_Z0']. However, in line 98-99 the existance of self.iv_instrument_name will overwrite the assignment ['placebo_Z0'] with ['Z0'] and result in the huge mistake in the following step of effect estimate, because the placebo treatment and placebo iv should maintain consistent when placebo_type="permute"
The text was updated successfully, but these errors were encountered:
I tried to reproduce the experimental results of this example A Simple Example on Creating a Custom Refutation Using User-Defined Outcome Functions and replace it with a different refuter, i.e.placebo_treatment_refuter. Here is the graph structure.
Since I specified the parameter
method_params={'iv_instrument_name': 'Z0'}
incausal_estimate_iv_1
,placebo_treatment_1
derived a very strange result of new effect value, which should have been close to zero, but turned out to be in the thousands and quite different from the result without specifying the parametermethod_params
(i.e.causal_estimate_iv_2
andplacebo_treatment_2
).According to the document, the parameter
method_params={'iv_instrument_name': 'Z0'}
can be omitted in this scenario where there is only one instrumental variableZ0.
So the inconsistency of the results must be due to the existence of a bug.I spent a long time debugging to trace back the cause of the inconsistency. Eventually, I realized that the problem lied in the code at line 97-99 of
\dowhy\causal_estimators\instrumental_variable_estimator.py
.In line 97, when executing placebo_treatment_refuter given instrumental_variable_estimator,
self.estimating_instrument_names
will be assigned['placebo_Z0']
. However, in line 98-99 the existance ofself.iv_instrument_name
will overwrite the assignment['placebo_Z0']
with['Z0']
and result in the huge mistake in the following step of effect estimate, because the placebo treatment and placebo iv should maintain consistent whenplacebo_type="permute"
The text was updated successfully, but these errors were encountered: