🌍 Week 5 Homework — Feedback

Student: Bakytkul Baltabay
Assignment: Solving Nonlinear Equations in Economics


✅ Overall Assessment

Result:More than 50% Correct

The student demonstrates good understanding of the numerical methods and implements all three exercises. The code is clean, well-structured, and produces correct results. However, there are critical issues: the figures are not saved and Figure 2 shows incorrect results (h* reaching 1.0 for sigma≥3, which is economically unreasonable). The IS-LM system formulation could be improved, but the overall implementation is methodologically sound.


🔍 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, M, P, k, lambda)    
1.2 IS-LM system definition ⚠️ Uses squared residuals approach instead of direct system F([Y;i])=0. Works but unconventional.    
1.3 Solve from two initial guesses Two guesses provided (x0_1=[700,2], x0_2=[800,5]) and both converge to same equilibrium    
1.4 Plot IS and LM curves Creates proper IS-LM plot with curves and equilibrium points marked    
1.5 Verify positive interest rate Uses lower bound constraint (lb=[0,1e-6]) to ensure positive interest rates    
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 implementation with proper convergence checks    
2.5 Plot h*(sigma) ⚠️ Creates plot but shows incorrect results (h* reaching 1.0 for sigma≥3, which is economically unreasonable)    
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) as required    
3.4 Record iterations and residuals Records and displays iterations and Z(h*) for all methods
3.5 Compare and discuss convergence ⚠️ Provides output but no explicit discussion comparing methods    

📈 Technical Implementation

  • IS-LM Approach: Uses squared residuals minimization with fmincon instead of direct root-finding. Works correctly but unconventional.
  • Code Structure: Clean organization with clear sections and good comments
  • Numerical Methods: Both bisection and damped Newton correctly implemented
  • Numerical Derivatives: Uses finite differences (dh=1e-6) for Newton method
  • Constraints: Properly uses lower bounds to ensure positive interest rates
  • Figure Management: CRITICAL: Missing commands to save figures - this is a requirement!
  • Advanced Features: Includes convergence tracking and proper bounds checking
  • Issue: Figure 2 shows h* reaching 1.0 for sigma≥3, suggesting numerical convergence issues or parameter problems (bisection algorithm itself is correct)

💬 Style & Clarity

  • Code Quality: Clean and well-structured with clear section headers
  • Variable Naming: Logical names (h_star, sigma_vals, x_sol1)
  • Comments: Minimal but appropriate comments
  • Output: Good use of fprintf to display results clearly
  • Organization: Clear separation into three exercises with proper headers
  • Documentation: Basic documentation of what each section does

📊 Visual Output Assessment

⚠️ CRITICAL: You must save all figures! This is a requirement for the homework.

Figure 1: IS-LM Equilibrium ✅

  • Layout: Single plot with IS and LM curves
  • Features: Marks equilibrium points from both guesses
  • Styling: Good styling with proper labels and legend
  • Saving: Missing: No command to save figures in code
  • Issue: Minor: axis labels could be more descriptive

Figure 2: Labor Supply vs Risk Aversion ⚠️

  • Layout: Single plot showing h* vs sigma
  • Features: Visualization shows incorrect results (h* reaching 1.0)
  • Styling: Good styling with proper labels
  • Saving: Missing: No exportgraphics() command in code
  • Issue: CRITICAL: Shows h* reaching 1.0 for sigma≥3, which is economically unreasonable. The bisection method appears to be hitting the upper bound rather than finding the true root. This suggests the bisection implementation may not be properly checking for convergence.

✅ Suggestions for Improvement

  1. CRITICAL: Add exportgraphics() or smiliar commands to save all figures automatically - this is a requirement!
  2. CRITICAL: Fix the bisection method in Exercise 2 - it’s hitting the upper bound (h=1) instead of finding the true root. Check your convergence criteria and ensure the function has a sign change in the interval.
  3. Important: Verify that your bisection method properly checks for convergence before exiting the loop
  4. Style: Consider using fsolve() instead of fmincon() for IS-LM to match standard root-finding approach
  5. Verification: Add a discussion comparing bisection vs Newton convergence speed
  6. Output: Consider adding a formatted table comparing methods for Exercise 3
  7. Advanced: Consider adding convergence tolerance checks to the bisection loop exit condition
  8. Style: Add more descriptive comments explaining the economic interpretation of results

🎯 Summary

Good implementation with understanding of numerical methods. The student correctly implements damped Newton and produces correct IS-LM results. However, there are critical issues: (1) figures are not saved - missing exportgraphics() commands is a requirement violation, and (2) Figure 2 shows incorrect results - h* reaching 1.0 for sigma≥3 indicates the bisection method is hitting the upper bound rather than finding the true root. The IS-LM approach using squared residuals is unconventional but works correctly. The student needs to fix the bisection convergence criteria and add figure saving commands.

Grade Level: ✅ More than 50% Correct (9/15 tasks fully correct, 3/15 partially correct, 3/15 incorrect)