Skip to content

Commit

Permalink
Some style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicWC committed Aug 20, 2024
1 parent 85787b5 commit c7a398a
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 23 deletions.
18 changes: 15 additions & 3 deletions HARK/Calibration/Income/IncomeProcesses.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,10 +755,13 @@ def __call__(self, pLvlNow):


def make_trivial_pLvlNextFunc(T_cycle):
"""
r"""
A dummy function that creates default trivial permanent income dynamics:
none at all! Simply returns a list of IdentityFunctions, one for each period.
.. math::
G_{t}(x) = x
Parameters
----------
T_cycle : int
Expand All @@ -775,11 +778,14 @@ def make_trivial_pLvlNextFunc(T_cycle):


def make_explicit_perminc_pLvlNextFunc(T_cycle, PermGroFac):
"""
r"""
A function that creates permanent income dynamics as a sequence of linear
functions, indicating constant expected permanent income growth across
permanent income levels.
.. math::
G_{t+1} (x) = \Gamma_{t+1} x
Parameters
----------
T_cycle : int
Expand All @@ -802,11 +808,17 @@ def make_explicit_perminc_pLvlNextFunc(T_cycle, PermGroFac):


def make_AR1_style_pLvlNextFunc(T_cycle, pLvlInitMean, PermGroFac, PrstIncCorr):
"""
r"""
A function that creates permanent income dynamics as a sequence of AR1-style
functions. If cycles=0, the product of PermGroFac across all periods must be
1.0, otherwise this method is invalid.
.. math::
\begin{align}
log(G_{t+1} (x)) &=\varphi log(x) + (1-\varphi) log(\overline{P}_{t})+log(\Gamma_{t+1}) + log(\psi_{t+1}), \\
\overline{P}_{t+1} &= \overline{P}_{t} \Gamma_{t+1} \\
\end{align}
Parameters
----------
T_cycle : int
Expand Down
46 changes: 26 additions & 20 deletions HARK/ConsumptionSaving/ConsGenIncProcessModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,16 +647,17 @@ class GenIncProcessConsumerType(IndShockConsumerType):
end-of-period assets, and an artificial borrowing constraint.
.. math::
\begin{eqnarray*}
V_t(M_t,P_t) &=& \max_{C_t} U(C_t) + \beta (1-\mathsf{D}_{t+1}) \mathbb{E} [V_{t+1}(M_{t+1}, P_{t+1}) ], \\
A_t &=& M_t - C_t, \\
A_t/P_t &\geq& \underline{a}, \\
M_{t+1} &=& R A_t + \theta_{t+1}, \\
P_{t+1} &=& G_{t+1}(P_t)\psi_{t+1}, \\
(\psi_{t+1},\theta_{t+1}) &\sim& F_{t+1}, \\
\mathbb{E} [F_{t+1}] &=& 1, \\
U(C) &=& \frac{C^{1-\rho}}{1-\rho}. \\
\end{eqnarray*}
\begin{eqnarray*}
V_t(M_t,P_t) &=& \max_{C_t} U(C_t) + \beta (1-\mathsf{D}_{t+1}) \mathbb{E} [V_{t+1}(M_{t+1}, P_{t+1}) ], \\
A_t &=& M_t - C_t, \\
A_t/P_t &\geq& \underline{a}, \\
M_{t+1} &=& R A_t + \theta_{t+1}, \\
P_{t+1} &=& G_{t+1}(P_t)\psi_{t+1}, \\
(\psi_{t+1},\theta_{t+1}) &\sim& F_{t+1}, \\
\mathbb{E} [F_{t+1}] &=& 1, \\
U(C) &=& \frac{C^{1-\rho}}{1-\rho}. \\
\end{eqnarray*}
Constructors
------------
Expand All @@ -668,13 +669,14 @@ class GenIncProcessConsumerType(IndShockConsumerType):
The agent's asset grid.
It's default constructor is :func:`HARK.utilities.make_assets_grid`
pLvlNextFunc: Constructor, default=HARK.Calibration.IncomeProcesses.make_trivial_pLvlNextFunc
An arbitrary function used to evolve the GenIncShockConsumerType's permanent income
pLvlNextFunc: Constructor
An arbitrary function used to evolve the GenIncShockConsumerType's permanent income
It's default constructor is :func:`HARK.Calibration.Income.IncomeProcesses.make_trivial_pLvlNextFunc`
pLvlGrid: Constructor
The agent's pLvl grid
It's default constructor is :func:`HARK.Calibration.IncomeProcesses.make_pLvlGrid_by_simulation`
It's default constructor is :func:`HARK.Calibration.Income.IncomeProcesses.make_pLvlGrid_by_simulation`
pLvlPctiles: Constructor
The agents income level percentile grid
Expand Down Expand Up @@ -1044,8 +1046,10 @@ class IndShockExplicitPermIncConsumerType(GenIncProcessConsumerType):
describing the path of permanent income multiplies the current permanent
income by the PermGroFac (:math:`\Gamma`). It's behavior is the same as
:class:`HARK.ConsumptionSaving.ConsIndShockModel.IndShockConsumerType`, except
that the variables aren't normalized. This makes the result somewhat less
accurate.
that the variables aren't normalized. This makes the result less
accurate. This Model uses a lognormal random walk income process.
If you would like to use a different income process, use
:class:`HARK.ConsumptionSaving.ConsGenIncProcessModel.GenIncProcessConsumerType`
.. math::
\begin{eqnarray*}
Expand Down Expand Up @@ -1074,11 +1078,11 @@ class IndShockExplicitPermIncConsumerType(GenIncProcessConsumerType):
pLvlNextFunc: Constructor
An arbitrary function used to evolve the GenIncShockConsumerType's permanent income
It's default constructor is :func:`make_explicit_perminc_pLvlNextFunc`
It's default constructor is :func:`HARK.Calibration.Income.IncomeProcesses.make_explicit_perminc_pLvlNextFunc`
pLvlGrid: Constructor
The agent's pLvl grid
It's default constructor is :func:`HARK.Calibration.IncomeProcesses.make_pLvlGrid_by_simulation`
It's default constructor is :func:`HARK.Calibration.Income.IncomeProcesses.make_pLvlGrid_by_simulation`
pLvlPctiles: Constructor
The agents income level percentile grid
Expand Down Expand Up @@ -1236,7 +1240,9 @@ class IndShockExplicitPermIncConsumerType(GenIncProcessConsumerType):

