π Week 5 Homework β Feedback
π Week 5 Homework β Feedback
Student: Simone Iudice
Assignment: Solving Nonlinear Equations in Economics
β Overall Assessment
Result: β More than 50% Correct
Good submission implementing all three exercises with clear documentation and appropriate methodology. The IS-LM implementation is correct, Exercise 2 bisection is properly implemented, and Exercise 3 demonstrates understanding of convergence comparison. However, Exercise 1 is missing a second initial guess as required, and Exercise 2 has incomplete sign change logic that could affect convergence.
π 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: [Y-(C0+c*(Y-T)+I0-beta*i^2+G); MP-(k*Y-lambda*i)] |
| 1.3 | Solve from two initial guesses | β | Issue: Only one initial guess provided (x0=[900;2]). Missing second guess requirement. |
| 1.4 | Plot IS and LM curves | β | Creates IS-LM plot with equilibrium point and proper styling |
| 1.5 | Verify positive interest rate | β | Verifies positive interest rate with conditional check |
| 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 logic but uses Z(a0)*Z(c) < 0 without updating values |
| 2.5 | Plot h*(sigma) and interpret | β | Creates plot and provides economic interpretation |
| 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) |
| 3.4 | Record iterations and residuals | β | Creates results table with all metrics |
| 3.5 | Compare and discuss convergence | β | Provides detailed discussion comparing methods |
π Technical Implementation
- IS-LM System: Correct implementation using
fsolve()with proper formulation - Labor Supply Function: Correct mathematical formulation with appropriate bounds [1e-6, 1-1e-6]
- Bisection in Exercise 2: Issues with sign change logic - evaluates Z(a0) and Z(c) without updating these values in the loop
- Bisection in Exercise 3: Correct bisection implementation
- Damped Newton: Correct implementation with alpha=0.5 and numerical derivative
- Error Handling: Includes sign change checks and proper convergence criteria
- Figure Management: β Saves figures in βFigures/β folder
- Advanced Features: Includes economic interpretation and detailed discussion
π¬ Style & Clarity
- Code Quality: Clear structure with comprehensive comments
- Variable Naming: Clear and logical names (
h_star,sigma_values,xstar) - Comments: Good comments explaining methodology and economic interpretation
- Output: Appropriate use of
fprintfand table display - Organization: Clear separation into three exercises with proper headers
- Documentation: Includes detailed 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 identifies equilibrium and verifies positive interest rate
- Styling: Appropriate styling with proper labels and legend
- Saving: β
Saves with
saveas()in βFigures/β folder
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 and grid
- Saving: β
Saves with
saveas()in βFigures/β folder
β Suggestions for Improvement
- Critical: Exercise 1 requires two different initial guesses to solve from (currently only one provided)
- Important: Fix bisection loop in Exercise 2 - need to update
a0orb0values, not just checkZ(a0)*Z(c) < 0without updating the interval endpoints - Style: Consider adding projection to keep h in [0,1] in the Newton method
- Verification: Add more detailed output for Exercise 2 showing iteration count and residual for each sigma
π― Summary
Good submission with minor issues. The student demonstrates understanding of numerical methods and implements all three exercises. The IS-LM implementation is correct, Exercise 3 is implemented with appropriate bisection and damped Newton methods, and figures are properly saved. However, Exercise 1 is missing the second initial guess requirement, and Exercise 2βs bisection loop has a logic issue that could affect convergence (evaluating Z(a0) without updating it in the loop).
Grade Level: β More than 50% Correct (13/15 tasks fully correct, 1/15 partially correct, 1/15 incorrect)