-
-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding python model configuration for normalized perfect foresight; g…
…eneric monte carlo example shows exact match
- Loading branch information
Showing
3 changed files
with
384 additions
and
154 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from HARK.distribution import Bernoulli | ||
from HARK.model import Control | ||
|
||
# This way of distributing parameters across the scope is clunky | ||
# Can be handled better if parsed from a YAML file, probably | ||
# But it would be better to have a more graceful Python version as well. | ||
CRRA = 2.0, | ||
LivPrb = 0.98 | ||
|
||
model = { | ||
'shocks' : { | ||
'live' : Bernoulli(p=LivPrb), | ||
}, | ||
'parameters' : { | ||
'DiscFac' : 0.96, | ||
'CRRA' : CRRA, | ||
'Rfree' : 1.03, | ||
'LivPrb' : LivPrb, | ||
'PermGroFac' : 1.01, | ||
'BoroCnstArt' : None, | ||
}, | ||
'dynamics' : { | ||
'p' : lambda PermGroFac, p: PermGroFac * p, | ||
'r_eff' : lambda Rfree, PermGroFac : Rfree / PermGroFac, | ||
'b_nrm' : lambda r_eff, a_nrm: r_eff * a_nrm, | ||
'm_nrm' : lambda b_nrm: b_nrm + 1, | ||
'c_nrm' : Control(['m_nrm']), | ||
'a_nrm' : lambda m_nrm, c_nrm : m_nrm - c_nrm | ||
}, | ||
'reward' : { | ||
'u' : lambda c : c ** (1 - CRRA) / (1 - CRRA) | ||
} | ||
} |
Oops, something went wrong.