-
-
Notifications
You must be signed in to change notification settings - Fork 210
Quasi hyperbolic pf #833
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
base: main
Are you sure you want to change the base?
Quasi hyperbolic pf #833
Changes from all commits
93c573b
612e032
6baa7c6
ef0c95d
a1e3eb1
5c11375
24a967d
465768d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -366,6 +366,7 @@ def __init__( | |||||
| PermGroFac, | ||||||
| BoroCnstArt, | ||||||
| MaxKinks, | ||||||
| HyperbolicBeta, | ||||||
| ): | ||||||
| """ | ||||||
| Constructor for a new ConsPerfForesightSolver. | ||||||
|
|
@@ -393,6 +394,9 @@ def __init__( | |||||
| additional points will be thrown out. Only relevant in infinite | ||||||
| horizon model with artificial borrowing constraint. | ||||||
|
|
||||||
| HyperbolicBeta: float | ||||||
| Quasi hyperbolic impatience factor in "beta-delta" preferences. | ||||||
|
|
||||||
| Returns: | ||||||
| ---------- | ||||||
| None | ||||||
|
|
@@ -414,6 +418,7 @@ def __init__( | |||||
| PermGroFac=PermGroFac, | ||||||
| BoroCnstArt=BoroCnstArt, | ||||||
| MaxKinks=MaxKinks, | ||||||
| HyperbolicBeta=HyperbolicBeta, | ||||||
| ) | ||||||
|
|
||||||
| def defUtilityFuncs(self): | ||||||
|
|
@@ -612,7 +617,7 @@ def solve(self): | |||||
| The solution to this period's problem. | ||||||
| """ | ||||||
| self.defUtilityFuncs() | ||||||
| self.DiscFacEff = self.DiscFac * self.LivPrb | ||||||
| self.DiscFacEff = self.DiscFac * self.LivPrb * self.HyperbolicBeta | ||||||
|
||||||
| self.makePFcFunc() | ||||||
| self.defValueFuncs() | ||||||
| solution = ConsumerSolution( | ||||||
|
|
@@ -1528,21 +1533,22 @@ def prepareToCalcEndOfPrdvP(self): | |||||
|
|
||||||
| # Make a dictionary to specify a perfect foresight consumer type | ||||||
| init_perfect_foresight = { | ||||||
| 'CRRA': 2.0, # Coefficient of relative risk aversion, | ||||||
| 'Rfree': 1.03, # Interest factor on assets | ||||||
| 'DiscFac': 0.96, # Intertemporal discount factor | ||||||
| 'LivPrb': [0.98], # Survival probability | ||||||
| 'PermGroFac': [1.01], # Permanent income growth factor | ||||||
| 'BoroCnstArt': None, # Artificial borrowing constraint | ||||||
| 'MaxKinks': 400, # Maximum number of grid points to allow in cFunc (should be large) | ||||||
| 'AgentCount': 10000, # Number of agents of this type (only matters for simulation) | ||||||
| 'aNrmInitMean' : 0.0, # Mean of log initial assets (only matters for simulation) | ||||||
| 'aNrmInitStd' : 1.0, # Standard deviation of log initial assets (only for simulation) | ||||||
| 'pLvlInitMean' : 0.0, # Mean of log initial permanent income (only matters for simulation) | ||||||
| 'pLvlInitStd' : 0.0, # Standard deviation of log initial permanent income (only matters for simulation) | ||||||
| 'PermGroFacAgg' : 1.0,# Aggregate permanent income growth factor: portion of PermGroFac attributable to aggregate productivity growth (only matters for simulation) | ||||||
| 'T_age' : None, # Age after which simulated agents are automatically killed | ||||||
| 'T_cycle' : 1 # Number of periods in the cycle for this agent type | ||||||
| "CRRA": 2.0, # Coefficient of relative risk aversion, | ||||||
| "Rfree": 1.03, # Interest factor on assets | ||||||
| "DiscFac": 0.96, # Intertemporal discount factor | ||||||
| "LivPrb": [0.98], # Survival probability | ||||||
| "PermGroFac": [1.01], # Permanent income growth factor | ||||||
| "BoroCnstArt": None, # Artificial borrowing constraint | ||||||
| "MaxKinks": 400, # Maximum number of grid points to allow in cFunc (should be large) | ||||||
| "AgentCount": 10000, # Number of agents of this type (only matters for simulation) | ||||||
| "aNrmInitMean": 0.0, # Mean of log initial assets (only matters for simulation) | ||||||
| "aNrmInitStd": 1.0, # Standard deviation of log initial assets (only for simulation) | ||||||
| "pLvlInitMean": 0.0, # Mean of log initial permanent income (only matters for simulation) | ||||||
| "pLvlInitStd": 0.0, # Standard deviation of log initial permanent income (only matters for simulation) | ||||||
| "PermGroFacAgg": 1.0, # Aggregate permanent income growth factor (only matters for simulation) | ||||||
| "T_age": None, # Age after which simulated agents are automatically killed | ||||||
| "T_cycle": 1, # Number of periods in the cycle for this agent type | ||||||
| "HyperbolicBeta": 1, | ||||||
|
||||||
| "HyperbolicBeta": 1, | |
| "HyperbolicBeta": 1, # Quasi-hyperbolic discount factor (naive agents) |
Copilot
AI
Jan 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding "geometric_solution" to time_inv_ makes it a required parameter that must be provided during initialization. This could break existing code that creates PerfForesightConsumerType instances without this parameter. Consider making this parameter optional by checking for its existence with hasattr() (as already done in core.py line 923) rather than requiring it as a time-invariant parameter.
| "geometric_solution", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstring is missing a blank line before the "Returns:" section and has inconsistent formatting with an empty line after the description. The formatting should match the project's documentation standards.