Skip to content
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

LivPrb effects agent's initial assets when they're simulated #1491

Open
DominicWC opened this issue Aug 21, 2024 · 1 comment
Open

LivPrb effects agent's initial assets when they're simulated #1491

DominicWC opened this issue Aug 21, 2024 · 1 comment

Comments

@DominicWC
Copy link
Collaborator

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.

@DominicWC
Copy link
Collaborator Author

This problem also occurs in IndShockConsumerType, and likely others as well. I demonstrated it with PerForesightConsumerType to try and minimize possible confounding issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant