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
Loading default parameters into class during initialization #466
Merged
Merged
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
5c6afef
loading init_perfect_foresight parameters by default. See #446
sbenthall 009be78
loading init_idiosyncratic_shock into IndShochConsumerType on initial…
sbenthall 1e40924
using default ConsIndShock parameters when configuring RAexample
sbenthall ef22a5b
loading kinked_R parameters into class by default
sbenthall 42a3d0a
Using default params in initializer for classes in ConsPrefShockModel
sbenthall ed017fa
removing act_T from default Cobb-Douglas parameters because it's alre…
sbenthall ecd50e8
loading default params into initialization, last cases. see #446
sbenthall c758ad6
Merge branch 'master' into i446b
sbenthall 32e4b60
Fixing issue with multiple cycles arguments in IndShockExplicitPermIn…
sbenthall 543ef80
Merge branch 'i446b' of github.com:sbenthall/HARK into i446b
sbenthall d175cab
Merge branch 'master' into i446b
llorracc File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
from HARK.ConsumptionSaving.ConsGenIncProcessModel import ConsGenIncProcessSolver,\ | ||
PersistentShockConsumerType, ValueFunc2D, MargValueFunc2D,\ | ||
MargMargValueFunc2D, VariableLowerBoundFunc2D | ||
import HARK.ConsumptionSaving.ConsumerParameters as Params | ||
from copy import deepcopy | ||
|
||
utility_inv = CRRAutility_inv | ||
|
@@ -509,7 +510,7 @@ class MedShockConsumerType(PersistentShockConsumerType): | |
''' | ||
shock_vars_ = PersistentShockConsumerType.shock_vars_ + ['MedShkNow'] | ||
|
||
def __init__(self,cycles=1,time_flow=True,**kwds): | ||
def __init__(self,cycles=0,time_flow=True,**kwds): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same thing |
||
''' | ||
Instantiate a new ConsumerType with given data, and construct objects | ||
to be used during solution (income distribution, assets grid, etc). | ||
|
@@ -527,6 +528,10 @@ def __init__(self,cycles=1,time_flow=True,**kwds): | |
------- | ||
None | ||
''' | ||
params = Params.init_medical_shocks.copy() | ||
params.update(kwds) | ||
kwds = params | ||
|
||
PersistentShockConsumerType.__init__(self,cycles=cycles,**kwds) | ||
self.solveOnePeriod = solveConsMedShock # Choose correct solver | ||
self.addToTimeInv('CRRAmed') | ||
|
@@ -1361,7 +1366,6 @@ def solveConsMedShock(solution_next,IncomeDstn,MedShkDstn,LivPrb,DiscFac,CRRA,CR | |
############################################################################### | ||
|
||
def main(): | ||
import HARK.ConsumptionSaving.ConsumerParameters as Params | ||
from HARK.utilities import CRRAutility_inv | ||
from time import clock | ||
import matplotlib.pyplot as plt | ||
|
@@ -1370,7 +1374,7 @@ def main(): | |
do_simulation = True | ||
|
||
# Make and solve an example medical shocks consumer type | ||
MedicalExample = MedShockConsumerType(**Params.init_medical_shocks) | ||
MedicalExample = MedShockConsumerType() | ||
t_start = clock() | ||
MedicalExample.solve() | ||
t_end = clock() | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
is there a reason for this switch?