You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changing many variables for agents changes their initial assets even when they haven't died, there's no uncertainty, and the change is only for parameter events that have happened before the agent's birth.
To Reproduce
from HARK.ConsumptionSaving.ConsIndShockModel import PerfForesightConsumerType
PerfForesightDict = {
# Parameters actually used in the solution method
"CRRA": 2.0, # Coefficient of relative risk aversion
"Rfree": [1.00,1.00,1.00,1.00], # Interest factor on assets
"DiscFac": .96, # Default intertemporal discount factor
"LivPrb": [0.9,.9,.9,.9], # Survival probability
"PermGroFac": [1.00,1.00,1.00,1.00], # Permanent income growth factor
"BoroCnstArt": -1.0, # Artificial borrowing constraint
"aXtraCount": 200, # Maximum number of gridpoints in consumption function
# Parameters that characterize the nature of time
"T_cycle": 4, # Number of periods in the cycle for this agent type
"cycles": 1, # Number of times the cycle occurs (0 --> infinitely repeated)
"T_sim":4,
"AgentCount":50, #Needs to be high enough that you can find agent's dying
"aNrmInitMean":0.0,
"aNrmInitStd":0.0,
}
PerfForesightDict["Rfree"][0]=1.02 #You can check that the same problem occurs with PermGroFac and LivPrb
agent1 = PerfForesightConsumerType(**PerfForesightDict)
agent1.solve()
agent1.track_vars=["aNrm"]
agent1.initialize_sim()
agent1.simulate()
print(agent1.history["aNrm"][1:3]) #so that the agent's solution/birth should be unaffected by a past variable
PerfForesightDict["Rfree"][0]=1.03
agent2 = PerfForesightConsumerType(**PerfForesightDict)
agent2.solve()
agent2.track_vars=["aNrm"]
agent2.initialize_sim()
agent2.simulate()
print(agent2.history["aNrm"][1:3]) #so that the agent's solution/birth should be unaffected by a past variable
The aNrm values for the agents who are born in this period should differ because there's no randomness to aNrm or income, both should have the same solution and lifecycle process, and the only change is happening in the past. However, they aren't the same.
The text was updated successfully, but these errors were encountered:
This problem also occurs in IndShockConsumerType, and likely others as well. I demonstrated it with PerForesightConsumerType to try and minimize possible confounding issues.
Changing many variables for agents changes their initial assets even when they haven't died, there's no uncertainty, and the change is only for parameter events that have happened before the agent's birth.
To Reproduce
from HARK.ConsumptionSaving.ConsIndShockModel import PerfForesightConsumerType
PerfForesightDict = {
# Parameters actually used in the solution method
"CRRA": 2.0, # Coefficient of relative risk aversion
"Rfree": [1.00,1.00,1.00,1.00], # Interest factor on assets
"DiscFac": .96, # Default intertemporal discount factor
"LivPrb": [0.9,.9,.9,.9], # Survival probability
"PermGroFac": [1.00,1.00,1.00,1.00], # Permanent income growth factor
"BoroCnstArt": -1.0, # Artificial borrowing constraint
"aXtraCount": 200, # Maximum number of gridpoints in consumption function
# Parameters that characterize the nature of time
"T_cycle": 4, # Number of periods in the cycle for this agent type
"cycles": 1, # Number of times the cycle occurs (0 --> infinitely repeated)
"T_sim":4,
"AgentCount":50, #Needs to be high enough that you can find agent's dying
"aNrmInitMean":0.0,
"aNrmInitStd":0.0,
}
PerfForesightDict["Rfree"][0]=1.02 #You can check that the same problem occurs with PermGroFac and LivPrb
agent1 = PerfForesightConsumerType(**PerfForesightDict)
agent1.solve()
agent1.track_vars=["aNrm"]
agent1.initialize_sim()
agent1.simulate()
print(agent1.history["aNrm"][1:3]) #so that the agent's solution/birth should be unaffected by a past variable
PerfForesightDict["Rfree"][0]=1.03
agent2 = PerfForesightConsumerType(**PerfForesightDict)
agent2.solve()
agent2.track_vars=["aNrm"]
agent2.initialize_sim()
agent2.simulate()
print(agent2.history["aNrm"][1:3]) #so that the agent's solution/birth should be unaffected by a past variable
The aNrm values for the agents who are born in this period should differ because there's no randomness to aNrm or income, both should have the same solution and lifecycle process, and the only change is happening in the past. However, they aren't the same.
The text was updated successfully, but these errors were encountered: