linearmodels
linearmodels copied to clipboard
[WIP] Arellano bond panel data
Hi,
we have implemented the Arellano Bond estimator based on this previous implementation: https://gist.github.com/toobaz/6d01be09bbd56de7038fe8ff26780138. We have two comments:
- The AB estimator is a panel data model, but it builds on top of an IV model. Therefore, we have thought that importing
IVGMM
from thelinearmodels.iv.model
sub-module was the easiest option, but we are open to other options. - We have not implemented any further tests, given that the model builds on top of already tested models. Any insight on what would the testing strategy be here?
This PR closes https://github.com/bashtage/linearmodels/issues/95
Hello @jaimeoliver1! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
- In the file
linearmodels/panel/model.py
:
Line 3142:57: W605 invalid escape sequence '\e' Line 3222:100: E501 line too long (122 > 99 characters) Line 3264:100: E501 line too long (121 > 99 characters) Line 3292:100: E501 line too long (103 > 99 characters)
Comment last updated at 2022-07-15 10:05:55 UTC
Can you run black and isort?
Codecov Report
Merging #421 (0e9a902) into main (21d0591) will decrease coverage by
0.47%
. The diff coverage is18.48%
.
@@ Coverage Diff @@
## main #421 +/- ##
==========================================
- Coverage 99.58% 99.11% -0.48%
==========================================
Files 98 98
Lines 16899 20117 +3218
Branches 1987 2968 +981
==========================================
+ Hits 16829 19938 +3109
- Misses 30 142 +112
+ Partials 40 37 -3
Impacted Files | Coverage Δ | |
---|---|---|
linearmodels/panel/model.py | 93.74% <18.48%> (-5.59%) |
:arrow_down: |
linearmodels/__init__.py | 83.33% <0.00%> (-14.23%) |
:arrow_down: |
linearmodels/shared/hypotheses.py | 98.55% <0.00%> (-1.45%) |
:arrow_down: |
linearmodels/shared/utility.py | 98.68% <0.00%> (-1.32%) |
:arrow_down: |
linearmodels/panel/data.py | 99.38% <0.00%> (-0.62%) |
:arrow_down: |
linearmodels/panel/covariance.py | 99.23% <0.00%> (-0.35%) |
:arrow_down: |
linearmodels/tests/panel/test_utility.py | 99.49% <0.00%> (-0.01%) |
:arrow_down: |
linearmodels/iv/gmm.py | 100.00% <0.00%> (ø) |
|
linearmodels/iv/common.py | 100.00% <0.00%> (ø) |
|
... and 27 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 21d0591...0e9a902. Read the comment docs.
@bashtage I committed the file with the correct formatting
I think the best way to test would be to take the Stata code as a reference and test the various outputs and options.
Overall looks very good.
- Need to add it to the docs.
- Can you break these long comments that are making PEP unhappy.
- Can you use a raw string
r"Code with escape like \epsilon"
to silence the other.
Hi @bashtage,
I've tried adding the stata tests, however I've no access to stata, so I would need a bit of help here. I think the way to go would be starting by:
- Add the examples in the documentation here. The dataset used in the docs can be found here
-
xtabondnl(0/1).wl(0/2).(kys) yr1980-yr1984year, lags(2)
- Generate the model results and add them to the results_file
Once the results are in the stata-panel-simulated-results.txt, I'll be able to implement some tests here
Also, we fixed the linting error and silence the "\epsilon" issues. We also added documentation in the docstring. However, doc build is failing (even in master...)
Thanks for following up. I can run Stata and generate results.
Going to close and reopen to trigger a rebuild.