-
Notifications
You must be signed in to change notification settings - Fork 75
Add Bayesian instrumental variable estimation #213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
drbenvincent
merged 34 commits into
pymc-labs:main
from
NathanielF:feature_instrumental_variables
Aug 24, 2023
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
23eff06
[IV 212] Adding base classes required for bayesian instrumental varia…
NathanielF 0a519d8
[IV 212] loading data set properly, tidied notebook example and estim…
NathanielF 28e9d9f
[IV 212] adding the class and example notebook to the documentation
NathanielF 3c70dfe
[IV 212] adding integration test
NathanielF f97cd82
[IV 212] updating index rst
NathanielF d30da22
Merge branch 'latest' into feature_instrumental_variables
NathanielF 61d5592
[IV 212] experimenting with nicer plot
NathanielF c70c3df
[IV 212] changed colors
NathanielF 1bf4a74
[IV 212] added reference
NathanielF 31cf8d7
[IV 212] added more write up and improved plot
NathanielF c50db34
get bibtex references working
drbenvincent fe76082
[IV 212] added parameter recovery example
NathanielF 6a6739b
improvements to current banks
drbenvincent 70b6571
minor edits
drbenvincent 7529eaa
attempt to fix failing test
drbenvincent 3e9b475
update to proper sphinx glossary
drbenvincent 1f4e030
add wilkinson notation reference
drbenvincent df594ca
fix an admonition in brexit notebook
drbenvincent d76d295
add in some glossary terms to example notebooks
drbenvincent 306bb1e
Update README.md
drbenvincent 5a14848
bump to version 0.0.14
drbenvincent 73e2959
improvements to current banks
drbenvincent 85ae1b5
update to proper sphinx glossary
drbenvincent 916804e
add wilkinson notation reference
drbenvincent f279a80
add in some glossary terms to example notebooks
drbenvincent 12334bf
trying to resolve merge conflicts
NathanielF dd22016
[IV 212] addressing some of Ben's comments with notebook
NathanielF 7a28dab
Merge branch 'main' into feature_instrumental_variables
NathanielF f08b02d
[IV 212] adding an input validation test
NathanielF 04584d0
[IV 212] adding user warning and tidying params
NathanielF efa3f6d
Merge branch 'main' into feature_instrumental_variables
NathanielF f737115
[IV 212] pretty print user warning
NathanielF 2e1d692
[IV 212] adding axis labels with Ben's comments
NathanielF cb68c78
[IV 212] fixing axis label
NathanielF File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
longname,shortnam,logmort0,risk,loggdp,campaign,source0,slave,latitude,neoeuro,asia,africa,other,edes1975,campaignsj,campaignsj2,mortnaval1,logmortnaval1,mortnaval2,logmortnaval2,mortjam,logmortjam,logmortcap250,logmortjam250,wandcafrica,malfal94,wacacontested,mortnaval2250,logmortnaval2250,mortnaval1250,logmortnaval1250 | ||
Angola,AGO,5.6347895,5.3600001,7.77,1,0,0,0.1367,0,0,1,0,0.0,1,1,280.0,5.6347895,280.0,5.6347895,280.0,5.6347895,5.521461,5.521461,1,0.94999999,1,250.0,5.521461,250.0,5.521461 | ||
Argentina,ARG,4.232656,6.3899999,9.1300001,1,0,0,0.37779999,0,0,0,0,90.0,1,1,15.07,2.7127061,30.5,3.4177268,56.5,4.0342407,4.232656,4.0342407,0,0.0,0,30.5,3.4177268,15.07,2.7127061 | ||
Australia,AUS,2.1459312,9.3199997,9.8999996,0,0,0,0.30000001,1,0,0,1,99.0,0,1,8.5500002,2.1459312,8.5500002,2.1459312,8.5500002,2.1459312,2.1459312,2.1459312,0,0.0,0,8.5500002,2.1459312,8.5500002,2.1459312 | ||
Burkina Faso,BFA,5.6347895,4.4499998,6.8499999,1,0,0,0.1444,0,0,1,0,0.0,1,1,280.0,5.6347895,280.0,5.6347895,280.0,5.6347895,5.521461,5.521461,1,0.94999999,1,250.0,5.521461,250.0,5.521461 | ||
Bangladesh,BGD,4.2684379,5.1399999,6.8800001,1,1,0,0.2667,0,1,0,0,0.0,1,1,71.410004,4.2684379,71.410004,4.2684379,71.410004,4.2684379,4.2684379,4.2684379,0,0.12008,0,71.410004,4.2684379,71.410004,4.2684379 | ||
Bahamas,BHS,4.4426513,7.5,9.29,0,0,0,0.2683,0,0,0,0,10.0,0,0,85.0,4.4426513,85.0,4.4426513,85.0,4.4426513,4.4426513,4.4426513,0,,0,85.0,4.4426513,85.0,4.4426513 | ||
Bolivia,BOL,4.2626801,5.6399999,7.9299998,1,0,0,0.18889999,0,0,0,0,30.000002,1,1,,,93.25,4.535284,56.5,4.0342407,4.2626801,4.0342407,0,0.00165,0,93.25,4.535284,, | ||
Brazil,BRA,4.2626801,7.9099998,8.7299995,1,0,0,0.1111,0,0,0,0,55.0,1,1,15.07,2.7127061,30.5,3.4177268,56.5,4.0342407,4.2626801,4.0342407,0,0.035999998,0,30.5,3.4177268,15.07,2.7127061 | ||
Canada,CAN,2.7788193,9.7299995,9.9899998,0,1,0,0.66670001,1,0,0,0,98.0,0,0,16.1,2.7788193,16.1,2.7788193,16.1,2.7788193,2.7788193,2.7788193,0,0.0,0,16.1,2.7788193,16.1,2.7788193 | ||
Chile,CHL,4.232656,7.8200002,9.3400002,1,0,0,0.33329999,0,0,0,0,50.0,1,1,15.07,2.7127061,30.5,3.4177268,56.5,4.0342407,4.232656,4.0342407,0,0.0,0,30.5,3.4177268,15.07,2.7127061 | ||
Cote d'Ivoire,CIV,6.5042882,7.0,7.4400001,1,0,0,0.0889,0,0,1,0,0.0,1,1,668.0,6.5042882,668.0,6.5042882,668.0,6.5042882,5.521461,5.521461,1,0.94999999,1,250.0,5.521461,250.0,5.521461 | ||
Cameroon,CMR,5.6347895,6.4499998,7.5,1,0,0,0.066699997,0,0,1,0,0.0,1,1,280.0,5.6347895,280.0,5.6347895,280.0,5.6347895,5.521461,5.521461,1,0.94999999,1,250.0,5.521461,250.0,5.521461 | ||
Congo,COG,5.480639,4.6799998,7.4200001,0,1,1,0.0111,0,0,1,0,0.0,0,0,240.0,5.480639,240.0,5.480639,240.0,5.480639,5.480639,5.480639,1,0.94999999,0,240.0,5.480639,240.0,5.480639 | ||
Colombia,COL,4.2626801,7.3200002,8.8100004,1,0,0,0.044399999,0,0,0,0,25.0,1,1,,,93.25,4.535284,56.5,4.0342407,4.2626801,4.0342407,0,0.14637001,0,93.25,4.535284,, | ||
Costa Rica,CRI,4.3579903,7.0500002,8.79,1,0,0,0.1111,0,0,0,0,20.0,1,1,,,93.25,4.535284,62.200001,4.1303549,4.3579903,4.1303549,0,0.0,0,93.25,4.535284,, | ||
Dominican Re,DOM,4.8675346,6.1799998,8.3599997,0,0,0,0.2111,0,0,0,0,25.0,0,0,130.0,4.8675346,130.0,4.8675346,130.0,4.8675346,4.8675346,4.8675346,0,0.0,0,130.0,4.8675346,130.0,4.8675346 | ||
Algeria,DZA,4.3592696,6.5,8.3900003,1,1,0,0.31110001,0,0,1,0,0.0,1,1,78.199997,4.3592696,78.199997,4.3592696,78.199997,4.3592696,4.3592696,4.3592696,0,0.0,0,78.199997,4.3592696,78.199997,4.3592696 | ||
Ecuador,ECU,4.2626801,6.5500002,8.4700003,1,0,0,0.0222,0,0,0,0,30.000002,1,1,,,93.25,4.535284,56.5,4.0342407,4.2626801,4.0342407,0,0.11894999,0,93.25,4.535284,, | ||
Egypt,EGY,4.2165623,6.77,7.9499998,1,1,0,0.30000001,0,0,1,0,0.0,1,1,67.800003,4.2165623,67.800003,4.2165623,67.800003,4.2165623,4.2165623,4.2165623,0,0.0,0,67.800003,4.2165623,67.800003,4.2165623 | ||
Ethiopia,ETH,3.2580965,5.73,6.1100001,1,1,0,0.0889,0,0,1,0,0.0,1,1,26.0,3.2580965,26.0,3.2580965,26.0,3.2580965,3.2580965,3.2580965,1,0.551,0,26.0,3.2580965,26.0,3.2580965 | ||
Gabon,GAB,5.6347895,7.8200002,8.8999996,1,0,0,0.0111,0,0,1,0,0.0,1,1,280.0,5.6347895,280.0,5.6347895,280.0,5.6347895,5.521461,5.521461,1,0.94050002,1,250.0,5.521461,250.0,5.521461 | ||
Ghana,GHA,6.5042882,6.27,7.3699999,1,1,0,0.0889,0,0,1,0,0.0,1,1,668.0,6.5042882,668.0,6.5042882,668.0,6.5042882,5.521461,5.521461,1,0.94999999,0,250.0,5.521461,250.0,5.521461 | ||
Guinea,GIN,6.1800165,6.5500002,7.4899998,1,0,0,0.1222,0,0,1,0,0.0,1,1,483.0,6.1800165,483.0,6.1800165,483.0,6.1800165,5.521461,5.521461,1,0.94999999,1,250.0,5.521461,250.0,5.521461 | ||
Gambia,GMB,7.2930179,8.2700005,7.27,1,1,0,0.1476,0,0,1,0,0.0,1,1,1470.0,7.2930179,1470.0,7.2930179,1470.0,7.2930179,5.521461,5.521461,1,0.94999999,0,250.0,5.521461,250.0,5.521461 | ||
Guatemala,GTM,4.2626801,5.1399999,8.29,1,0,0,0.17,0,0,0,0,20.0,1,1,,,93.25,4.535284,56.5,4.0342407,4.2626801,4.0342407,0,0.0036000002,0,93.25,4.535284,, | ||
Guyana,GUY,3.4713452,5.8899999,7.9000001,0,0,0,0.055599999,0,0,0,0,2.0,0,0,32.18,3.4713452,32.18,3.4713452,32.18,3.4713452,3.4713452,3.4713452,0,0.49503002,0,32.18,3.4713452,32.18,3.4713452 | ||
Hong Kong,HKG,2.7013612,8.1400003,10.05,0,0,0,0.24609999,0,1,0,0,0.0,1,1,14.9,2.7013612,14.9,2.7013612,14.9,2.7013612,2.7013612,2.7013612,0,0.0,0,14.9,2.7013612,14.9,2.7013612 | ||
Honduras,HND,4.3579903,5.3200002,7.6900001,1,0,0,0.16670001,0,0,0,0,20.0,1,1,,,93.25,4.535284,62.200001,4.1303549,4.3579903,4.1303549,0,0.012,0,93.25,4.535284,, | ||
Haiti,HTI,4.8675346,3.73,7.1500001,0,0,0,0.2111,0,0,0,0,0.0,0,0,130.0,4.8675346,130.0,4.8675346,130.0,4.8675346,4.8675346,4.8675346,0,1.0,0,130.0,4.8675346,130.0,4.8675346 | ||
Indonesia,IDN,5.1357985,7.5900002,7.3299999,1,1,0,0.055599999,0,1,0,0,0.0,1,1,170.0,5.1357985,170.0,5.1357985,170.0,5.1357985,5.1357985,5.1357985,0,0.17873,0,170.0,5.1357985,170.0,5.1357985 | ||
India,IND,3.8842406,8.2700005,7.3299999,0,1,0,0.22220001,0,1,0,0,0.0,0,0,48.630001,3.8842406,48.630001,3.8842406,48.630001,3.8842406,3.8842406,3.8842406,0,0.23596001,0,48.630001,3.8842406,48.630001,3.8842406 | ||
Jamaica,JAM,4.8675346,7.0900002,8.1899996,0,1,0,0.2017,0,0,0,0,10.0,0,1,130.0,4.8675346,130.0,4.8675346,130.0,4.8675346,4.8675346,4.8675346,0,0.0,0,130.0,4.8675346,130.0,4.8675346 | ||
Kenya,KEN,4.9767337,6.0500002,7.0599999,0,1,1,0.0111,0,0,1,0,0.0,0,0,145.0,4.9767337,145.0,4.9767337,145.0,4.9767337,4.9767337,4.9767337,1,0.79799998,0,145.0,4.9767337,145.0,4.9767337 | ||
Sri Lanka,LKA,4.2456341,6.0500002,7.73,0,1,0,0.077799998,0,1,0,0,0.0,0,1,69.800003,4.2456341,69.800003,4.2456341,69.800003,4.2456341,4.2456341,4.2456341,0,0.138,0,69.800003,4.2456341,69.800003,4.2456341 | ||
Morocco,MAR,4.3592696,7.0900002,8.04,1,0,0,0.3556,0,0,1,0,1.0,1,1,78.199997,4.3592696,78.199997,4.3592696,78.199997,4.3592696,4.3592696,4.3592696,0,0.0,0,78.199997,4.3592696,78.199997,4.3592696 | ||
Madagascar,MDG,6.2842088,4.4499998,6.8400002,1,1,0,0.22220001,0,0,1,0,0.0,1,1,536.03998,6.2842088,536.03998,6.2842088,536.03998,6.2842088,5.521461,5.521461,1,0.94999999,0,250.0,5.521461,250.0,5.521461 | ||
Mexico,MEX,4.2626801,7.5,8.9399996,1,1,0,0.25560001,0,0,0,0,15.000001,1,1,71.0,4.2626801,71.0,4.2626801,71.0,4.2626801,4.2626801,4.2626801,0,0.00042,0,71.0,4.2626801,71.0,4.2626801 | ||
Mali,MLI,7.986165,4.0,6.5700002,1,1,0,0.18889999,0,0,1,0,0.0,1,1,2940.0,7.986165,2940.0,7.986165,2940.0,7.986165,5.521461,5.521461,1,0.94050002,0,250.0,5.521461,250.0,5.521461 | ||
Malta,MLT,2.7911651,7.23,9.4300003,0,1,0,0.3944,0,0,0,1,100.0,0,0,16.299999,2.7911651,16.299999,2.7911651,16.299999,2.7911651,2.7911651,2.7911651,0,,0,16.299999,2.7911651,16.299999,2.7911651 | ||
Malaysia,MYS,2.8735647,7.9499998,8.8900003,0,1,0,0.025599999,0,1,0,0,0.0,0,1,17.700001,2.8735647,17.700001,2.8735647,17.700001,2.8735647,2.8735647,2.8735647,0,0.23331,0,17.700001,2.8735647,17.700001,2.8735647 | ||
Niger,NER,5.9914646,5.0,6.73,1,0,0,0.1778,0,0,1,0,0.0,1,1,400.0,5.9914646,400.0,5.9914646,400.0,5.9914646,5.521461,5.521461,1,0.94050002,1,250.0,5.521461,250.0,5.521461 | ||
Nigeria,NGA,7.6029005,5.5500002,6.8099999,1,1,0,0.1111,0,0,1,0,0.0,1,1,2004.0,7.6029005,2004.0,7.6029005,2004.0,7.6029005,5.521461,5.521461,1,0.94999999,0,250.0,5.521461,250.0,5.521461 | ||
Nicaragua,NIC,5.0955892,5.23,7.54,1,0,0,0.1444,0,0,0,0,20.0,1,1,,,93.25,4.535284,130.0,4.8675346,5.0955892,4.8675346,0,0.044,0,93.25,4.535284,, | ||
New Zealand,NZL,2.1459312,9.7299995,9.7600002,0,1,0,0.45559999,1,0,0,1,91.699997,1,1,8.5500002,2.1459312,8.5500002,2.1459312,8.5500002,2.1459312,2.1459312,2.1459312,0,0.0,0,8.5500002,2.1459312,8.5500002,2.1459312 | ||
Pakistan,PAK,3.6106477,6.0500002,7.3499999,1,0,0,0.33329999,0,1,0,0,0.0,1,1,36.990002,3.6106477,36.990002,3.6106477,36.990002,3.6106477,3.6106477,3.6106477,0,0.53757,0,36.990002,3.6106477,36.990002,3.6106477 | ||
Panama,PAN,5.0955892,5.9099998,8.8400002,1,0,0,0.1,0,0,0,0,20.0,1,1,15.07,2.7127061,30.5,3.4177268,130.0,4.8675346,5.0955892,4.8675346,0,0.08004,0,30.5,3.4177268,15.07,2.7127061 | ||
Peru,PER,4.2626801,5.77,8.3999996,1,0,0,0.1111,0,0,0,0,30.000002,1,1,15.07,2.7127061,30.5,3.4177268,56.5,4.0342407,4.2626801,4.0342407,0,0.00050000002,0,30.5,3.4177268,15.07,2.7127061 | ||
Paraguay,PRY,4.3579903,6.9499998,8.21,1,0,0,0.25560001,0,0,0,0,25.0,1,1,,,93.25,4.535284,62.200001,4.1303549,4.3579903,4.1303549,0,0.0,0,93.25,4.535284,, | ||
Sudan,SDN,4.4796071,4.0,7.3099999,1,1,0,0.16670001,0,0,1,0,0.0,1,1,88.199997,4.4796071,88.199997,4.4796071,88.199997,4.4796071,4.4796071,4.4796071,1,0.93099999,0,88.199997,4.4796071,88.199997,4.4796071 | ||
Senegal,SEN,5.1038828,6.0,7.4000001,0,1,0,0.1556,0,0,1,0,0.0,0,1,164.66,5.1038828,164.66,5.1038828,164.66,5.1038828,5.1038828,5.1038828,1,0.94999999,0,164.66,5.1038828,164.66,5.1038828 | ||
Singapore,SGP,2.8735647,9.3199997,10.15,0,0,0,0.0136,0,1,0,0,0.0,0,1,17.700001,2.8735647,17.700001,2.8735647,17.700001,2.8735647,2.8735647,2.8735647,0,0.0,0,17.700001,2.8735647,17.700001,2.8735647 | ||
Sierra Leone,SLE,6.1800165,5.8200002,6.25,1,1,0,0.092200004,0,0,1,0,0.0,1,1,483.0,6.1800165,483.0,6.1800165,483.0,6.1800165,5.521461,5.521461,1,0.94999999,0,250.0,5.521461,250.0,5.521461 | ||
El Salvador,SLV,4.3579903,5.0,7.9499998,1,0,0,0.15000001,0,0,0,0,20.0,1,1,,,93.25,4.535284,62.200001,4.1303549,4.3579903,4.1303549,0,0.0,0,93.25,4.535284,, | ||
Togo,TGO,6.5042882,6.9099998,7.2199998,1,0,0,0.0889,0,0,1,0,0.0,1,1,668.0,6.5042882,668.0,6.5042882,668.0,6.5042882,5.521461,5.521461,1,0.94999999,1,250.0,5.521461,250.0,5.521461 | ||
Trinidad and Tobago,TTO,4.4426513,7.4499998,8.7700005,0,1,0,0.1222,0,0,0,0,40.0,0,1,85.0,4.4426513,85.0,4.4426513,85.0,4.4426513,4.4426513,4.4426513,0,0.0,0,85.0,4.4426513,85.0,4.4426513 | ||
Tunisia,TUN,4.1431346,6.4499998,8.4799995,1,1,0,0.37779999,0,0,1,0,0.0,1,1,63.0,4.1431346,63.0,4.1431346,63.0,4.1431346,4.1431346,4.1431346,0,0.0,0,63.0,4.1431346,63.0,4.1431346 | ||
Tanzania,TZA,4.9767337,6.6399999,6.25,0,0,1,0.066699997,0,0,1,0,0.0,0,0,145.0,4.9767337,145.0,4.9767337,145.0,4.9767337,4.9767337,4.9767337,1,0.92150003,1,145.0,4.9767337,145.0,4.9767337 | ||
Uganda,UGA,5.6347895,4.4499998,6.9699998,1,0,0,0.0111,0,0,1,0,0.0,1,1,280.0,5.6347895,280.0,5.6347895,280.0,5.6347895,5.521461,5.521461,1,0.94999999,1,250.0,5.521461,250.0,5.521461 | ||
Uruguary,URY,4.2626801,7.0,9.0299997,1,0,0,0.36669999,0,0,0,0,90.0,1,1,,,93.25,4.535284,56.5,4.0342407,4.2626801,4.0342407,0,0.0,0,93.25,4.535284,, | ||
USA,USA,2.7080503,10.0,10.22,0,1,0,0.42219999,1,0,0,0,83.600006,0,1,15.0,2.7080503,15.0,2.7080503,15.0,2.7080503,2.7080503,2.7080503,0,0.0,0,15.0,2.7080503,15.0,2.7080503 | ||
Venezuela,VEN,4.3579903,7.1399999,9.0699997,1,0,0,0.0889,0,0,0,0,20.0,1,1,,,93.25,4.535284,62.200001,4.1303549,4.3579903,4.1303549,0,0.0070400001,0,93.25,4.535284,, | ||
Vietnam,VNM,4.9416423,6.4099998,7.2800002,1,1,0,0.1778,0,1,0,0,0.0,1,1,140.0,4.9416423,140.0,4.9416423,140.0,4.9416423,4.9416423,4.9416423,0,0.70109999,0,140.0,4.9416423,140.0,4.9416423 | ||
South Africa,ZAF,2.74084,6.8600001,8.8900003,0,1,0,0.3222,0,0,1,0,16.0,0,1,15.5,2.74084,15.5,2.74084,15.5,2.74084,2.74084,2.74084,0,0.1045,0,15.5,2.74084,15.5,2.74084 | ||
Zaire,ZAR,5.480639,3.5,6.8699999,0,0,1,0.0,0,0,1,0,0.0,0,0,240.0,5.480639,240.0,5.480639,240.0,5.480639,5.480639,5.480639,1,0.94999999,1,240.0,5.480639,240.0,5.480639 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.