Adding stochastic Income

Đang mở
#314 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
8/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.py would include the functions solve_agent() and solve_value() (and perhaps solve_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:

  1. 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.
  1. Update TPI.py:
  • remove the firstdoughnutring() and twist_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.py to 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

Ngôn ngữ chính
Python
Star
85
Fork
153
Merge trung bình
1 ngày 19 giờ
Pull request đã merge (30 ngày)
19

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PSLmodels/OG-Core

Tất cả issue của PSLmodels/OG-Core

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.