🌍 Week 5 Homework — Feedback

Student: Lorenzo Ilari
Assignment: Solving Nonlinear Equations in Economics


✅ Overall Assessment

Result: ⚠️ Partial <50% Correct

Submission implements Exercises 1 and 2 with some issues. Exercise 1 IS-LM is solved but only provides ONE initial guess instead of two (line 10: z0 = [50,50]). Exercise 2 uses fzero instead of manual bisection, which works but doesn’t demonstrate the required bisection method. Exercise 3 is incomplete - only contains derivative definition with no implementation. The code structure is decent but missing critical required components.


🔍 Task-by-Task Check

Task Description Status Notes
1.1 Parameter setup for IS-LM All parameters correctly defined
1.2 IS-LM system definition ⚠️ Uses alternative formulation: [Y - C0 - c*(Y-T) - I0 + beta*i^2 - G; k*Y - lambda*i - MP]
1.3 Solve from two initial guesses Critical Error: Only provides ONE initial guess (z0=[50,50]) instead of two
1.4 Plot IS and LM curves Creates IS-LM plot with curves and equilibrium point (you noted “looks correct”)
1.5 Verify positive interest rate Verifies equilibrium is in positive quadrant
2.1 Parameter setup for labor supply All parameters correctly defined
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 Critical Error: Uses fzero instead of manual bisection method
2.5 Plot h*(sigma) and interpret Creates plot showing h* vs sigma values (you noted “looks correct”)
3.1 Implement Bisection method Critical Error: Exercise 3 is incomplete - only derivative definition
3.2 Implement Damped Newton method Critical Error: Exercise 3 is incomplete
3.3 Test from multiple starting guesses Critical Error: Exercise 3 is incomplete
3.4 Record iterations and residuals Critical Error: Exercise 3 is incomplete
3.5 Compare and discuss convergence Critical Error: Exercise 3 is incomplete

📈 Technical Implementation

  • IS-LM System: Only one initial guess instead of two required
  • Labor Supply Function: Correct mathematical formulation
  • Bisection Method: ❌ Uses fzero instead of manual bisection implementation
  • Damped Newton: ❌ Exercise 3 incomplete
  • Error Handling: Includes sign change verification (good)
  • Figure Management: ✅ Saves figures as .fig files (you noted “figures saved and look correct”)
  • Advanced Features: Uses diagnostic checks and fzero with bracketing

💬 Style & Clarity

  • Code Quality: Good structure with clear organization
  • Variable Naming: Clear names (hstars, Zstars, star)
  • Comments: Minimal but appropriate Italian comments
  • Output: Uses fprintf and table display appropriately
  • Organization: Clear separation into exercises with proper headers
  • Documentation: Includes diagnostic checks and economic interpretation

📊 Visual Output Assessment

Figure 1: IS-LM Equilibrium ✅

  • Layout: Plot with IS and LM curves and equilibrium point
  • Features: Correctly identifies equilibrium in positive quadrant
  • Styling: Appropriate styling with proper labels and legend
  • Saving: ✅ Saves as .fig file
  • Your note: “Figures saved and look correct”

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
  • Saving: ✅ Saves as .fig file
  • Your note: “Figures saved and look correct”

✅ Suggestions for Improvement

  1. Critical: Exercise 1 - provide TWO initial guesses as required (not just one)
  2. Critical: Exercise 2 - implement manual bisection method instead of using fzero
  3. Critical: Exercise 3 - complete the implementation (missing all bisection and Newton code)
  4. Important: Add discussion of convergence comparison for Exercise 3
  5. Style: Consider saving figures as both .fig and PNG format

🎯 Summary

Submission with critical missing components. The student demonstrates some understanding of numerical methods but has several critical issues. Exercise 1 IS-LM uses only one initial guess instead of two, and the system formulation is alternative (negated). Exercise 2 uses fzero instead of manual bisection - while this works, it doesn’t demonstrate the required bisection methodology. Exercise 3 is incomplete - only contains the derivative definition with no bisection or Newton implementation. The figures look correct as you noted, but the core requirements are not fully met.

Grade Level: ⚠️ Partial <50% Correct (7/15 tasks fully correct, 1/15 partially correct, 7/15 incorrect)