Closed rickecon closed 2 years ago
@rickecon Thanks for noting this issue. I'll open a PR to resolve this. But I would not recommend using the eta
matrix computed from transfer_distribution.py
without further inspection of the results, which have not yet been tested or scrutinized.
@jdebacker. I commented out line 60 in calibrate.py
to get my code to work. Re-ran the code and had the same issue and similar traceback with the calculation of the bequest matrix.
Traceback (most recent call last):
File "/Users/richardevans/Documents/Economics/OSE/OG-USA/./examples/run_ogusa_T040.py", line 125, in <module>
main()
File "/Users/richardevans/Documents/Economics/OSE/OG-USA/./examples/run_ogusa_T040.py", line 67, in main
c2 = Calibration(
File "/Users/richardevans/Documents/Economics/OSE/OG-USA/ogusa/calibrate.py", line 63, in __init__
self.zeta = bequest_transmission.get_bequest_matrix()
File "/Users/richardevans/Documents/Economics/OSE/OG-USA/ogusa/bequest_transmission.py", line 101, in get_bequest_matrix
df = ogcore.utils.safe_read_pickle(
File "/Users/richardevans/opt/anaconda3/envs/ogusa-dev/lib/python3.9/site-packages/ogcore/utils.py", line 357, in safe_read_pickle
with open(file_path, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/richardevans/Documents/Economics/OSE/OG-USA/ogusa/data/PSID/psid_lifetime_income.pkl'
Now I am running the script with line 63 of calibrate.py
commented out. I suspect that will fix it.
@jdebacker. Because I just commented out lines 60 and 63 in calibrate.py
, the Calibration
object had no attributes eta
or zeta
, as evidenced by the error in line 394 of calibrate.py
.
Traceback (most recent call last):
File "/Users/richardevans/Documents/Economics/OSE/OG-USA/./examples/run_ogusa_T040.py", line 125, in <module>
main()
File "/Users/richardevans/Documents/Economics/OSE/OG-USA/./examples/run_ogusa_T040.py", line 71, in main
d = c2.get_dict()
File "/Users/richardevans/Documents/Economics/OSE/OG-USA/ogusa/calibrate.py", line 394, in get_dict
dict["eta"] = self.eta
AttributeError: 'Calibration' object has no attribute 'eta'
So I replaced lines 60 and 63 in calibrate.py
with the following two commands, which simply take eta
and zeta
from the ParamTools
object p
.
self.eta = p.eta
self.zeta = p.zeta
These are only temporary solutions, because they only work with S=80
and J=7
.
This issue is resolved in PR #52.
@jdebacker. I am running a reform in
OG-USA
that increases PIT marginal income tax rates inTax-Calculator
, estimates new tax functions, and runs the reform. My run gets through the estimation of tax functions, which is part of theCalibration
class of thecalibrate.py
module. In the run of my reform, I call theCalibration
class using the following code:My run finishes the DEP tax function estimation on my reform, then I get the following error traceback.
In fact, this file
psid_lifetime_income.pkl
does not exist in theogcore/data/PSID/
folder. Let me know if you have this file and if we need to add this to the repo. Or do we just need to update the code in line 100 oftransfer_distribution.py
to point to the defaulteta
object inogusa_default_parameters.json
?