Skip to content

EXAMPLES: Add Santos (1999) Section 7.3 stochastic growth example notebook with analytical benchmark solution#63

Open
mnshkw wants to merge 23 commits intoQuantEcon:mainfrom
mnshkw:examples/santos1999-s73-notebook
Open

EXAMPLES: Add Santos (1999) Section 7.3 stochastic growth example notebook with analytical benchmark solution#63
mnshkw wants to merge 23 commits intoQuantEcon:mainfrom
mnshkw:examples/santos1999-s73-notebook

Conversation

@mnshkw
Copy link
Collaborator

@mnshkw mnshkw commented Feb 16, 2026

Summary

This PR adds a new example notebook implementing the multidimensional-state stochastic growth model with leisure from Santos (1999, Handbook of Macroeconomics), Section 7.3, solved using ContinuousDPs.jl.

The notebook includes analytical benchmark for delta = 1 case and accuracy checks for the policy and value functions.

In addition, the README “Demo Notebooks” list is updated to include a link to the new notebook.

Motivation

Santos (1999) Sec. 7.3 provides a benchmark for continuous-state DP with:

  • 2 dimensional state (capital k, productivity log z)
  • 1 dimensional continuous control (leisure l)
  • analytical solution for the special case (delta=1)

This PR intends to provide a useful example for ContinuousDPs.jl.

Changes

  • Add examples/cdp_ex_santos1999_s73_jl.ipynb:

    • Model setup
    • Shock discretization via Gauss-Hermite quadrature (qnwnorm)
    • Multiple types for collocation basis using BasisMatrices.jl for interpolation
    • Solves the DP via VFI and PFI
    • Analytical benchmark (delta = 1): closed-form value and policy function targets
    • Reports max errors on interpolation nodes
    • Plots for policy/value functions (displayed in the notebook output)
  • Update README:

    • adds this notebook to the “Demo Notebooks“ list.

How to Run

Open the notebook and run all the cells. The notebook includes a short “How to run” section at the top.

References

  • Santos, M. S. (1999). "Numerical solution of dynamic economic models." In Handbook of Macroeconomics, Volume 1, Chapter 5, pp. 311-386. Elsevier.
    • Specific reference: Section 7.3 (stochastic growth with leisure)
  • All codes and documentation are written with assistance by LLMs

Future Works

This PR focuses on Santos (1999) Section 7.3 (stochastic case). Follow-up PRs will:

  • add a notebook implementing Section 7.1 (deterministic case)
  • add a comparison notebook for Section 7.1 and 7.3

Notes for Reviewers

  • I will check if the README link works after submitting this PR.

mnshkw added 23 commits February 6, 2026 19:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new example notebook implementing the multidimensional-state stochastic growth model with leisure from Santos (1999, Handbook of Macroeconomics), Section 7.3. The notebook demonstrates the use of ContinuousDPs.jl with an analytical benchmark solution for validation and includes comprehensive accuracy checks.

Changes:

  • Adds examples/cdp_ex_santos1999_s73_jl.ipynb implementing Santos (1999) Section 7.3 stochastic growth model with leisure
  • Updates README.md to include link to the new notebook in the "Demo Notebooks" list
  • Implements both VFI and PFI algorithms with multiple basis types (Chebyshev, Spline, Linear)

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
examples/cdp_ex_santos1999_s73_jl.ipynb New example notebook with 2D state space model, analytical benchmark (delta=1 case), shock discretization via Gauss-Hermite quadrature, and comparisons using multiple interpolation methods
README.md Adds link to new Santos (1999) Section 7.3 example notebook

" const_term = params.lambda * (log(1 - ab) + log(params.A) + (1 - params.alpha) * log(1 - l_star)) + (1 - params.lambda) * log(l_star) + params.beta * C * (log(ab) + log(params.A) + (1-params.alpha) * log(1 - l_star))\n",
" B = const_term / (1 - params.beta)\n",
"\n",
" # Policy function (consant fraction of production)\n",
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling error in comment: "consant" should be "constant"

Suggested change
" # Policy function (consant fraction of production)\n",
" # Policy function (constant fraction of production)\n",

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments