-
-
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.
Merge pull request #1296 from sbenthall/i1295
Generic monte carlo simulation
- Loading branch information
Showing
14 changed files
with
2,615 additions
and
11 deletions.
There are no files selected for viewing
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
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
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,7 @@ | ||
Model | ||
------------- | ||
|
||
.. automodule:: HARK.model | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Simulation | ||
------------ | ||
|
||
.. automodule:: HARK.simulation | ||
.. automodule:: HARK.simulation.monte_carlo | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
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
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
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
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,31 @@ | ||
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)}, | ||
} |
This file was deleted.
Oops, something went wrong.
Empty file.
Oops, something went wrong.