Adding stochastic Income
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
This is a design proposal, not a ready task. Start with household.py, aggregates.py, SS.py (inner_loop, SS_solver, run_SS), TPI.py (inner_loop, run_TPI) and parameters.py to see the current structure it describes. Done would mean agreeing on a stochastic-income solution design with maintainers before any code is written. The thread has been idle for about two years and the work has no assignee or pull request.
索引モデルが issue の本文から書いたものです。
説明
An addition to this model that @jorgebarro is working on is to incorporate stochastic income processes into the model. This necessitates changing the solution method and thus some of the structure of the computational solutions. This issue discusses the entry points into the OG-USA source code for modules/functions that will allow for stochastic income processes to be included into the model.
In household.py:
- Essentially every function can be removed.
- New functions will include those necessary to solve the problem of an individual household.
- e.g., if we look at this code, an updated
household.pywould include the functionssolve_agent()andsolve_value()(and perhapssolve_cohort()) - One will also want a function that defines the utility function of the agent so that is can be changed easily.
Because household solution would now rely on methods that involve solving the problem over a discrete grid, the household solution would return policy functions defining savings and labor supply for each point on that grid. These would be used together with the distribution of the population over these grid points to solve for economic aggregates. Thus in aggregates.py, all functions would need to be updated to sum across these grids, where the sums include the sum weighted implied by the distribution of agents over the grid points in the capital-labor supply grids and over age (as given by the omega matrix (or array in the time path).
A new model should be created to store functions related to the computation of the distribution of agents over the grid points in the capital-labor supply state spaces. Such a module would include a function to solve for the stationary distribution over these grid points as well as over age. This function would take in the omega_SS matrix and the policy functions to find the stationary distribution for the steady state. Another function would compute the distribution over these points from the initial state over the time path using the omega array that gives the exogenous distribution of households by age over each period in the time path. These distributions would be used in the aggregation functions outlined above.
With the above in place, one would alter the OG-USA code in a few ways:
- Update
SS.py:
- Remove
euler_equation_solver() - In
inner_loop(), replace lines 309-329 will calls to the relevant functions in household.py that solve the household problem and return policy functions - in
inner_loop(), between lines 329 and 331, insert functions to compute the distribution of agents over the state space (capital, labor supply, age) - In
inner_loop()in lines 331-379, update calls to functions that find economic aggregates to include what needs to be passed to these functions in the stochastic income case (i.e., grids and distributions) - In
SS_solver(), update 533-636 to update calls to aggregate functions. - In
run_SS(), one will want to change some things about initial values passed in to accord with the new solution method for the household problem.
- Update
TPI.py:
- remove the
firstdoughnutring()andtwist_doughnut()functions. - update
inner_loop()to replace lines 410-482 (and what is returned from the function) to work with the new household solution (where one will still loop over the time path in a way similar to the current structure - i.e., with the twist donut) - Update a lot in
run_TPI-- e.g., will need to compute the distribution of the state space at each point on the time path, use updated functions to compute aggregates.
Note also:
- One needs to be careful in stationarizing the value function used for the solution.
- Obviously parameters passed to function calls throughout will likely need to be changed to reflect new parameters used to define the stochastic income process and characteristics of the solution method. This will include changes to
parameters.pyto define new parameters. - One will want to make smart use of starting values - e.g. solving for one agent type/cohort to help inform the starting value for the solution to the next cohort/type if they are solved serially.
There may be some things I left out, but this should help in conceptualizing how the stochastic income solution method will enter the current model.
cc @rickecon
- 主要言語
- Python
- スター
- 85
- フォーク
- 153
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 19
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PSLmodels/OG-Core のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 57/100
PSLmodels/OG-Core#1218 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
PSLmodels/OG-Core の issue をすべて見る
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
aws-samples/sample-per-model-bedrock#782 ·
メンテナーはふだん 1 日以内に返信
-
Google text documents are base64-encoded twice対応中かも @feiiiiii5 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
coveragepy/coveragepy#2364 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100