Skip to content

Commit

Permalink
Merge pull request #953 from sbenthall/i907-PEP8
Browse files Browse the repository at this point in the history
PEP8 for names
  • Loading branch information
sbenthall authored Feb 25, 2021
2 parents fc8e03c + 5d9b836 commit a3f7310
Show file tree
Hide file tree
Showing 77 changed files with 713 additions and 709 deletions.
1 change: 1 addition & 0 deletions Documentation/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Release Data: TBD

#### Major Changes

* Converts non-mathematical code to PEP8 compliant form [#953](https://github.com/econ-ark/HARK/pull/953)
* Adds a constructor for LogNormal distributions from mean and standard deviation [#891](https://github.com/econ-ark/HARK/pull/891/)
* Uses new LogNormal constructor in ConsPortfolioModel [#891](https://github.com/econ-ark/HARK/pull/891/)
* calcExpectations method for taking the expectation of a distribution over a function [#884](https://github.com/econ-ark/HARK/pull/884/] (#897)[https://github.com/econ-ark/HARK/pull/897/)
Expand Down
6 changes: 3 additions & 3 deletions Documentation/ConsumptionSavingModels.tex
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ \subsection{Idiosyncratic and Aggregate Shocks to Income}

The objects $\textbf{R}(\cdot)$ and $\textbf{W}(\cdot)$, are functions of the (effective) capital-to-labor ratio that yield the (net) interest factor and wage rate respectively. As noted above, these are determined by the aggregate production function and the degree of capital depreciation. The $\texttt{k}(\cdot)$ function represents the agent's beliefs about the evolution of the capital-to-labor ratio $k_t$. As with idiosyncratic shocks, there is an aggregate shock process $(F_{\Theta},F_{\Psi})$.

The one period problem of this model is solved by the function \texttt{solveConsAggShock}, the default value of \texttt{solveOnePeriod} for \texttt{AggShockConsumerType}. The attributes required to specify an instance of this class are listed in the concordance below.
The one period problem of this model is solved by the function \texttt{solveConsAggShock}, the default value of \texttt{solve_one_period} for \texttt{AggShockConsumerType}. The attributes required to specify an instance of this class are listed in the concordance below.

\begin{table}[h!]
\centering
Expand Down Expand Up @@ -305,9 +305,9 @@ \subsection{Cobb-Douglas Economy}

After a well-formed \texttt{CobbDouglasEconomy} has been created, its \texttt{agents} attribute can be populated with one or more instances of \texttt{AggShockConsumerType} (who have taken ``macro'' level information from the \texttt{CobbDouglasEconomy}). A history of aggregate shocks can be created by invoking the \texttt{makeAggShkHist} method. If each element of \texttt{AggShockConsumerType} has run its \texttt{makeIncShkHist} method to create a history of idiosyncratic income shocks (for many agents in each type), then the \texttt{CobbDouglasEconomy} can invoke its \texttt{solve} method. This will search for a general equilibrium of the model, defined as a ``dynamic rule'' for the capital ratio $\textbf{k}(k_t)$ that is \textit{consistent}: when agents believe this $\textbf{k}(k_t)$ in their microeconomic problem, and the model is simulated for many periods, the resulting history of the capital ratio is consistent with that same dynamic rule.

In the \texttt{Market} framework, the \texttt{millRule} for \texttt{CobbDouglasEconomy} gathers each agent's end-of-period normalized assets $a_t$ and permanent income $p_t$. It aggregates wealth across all consumers into total capital, which it transforms into the capital-to-labor ratio. It then uses the next aggregate shock values to calculate $\Rfree_t$ and $W_t$, which are distributed back to the consumers along with the aggregate shocks and new capital ratio, so that they can simulated another period.
In the \texttt{Market} framework, the \texttt{mill_rule} for \texttt{CobbDouglasEconomy} gathers each agent's end-of-period normalized assets $a_t$ and permanent income $p_t$. It aggregates wealth across all consumers into total capital, which it transforms into the capital-to-labor ratio. It then uses the next aggregate shock values to calculate $\Rfree_t$ and $W_t$, which are distributed back to the consumers along with the aggregate shocks and new capital ratio, so that they can simulated another period.

After generating a history of several thousand periods, the \texttt{CobbDouglasEconomy} can calculate a new dynamic rule for the capital ratio with its \texttt{calcDynamics} method. The dynamics calculator simply throws out the first 200 periods of the history and runs a one-period-lag autoregression on the log capital ratio. This generates a new function for \texttt{kNextFunc}, which is distributed to the consumer types in \texttt{agents} to re-solve their micro models. This process continues until successive \texttt{kNextFunc}s are sufficiently close to consider the process converged (as determined by the \texttt{tolerance} attribute).
After generating a history of several thousand periods, the \texttt{CobbDouglasEconomy} can calculate a new dynamic rule for the capital ratio with its \texttt{calc_dynamics} method. The dynamics calculator simply throws out the first 200 periods of the history and runs a one-period-lag autoregression on the log capital ratio. This generates a new function for \texttt{kNextFunc}, which is distributed to the consumer types in \texttt{agents} to re-solve their micro models. This process continues until successive \texttt{kNextFunc}s are sufficiently close to consider the process converged (as determined by the \texttt{tolerance} attribute).


\newpage
Expand Down
Loading

0 comments on commit a3f7310

Please sign in to comment.