Skip to content

zhengli0060/AIT_Condition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✨ Testability of Instrumental Variables in Additive Nonlinear, Non-Constant Effects Models

This is the code repository for the auxiliary-based independence test (AIT) condition, used to test whether a variable is a valid instrument.

Examples

We provide several examples of running the AIT condition in example.py.

🤖 Main Function: AIT_condition.py

Auxiliary-based Independence Test (AIT) Condition

Input:

  • Data: A set of observed variables, datatype: DataFrame. For example:
Treatment Outcome IV1 ... IVn W1 ... Wn
*** *** *** *** *** *** *** ***
*** *** *** *** *** *** *** ***

where IVs are candidate IVs and Ws are covariates.

  • Z: The candidate IV being tested, datatype: str.
  • alpha: Significance level, datatype: float.
  • relation: The type of causal relationship from X to Y, datatype: str. It can be either linear or nonlinear.

Output:

  • The result of the A and Z independence test, datatype: dict.

Note:

  • If A and Z are independent, it implies that we cannot reject Z as a valid IV.
  • If A and Z are dependent, it implies that Z is an invalid IV.

🛠️ Requirements

🗒️ Notes

We adopt the control function IV estimator proposed by Guo and Small (2016) for Additive Non-Parametric IV Models, which is a two-stage approach.

  • Guo Z, Small D. S. Control function instrumental variable estimation of nonlinear causal effect models[J]. Journal of Machine Learning Research, 2016, 17(100): 1-35.

To check the statistical independence of A and Z, we employ the large-scale HSIC test proposed by Zhang et al. (2018).

  • Zhang Q, Filippi S, Gretton A, et al. Large-scale kernel methods for independence testing[J]. Statistics and Computing, 2018, 28: 113-130.

📝 Citation

If you use this code, please cite the following paper:

@article{guo2024testability,
  title={Testability of Instrumental Variables in Additive Nonlinear, Non-Constant Effects Models},
  author={Guo, Xichen and Li, Zheng and Huang, Biwei and Zeng, Yan and Geng, Zhi and Xie, Feng},
  journal={arXiv preprint arXiv:2411.12184},
  year={2024}}

About

An Auxiliary-based Independence Test (AIT) condition to test whether a variable is a valid instrument.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages