π Week 5 Homework β Feedback
π 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
fprintfto 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
- Critical: Check Exercise 2 results - the labor supply plot appears to show incorrect values
- Important: Save figures in a
Figures/folder for better organization - Style: Add more detailed discussion of convergence comparison in Exercise 3
- 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)