🌍 Week 5 Homework β€” Feedback

Student: Sofia Bruga
Assignment: Solving Nonlinear Equations in Economics


βœ… Overall Assessment

Result: βœ… More than 50% Correct

Good submission implementing all three exercises with appropriate methodology. Exercise 1 IS-LM is correctly solved with two initial guesses and proper verification. Exercise 2 bisection uses correct sign change logic (< 0). Exercise 3 demonstrates proper comparison between bisection and damped Newton methods. However, Exercise 2 shows incorrect labor supply results in the plot (you mentioned the second figure looks wrong), and figures are saved in the root directory instead of a Figures folder.


πŸ” 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 (x1=[800;1], x2=[200;-1])
1.4 Plot IS and LM curves βœ… Creates IS-LM plot with equilibrium points
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 βœ… Correct bisection with proper sign change logic (< 0)
2.5 Plot h*(sigma) and interpret ❌ Creates plot but shows incorrect results (second figure wrong)
3.1 Implement Bisection method βœ… Correct bisection implementation
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 iterations for each method
3.5 Compare and discuss convergence ⚠️ Provides output but no explicit discussion

πŸ“ˆ Technical Implementation

  • IS-LM System: Correct implementation with two initial guesses
  • Labor Supply Function: Correct mathematical formulation
  • Bisection Method: Correct implementation with proper sign change logic (< 0)
  • Corner Solutions: βœ… Excellent - Explicitly handles corner solutions (h*=1) when no interior solution exists for sigmaβ‰₯3
  • Damped Newton: Correct implementation with alpha=0.5 and analytical derivative
  • Error Handling: Includes sign change checks, proper bounds handling, and sophisticated corner solution detection
  • Figure Management: Saves figures in root directory (should use Figures/ folder)
  • Advanced Features: Includes proper bounds checking, projection for Newton method, and economic interpretation of corner solutions

πŸ’¬ Style & Clarity

  • Code Quality: Clear structure with good organization
  • Variable Naming: Clear names (h_star, sigma_values, x_star1)
  • Comments: Minimal but appropriate comments
  • Output: Appropriate use of fprintf to display results
  • 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: Correctly identifies both positive and negative interest rate branches
  • Styling: Appropriate styling with proper labels and legend
  • Saving: βœ… Saves both PNG and .fig files
  • Your note: β€œFirst graph looks 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 both PNG and .fig files
  • Issue: Your note: β€œSecond figure no [looks wrong]” - the plot likely shows incorrect results

βœ… Suggestions for Improvement

  1. Critical: Check Exercise 2 results - the labor supply plot appears to show incorrect values
  2. Important: Save figures in a Figures/ folder for better organization
  3. Style: Add more detailed discussion of convergence comparison in Exercise 3
  4. Verification: Add output verification to check that results are economically reasonable

🎯 Summary

Good submission with issues in Exercise 2. The student demonstrates understanding of numerical methods and implements all three exercises. Exercise 1 is correctly solved with two initial guesses and shows both positive and negative branches. Exercise 2 bisection correctly updates function values (fa = fc when updating a, fb = fc when updating b) - the implementation is correct. However, Exercise 2 shows incorrect labor supply results in the plot (as you noted, the second figure looks wrong), which needs investigation. Exercise 3 demonstrates proper comparison between methods. The code structure is good.

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