HARK icon indicating copy to clipboard operation
HARK copied to clipboard

default arguments for Markov economy fail on getEconomyData step

Open sbenthall opened this issue 4 years ago • 4 comments

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

sbenthall avatar Mar 06 '20 16:03 sbenthall