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

moves constructor documentation from __init__ to class string, see #842 #908

Merged
merged 2 commits into from
Jan 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Documentation/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Release Data: TBD
* Centralizes the definition of value, marginal value, and marginal marginal value functions that use inverse-space
interpolation for problems with CRRA utility. See [#888](https://github.com/econ-ark/HARK/pull/888).
* MarkovProcess class (#902)[https://github.com/econ-ark/HARK/pull/902]
* Corrects location of constructor documentation to class string for Sphinx rendering (#908)[https://github.com/econ-ark/HARK/pull/908]

#### Minor Changes

Expand Down
156 changes: 55 additions & 101 deletions HARK/ConsumptionSaving/ConsAggShockModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1791,28 +1791,20 @@ class CobbDouglasEconomy(Market):

Note: The current implementation assumes a constant labor supply, but
this will be generalized in the future.

Parameters
----------
agents : [ConsumerType]
List of types of consumers that live in this economy.
tolerance: float
Minimum acceptable distance between "dynamic rules" to consider the
solution process converged. Distance depends on intercept and slope
of the log-linear "next capital ratio" function.
act_T : int
Number of periods to simulate when making a history of of the market.
"""

def __init__(self, agents=None, tolerance=0.0001, act_T=1200, **kwds):
"""
Make a new instance of CobbDouglasEconomy by filling in attributes
specific to this kind of market.

Parameters
----------
agents : [ConsumerType]
List of types of consumers that live in this economy.
tolerance: float
Minimum acceptable distance between "dynamic rules" to consider the
solution process converged. Distance depends on intercept and slope
of the log-linear "next capital ratio" function.
act_T : int
Number of periods to simulate when making a history of of the market.

Returns
-------
None
"""
agents = agents if agents is not None else list()
params = init_cobb_douglas.copy()
params["sow_vars"] = [
Expand Down Expand Up @@ -2120,27 +2112,20 @@ class SmallOpenEconomy(Market):
A class for representing a small open economy, where the wage rate and interest rate are
exogenously determined by some "global" rate. However, the economy is still subject to
aggregate productivity shocks.

Parameters
----------
agents : [ConsumerType]
List of types of consumers that live in this economy.
tolerance: float
Minimum acceptable distance between "dynamic rules" to consider the
solution process converged. Distance depends on intercept and slope
of the log-linear "next capital ratio" function.
act_T : int
Number of periods to simulate when making a history of of the market.
"""

def __init__(self, agents=None, tolerance=0.0001, act_T=1000, **kwds):
"""
Make a new instance of SmallOpenEconomy by filling in attributes specific to this kind of market.

Parameters
----------
agents : [ConsumerType]
List of types of consumers that live in this economy.
tolerance: float
Minimum acceptable distance between "dynamic rules" to consider the
solution process converged. Distance depends on intercept and slope
of the log-linear "next capital ratio" function.
act_T : int
Number of periods to simulate when making a history of of the market.

Returns
-------
None
"""
agents = agents if agents is not None else list()
Market.__init__(
self,
Expand Down Expand Up @@ -2343,6 +2328,16 @@ class CobbDouglasMarkovEconomy(CobbDouglasEconomy):
state for the "macroeconomy", so that the shock distribution and aggregate
productivity growth factor can vary over time.

Parameters
----------
agents : [ConsumerType]
List of types of consumers that live in this economy.
tolerance: float
Minimum acceptable distance between "dynamic rules" to consider the
solution process converged. Distance depends on intercept and slope
of the log-linear "next capital ratio" function.
act_T : int
Number of periods to simulate when making a history of of the market.
"""

def __init__(
Expand All @@ -2362,25 +2357,6 @@ def __init__(
],
**kwds
):
"""
Make a new instance of CobbDouglasMarkovEconomy by filling in attributes
specific to this kind of market.

Parameters
----------
agents : [ConsumerType]
List of types of consumers that live in this economy.
tolerance: float
Minimum acceptable distance between "dynamic rules" to consider the
solution process converged. Distance depends on intercept and slope
of the log-linear "next capital ratio" function.
act_T : int
Number of periods to simulate when making a history of of the market.

Returns
-------
None
"""
agents = agents if agents is not None else list()
params = init_mrkv_cobb_douglas.copy()
params.update(kwds)
Expand Down Expand Up @@ -2789,28 +2765,20 @@ class KrusellSmithEconomy(Market):
This model replicates the one presented in the JPE article "Income and Wealth
Heterogeneity in the Macroeconomy", with its default parameters set to match
those in the paper.

Parameters
----------
agents : [ConsumerType]
List of types of consumers that live in this economy.
tolerance: float
Minimum acceptable distance between "dynamic rules" to consider the
solution process converged. Distance depends on intercept and slope
of the log-linear "next capital ratio" function.
act_T : int
Number of periods to simulate when making a history of of the market.
"""

def __init__(self, agents=None, tolerance=0.0001, **kwds):
"""
Make a new instance of KrusellSmithEconomy by filling in attributes
specific to this kind of market.

Parameters
----------
agents : [ConsumerType]
List of types of consumers that live in this economy.
tolerance: float
Minimum acceptable distance between "dynamic rules" to consider the
solution process converged. Distance depends on intercept and slope
of the log-linear "next capital ratio" function.
act_T : int
Number of periods to simulate when making a history of of the market.

Returns
-------
None
"""
agents = agents if agents is not None else list()
params = deepcopy(init_KS_economy)
params.update(kwds)
Expand Down Expand Up @@ -3106,23 +3074,16 @@ class AggregateSavingRule(HARKobject):
"""
A class to represent agent beliefs about aggregate saving at the end of this period (AaggNow) as
a function of (normalized) aggregate market resources at the beginning of the period (MaggNow).

Parameters
----------
intercept : float
Intercept of the log-linear capital evolution rule.
slope : float
Slope of the log-linear capital evolution rule.
"""

def __init__(self, intercept, slope):
"""
Make a new instance of CapitalEvoRule.

Parameters
----------
intercept : float
Intercept of the log-linear capital evolution rule.
slope : float
Slope of the log-linear capital evolution rule.

Returns
-------
new instance of CapitalEvoRule
"""
self.intercept = intercept
self.slope = slope
self.distance_criteria = ["slope", "intercept"]
Expand All @@ -3147,20 +3108,13 @@ def __call__(self, Mnow):
class AggShocksDynamicRule(HARKobject):
"""
Just a container class for passing the dynamic rule in the aggregate shocks model to agents.

Parameters
----------
AFunc : CapitalEvoRule
Aggregate savings as a function of aggregate market resources.
"""

def __init__(self, AFunc):
"""
Make a new instance of CapDynamicRule.

Parameters
----------
AFunc : CapitalEvoRule
Aggregate savings as a function of aggregate market resources.

Returns
-------
None
"""
self.AFunc = AFunc
self.distance_criteria = ["AFunc"]
Loading