class PersistentShockConsumerType(GenIncProcessConsumerType):
r"""
A consumer type based on GenIncProcessModel, where the log permanent follows an AR1 process.
A consumer type based on GenIncProcessModel, where the log permanent income follows an AR1 process.
If you would like to use a different income process, use
:class:`HARK.ConsumptionSaving.ConsGenIncProcessModel.GenIncProcessConsumerType`
.. math::
\begin{eqnarray*}
Expand Down Expand Up @@ -1266,11 +1272,11 @@ class PersistentShockConsumerType(GenIncProcessConsumerType):
pLvlNextFunc: Constructor
An arbitrary function used to evolve the GenIncShockConsumerType's permanent income
It's default constructor is :func:`make_AR1_style_pLvlNextFunc`
It's default constructor is :func:`HARK.Calibration.Income.IncomeProcesses.make_AR1_style_pLvlNextFunc`
pLvlGrid: Constructor
The agent's pLvl grid
It's default constructor is :func:`HARK.Calibration.IncomeProcesses.make_pLvlGrid_by_simulation`
It's default constructor is :func:`HARK.Calibration.Income.IncomeProcesses.make_pLvlGrid_by_simulation`
pLvlPctiles: Constructor
The agents income level percentile grid
Expand Down

0 comments on commit c7a398a

Please sign in to comment.