Week 10 Homework Feedback: Alessia Canuto

Overall Assessment

Grade: ✅ (Pass)

Correct submission. You have correctly implemented the Endogenous Grid Method (EGM) with a hybrid approach (using fzero), simulated the economies, and analyzed the effects of uncertainty and risk aversion. Your code is well-structured, and your results are accurate.

Task-by-Task Check

Task 1: Quantifying Precautionary Savings

  1. Parameter & Grid Setup: ✅ Correctly defined.
  2. Solution Method: ✅ EGM implemented correctly (using a root-finder for the resource constraint inversion).
  3. Deterministic Case: ✅ Solved with low $\sigma_\epsilon$.
  4. Stochastic Case: ✅ Solved with $\sigma_\epsilon = 0.04$.
  5. Simulation: ✅ Correctly simulated (1000 periods).
  6. Comparison: ✅ Precautionary savings premium calculated correctly.

Task 2: The Role of Risk Aversion

  1. Sigma Variation: ✅ Handled $\sigma=1$ and $\sigma=5$.
  2. Solving Sigma Cases: ✅ Models re-solved correctly.
  3. Policy Plot: ✅ Both policy functions plotted on the same graph.
  4. Simulation Comparison: ✅ Mean capital compared.
  5. Interpretation: ✅ Correct discussion of the results.

Technical Implementation

  • Code Structure: Very clean. The separation into solve_egm_policy.m and run_simulation.m is good practice.
  • EGM Implementation: You used fzero to invert the resource constraint ($k_{endo}$ finder). While this is mathematically correct and works fine here, the “pure” EGM typically uses interpolation or analytical inversion (if possible) to be faster. Using fzero inside the loop makes it slightly slower (more like the Coleman method efficiency-wise), but simpler to implement for general production functions.
  • File Management: Good.

Visual Output

  • The plot for Task 2 is clear, labeled, and legible.

Suggestions for Improvement

  1. EGM Efficiency: In the solve_egm_policy function, instead of using fzero to find k_endo for every grid point, you can simply calculate total assets $A = c + k’$ and then interpolate. Since $TotalAssets(k) = A(z)k^\alpha + (1-\delta)k$ is monotonic, you can compute this vector for the whole K_grid once per $z$, and then use interp1 to map back from Assets to $k$. This avoids the loop with fzero.

Summary

11/11 tasks correct. Correct work!