🌍 Week 5 Homework β€” Feedback

Student: Giovanni Di Miele
Assignment: Solving Nonlinear Equations in Economics


βœ… Overall Assessment

Result: ⚠️ Partial <50% Correct

The student demonstrates understanding of numerical methods and implements all three exercises. However, there are critical errors: (1) Exercise 2 uses wrong bracket [0.02, 0.93] instead of [0,1], and the bisection has variable name conflicts, (2) Exercise 3 has undefined variable a0 in the fallback condition, and (3) both figures show incorrect results as you noted. The IS-LM implementation is correct but the labor supply results are problematic.


πŸ” 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 βœ… Correct formulation
1.3 Solve from two initial guesses βœ… Two guesses provided (z0=[800;1], z1=[600;-4])
1.4 Plot IS and LM curves ❌ Creates plot but shows incorrect results (both figures wrong)
1.5 Verify positive interest rate βœ… Verifies and plots both positive and negative branches
2.1 Parameter setup for labor supply βœ… All parameters correctly defined
2.2 Define Z(h) function βœ… Correct formulation
2.3 Loop over sigma values βœ… Correctly loops over sigma ∈ {1,2,3,4,5}
2.4 Solve using Bisection method ❌ Critical Errors: Uses wrong bracket [0.02, 0.93], variable name conflict with parameter β€˜a’
2.5 Plot h*(sigma) and interpret ❌ Creates plot but shows incorrect results (second figure wrong)
3.1 Implement Bisection method ❌ Undefined variable a0 in fallback condition
3.2 Implement Damped Newton method βœ… Implements damped Newton with alpha=0.5 and analytical derivative
3.3 Test from multiple starting guesses βœ… Tests from three guesses (0.2, 0.5, 0.8)
3.4 Record iterations and residuals βœ… Records and displays results in table
3.5 Compare and discuss convergence ⚠️ Provides interpretation but results are unreliable due to errors

πŸ“ˆ Technical Implementation

  • IS-LM System: Correct implementation with two initial guesses
  • Labor Supply Function: Correct mathematical formulation
  • Bisection in Exercise 2: Critical Error - uses bracket [0.02, 0.93] instead of [0,1] and variable name conflict (a used for both parameter and bracket endpoint)
  • Bisection in Exercise 3: Critical Error - undefined variable a0 in fallback condition
  • Damped Newton: Correct implementation with alpha=0.5 and analytical derivative
  • Figure Management: Saves figures as PNG files
  • Error Handling: Includes sign change checks but with errors

πŸ’¬ Style & Clarity

  • Code Quality: Acceptable structure but with variable naming issues
  • Variable Naming: Critical Issue: Variable a used for both parameter (line 60) and bracket endpoint (line 73), causing conflict
  • Comments: Minimal comments
  • Output: Appropriate use of disp and fprintf
  • Organization: Clear separation into three exercises

πŸ“Š Visual Output Assessment

Figure 1: IS-LM Equilibrium ❌

  • Layout: Plot with IS and LM curves and equilibrium points
  • Features: Shows both positive and negative interest rate branches
  • Styling: Appropriate styling with proper labels and legend
  • Saving: βœ… Saves as PNG file
  • Issue: Your note: β€œBoth figures look wrong” - shows incorrect results

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 PNG file
  • Issue: Your note: β€œBoth figures look wrong” - shows incorrect results

βœ… Suggestions for Improvement

  1. Critical: Fix Exercise 2 - change bracket from [0.02, 0.93] to [0,1]
  2. Critical: Fix variable name conflict - don’t use a for both parameter and bracket endpoint in Exercise 2
  3. Critical: Fix Exercise 3 - remove undefined variable a0 from line 122
  4. Important: Check that results are economically reasonable (h* should be in [0,1])
  5. Style: Add more detailed comments explaining the methodology
  6. Verification: Verify that the plots are showing correct results

🎯 Summary

Submission with critical errors. The student demonstrates understanding of numerical methods and implements all three exercises. However, there are critical errors: (1) Exercise 2 uses wrong bracket [0.02, 0.93] instead of [0,1] and has variable name conflicts, (2) Exercise 3 has undefined variable issues, and (3) both figures show incorrect results. The IS-LM implementation is correct, and the damped Newton method is implemented appropriately, but the labor supply results are unreliable due to the bracket errors and variable name conflicts.

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