-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
default arguments for Markov economy fail on getEconomyData step #557
Comments
This is the correct way to call the function. The default parameters for
AggShockMarkovConsumerType do not fully specify how to construct the
idiosyncratic income distribution. In fact, I never quite came up with a
way to really do so; I kind of intended the user to do it "by hand".
To get it to work properly, all you have to do is add the
line agent.IncomeDstn[0] = 2*[agent.IncomeDstn[0]] right after agent is
initialized. Essentially, when an AggShockMarkovConsumerType is
initialized, it isn't actually told how many macroeconomic Markov states
there are. It just creates its own income distribution as if there's no
such thing as a Markov state. Thus IncomeDstn doesn't actually have the
correct structure when getEconomyData() is run.
That line simply replicates the idiosyncratic income distribution twice in
IncomeDstn[0]. I should rewrite updateIncomeProcess() for this class so
that it constructs IncomeDstn correctly, and that different income
structures can be specified for different states. Looking at the code, it
seems that the baseline MarkovConsumerType (no aggregate shocks) also has
this flaw.
…On Fri, Mar 6, 2020 at 11:21 AM Sebastian Benthall ***@***.***> wrote:
Running this code, simplified from KrusellSmith DemARK:
from HARK.ConsumptionSaving.ConsAggShockModel import AggShockMarkovConsumerType, CobbDouglasMarkovEconomy
agent = AggShockMarkovConsumerType()
economy = CobbDouglasMarkovEconomy(
agents = [agent])
agent.getEconomyData(economy) # Makes attributes of the economy, attributes of the agent
``
Gets this error:
$ python consagg.py
Traceback (most recent call last):
File "consagg.py", line 7, in
agent.getEconomyData(economy) # Makes attributes of the economy,
attributes of the agent
File
"/home/sb/projects/econ-ark/HARK/HARK/ConsumptionSaving/ConsAggShockModel.py",
line 170, in getEconomyData
self.addAggShkDstn(Economy.AggShkDstn) # Combine idiosyncratic and
aggregate shocks into one dstn
File
"/home/sb/projects/econ-ark/HARK/HARK/ConsumptionSaving/ConsAggShockModel.py",
line 400, in addAggShkDstn
self.IncomeDstn = self.IncomeDstnWithoutAggShocks
AttributeError: 'AggShockMarkovConsumerType' object has no attribute
'IncomeDstnWithoutAggShocks'
If this is the correct way to call this function, the default parameters for the two classes should support it without error
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#557?email_source=notifications&email_token=ADKRAFO6ZWA37BOR43NAPFDRGEPI7A5CNFSM4LDDPQG2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4ITE4FFQ>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADKRAFOSPHNTTG2JYVK3NBLRGEPI7ANCNFSM4LDDPQGQ>
.
|
Ok, since you seem to understand a fix for this, I'll assign this ticket to you @mnwhite |
Punting until 1.1 because @mnwhite is currently unavailable |
I believe this is still an outstanding issue, but is significantly easier to tackle with the constructors framework. To be clear: I'm fairly sure that the AggShockMarkov model doesn't initialize properly with default parameters. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Running this code, simplified from
KrusellSmith
DemARK:$ python consagg.py
Traceback (most recent call last):
File "consagg.py", line 7, in
agent.getEconomyData(economy) # Makes attributes of the economy, attributes of the agent
File "/home/sb/projects/econ-ark/HARK/HARK/ConsumptionSaving/ConsAggShockModel.py", line 170, in getEconomyData
self.addAggShkDstn(Economy.AggShkDstn) # Combine idiosyncratic and aggregate shocks into one dstn
File "/home/sb/projects/econ-ark/HARK/HARK/ConsumptionSaving/ConsAggShockModel.py", line 400, in addAggShkDstn
self.IncomeDstn = self.IncomeDstnWithoutAggShocks
AttributeError: 'AggShockMarkovConsumerType' object has no attribute 'IncomeDstnWithoutAggShocks'
The text was updated successfully, but these errors were encountered: