🌍 Week 5 Homework — Feedback

Student: Iusupova Farangizbegim
Assignment: Solving Nonlinear Equations in Economics


✅ Overall Assessment

Result: ✅ More than 50% Correct

Good submission with all three exercises implemented. The IS-LM implementation is correct, Exercise 3 is implemented correctly with proper bisection and damped Newton methods. Exercise 2 uses fzero instead of manual bisection and has some issues. The code is well-structured with appropriate documentation.


🔍 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 with IS and LM equations    
1.3 Solve from two initial guesses ✅ Two guesses provided (x01=[800;5], x02=[1000;2]) and both converge    
1.4 Plot IS and LM curves ✅ Creates IS-LM plot with equilibrium point and styling    
1.5 Verify positive interest rate ✅ Verifies positive interest rate and checks convergence    
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_fun(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 ⚠️ Uses fzero() instead of implementing bisection manually    
2.5 Plot h*(sigma) and interpret ❌ Creates plot but shows incorrect results (likely wrong Z(h) function usage)    
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 and Z(h*)  
3.5 Compare and discuss convergence ✅ Provides discussion comparing methods    

📈 Technical Implementation

  • IS-LM System: Correct implementation using fsolve() with proper system formulation
  • Labor Supply Function: Correct mathematical formulation but incorrect results
  • Bisection in Exercise 2: Uses fzero() instead of manual implementation
  • Damped Newton: Correct implementation with alpha=0.5 and analytical derivative
  • Error Handling: Includes convergence checks and fallback logic
  • Figure Management: ⚠️ Saves figures in root directory instead of Figures/ folder
  • Advanced Features: Includes interpretation and convergence analysis

💬 Style & Clarity

  • Code Quality: Clean structure with clear section headers
  • Variable Naming: Clear names (h_star, sigma_values, x_sol)
  • Comments: Good comments explaining methodology
  • Output: Appropriate use of fprintf with detailed output
  • Organization: Clear separation into three exercises with proper headers
  • Documentation: Includes 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 shows equilibrium and verifies positive interest rate
  • Styling: Good styling with proper labels and legend
  • Saving: Saves with saveas() but in root directory

Figure 2: Labor Supply vs Risk Aversion ❌

  • Layout: Plot showing h* vs sigma
  • Features: Shows incorrect results (likely due to wrong Z(h) evaluation)
  • Styling: Appropriate styling with proper labels
  • Saving: Saves with saveas() but in root directory
  • Issue: Exercise 2 shows incorrect labor supply values

✅ Suggestions for Improvement

  1. Critical: Check Exercise 2 results - the labor supply values appear incorrect
  2. Critical: Verify the Z(h) function evaluation in the loop for Exercise 2
  3. Important: Save figures in a Figures/ folder for better organization
  4. Important: Consider using exportgraphics() instead of saveas() for better quality
  5. Style: Exercise 2 should implement bisection manually instead of using fzero()
  6. Verification: Add verification that labor supply results are economically reasonable (h* in [0,1])

🎯 Summary

Good submission with some issues in Exercise 2. The student demonstrates understanding of numerical methods and implements IS-LM correctly. Exercise 3 is implemented correctly with proper bisection and damped Newton methods. However, Exercise 2 shows incorrect labor supply results likely due to issues with the Z(h) function evaluation. The code is well-structured with good documentation and appropriate error handling. Figures are saved but in the wrong location.

Grade Level: ✅ More than 50% Correct (12/15 tasks fully correct, 1/15 partially correct, 2/15 incorrect)