🌍 Week 5 Homework β€” Feedback

Student: Simone Iudice
Assignment: Solving Nonlinear Equations in Economics


βœ… Overall Assessment

Result: βœ… More than 50% Correct

Good submission implementing all three exercises with clear documentation and appropriate methodology. The IS-LM implementation is correct, Exercise 2 bisection is properly implemented, and Exercise 3 demonstrates understanding of convergence comparison. However, Exercise 1 is missing a second initial guess as required, and Exercise 2 has incomplete sign change logic that could affect convergence.


πŸ” Task-by-Task Check

Task Description Status Notes
1.1 Parameter setup for IS-LM βœ… All parameters correctly defined (C0, c, I0, beta, T, G, MP, k, lambda)
1.2 IS-LM system definition βœ… Correct formulation: [Y-(C0+c*(Y-T)+I0-beta*i^2+G); MP-(k*Y-lambda*i)]
1.3 Solve from two initial guesses ❌ Issue: Only one initial guess provided (x0=[900;2]). Missing second guess requirement.
1.4 Plot IS and LM curves βœ… Creates IS-LM plot with equilibrium point and proper styling
1.5 Verify positive interest rate βœ… Verifies positive interest rate with conditional check
2.1 Parameter setup for labor supply βœ… All parameters correctly defined (w, tau, a, g, phi, chi)
2.2 Define Z(h) function βœ… Correct formulation: c(h)^(-sigma)*(1-tau)*w - chi*(1-h)^phi
2.3 Loop over sigma values βœ… Correctly loops over sigma ∈ {1,2,3,4,5}
2.4 Solve using Bisection method ⚠️ Correct bisection logic but uses Z(a0)*Z(c) < 0 without updating values
2.5 Plot h*(sigma) and interpret βœ… Creates plot and provides economic interpretation
3.1 Implement Bisection method βœ… Correct bisection implementation
3.2 Implement Damped Newton method βœ… Implements damped Newton with alpha=0.5 and numerical derivative
3.3 Test from multiple starting guesses βœ… Tests from three guesses (0.2, 0.5, 0.8)
3.4 Record iterations and residuals βœ… Creates results table with all metrics
3.5 Compare and discuss convergence βœ… Provides detailed discussion comparing methods

πŸ“ˆ Technical Implementation

  • IS-LM System: Correct implementation using fsolve() with proper formulation
  • Labor Supply Function: Correct mathematical formulation with appropriate bounds [1e-6, 1-1e-6]
  • Bisection in Exercise 2: Issues with sign change logic - evaluates Z(a0) and Z(c) without updating these values in the loop
  • Bisection in Exercise 3: Correct bisection implementation
  • Damped Newton: Correct implementation with alpha=0.5 and numerical derivative
  • Error Handling: Includes sign change checks and proper convergence criteria
  • Figure Management: βœ… Saves figures in β€˜Figures/’ folder
  • Advanced Features: Includes economic interpretation and detailed discussion

πŸ’¬ Style & Clarity

  • Code Quality: Clear structure with comprehensive comments
  • Variable Naming: Clear and logical names (h_star, sigma_values, xstar)
  • Comments: Good comments explaining methodology and economic interpretation
  • Output: Appropriate use of fprintf and table display
  • Organization: Clear separation into three exercises with proper headers
  • Documentation: Includes detailed economic interpretation and convergence analysis

πŸ“Š Visual Output Assessment

Figure 1: IS-LM Equilibrium βœ…

  • Layout: Plot with IS and LM curves and equilibrium point
  • Features: Correctly identifies equilibrium and verifies positive interest rate
  • Styling: Appropriate styling with proper labels and legend
  • Saving: βœ… Saves with saveas() in β€˜Figures/’ folder

Figure 2: Labor Supply h*(Οƒ) βœ…

  • Layout: Plot showing h* vs sigma values
  • Features: Shows labor supply for different risk aversion parameters
  • Styling: Appropriate styling with proper labels and grid
  • Saving: βœ… Saves with saveas() in β€˜Figures/’ folder

βœ… Suggestions for Improvement

  1. Critical: Exercise 1 requires two different initial guesses to solve from (currently only one provided)
  2. Important: Fix bisection loop in Exercise 2 - need to update a0 or b0 values, not just check Z(a0)*Z(c) < 0 without updating the interval endpoints
  3. Style: Consider adding projection to keep h in [0,1] in the Newton method
  4. Verification: Add more detailed output for Exercise 2 showing iteration count and residual for each sigma

🎯 Summary

Good submission with minor issues. The student demonstrates understanding of numerical methods and implements all three exercises. The IS-LM implementation is correct, Exercise 3 is implemented with appropriate bisection and damped Newton methods, and figures are properly saved. However, Exercise 1 is missing the second initial guess requirement, and Exercise 2’s bisection loop has a logic issue that could affect convergence (evaluating Z(a0) without updating it in the loop).

Grade Level: βœ… More than 50% Correct (13/15 tasks fully correct, 1/15 partially correct, 1/15 incorrect)