π Week 5 Homework β Feedback
π Week 5 Homework β Feedback
Student: Ignazio Nunzi
Assignment: Solving Nonlinear Equations in Economics
β Overall Assessment
Result: β οΈ Partial <50% Correct
The student demonstrates good effort and code organization, implementing both bisection and Newton methods with comprehensive comparative statics analysis. However, there are critical errors in the IS-LM system formulation and the labor supply function definition that prevent correct economic interpretation. The submission includes advanced features like comparative statics and proper error handling, but fundamental mathematical errors undermine the results.
π Task-by-Task Check
| Task | Description | Status | Notes |
|---|---|---|---|
| 1.1 | Parameter setup for IS-LM | β | All parameters correctly defined (CZero, c, IZero, beta, T, G, MP, k, gamma) |
| 1.2 | IS-LM system definition | β | Critical Error: IS equation is (1-c)*gamma + beta*x(2)^2 instead of Y - C0 - c*(Y-T) - I0 + beta*i^2 - G. Wrong formulation entirely. |
| 1.3 | Solve from two initial guesses | β οΈ | Only one initial guess provided (Y=200, i=3). Missing second guess requirement. |
| 1.4 | Plot IS and LM curves | β | No plotting code for IS-LM curves. Only displays equilibrium values. |
| 1.5 | Verify positive interest rate | β οΈ | Notes negative interest rate but doesnβt fix it. No positive-branch constraint. |
| 2.1 | Parameter setup for labor supply | β | All parameters correctly defined (w, tau, a, g, phi, chi, sigma) |
| 2.2 | Define Z(h) function | β | Critical Error: Function is (1-tau)*w*h + a - g - sigma*(1-tau)*w - chi*(1-h)^phi instead of c(h)^(-sigma)*(1-tau)*w - chi*(1-h)^phi. Wrong formulation. |
| 2.3 | Loop over sigma values | β | Correctly loops over sigma β {1,2,3,4,5} |
| 2.4 | Solve using Bisection method | β οΈ | Implements bisection correctly but for wrong function. Includes sophisticated bracket-finding logic. |
| 2.5 | Plot h*(sigma) | β | Creates proper plot with subplots showing h, c, and iterations. Good visualization. |
| 3.1 | Implement Bisection method | β | Correct bisection implementation with proper convergence checks |
| 3.2 | Implement Damped Newton method | β οΈ | Implements Newton but without damping (alpha=1). Missing alpha parameter. |
| 3.3 | Test from multiple starting guesses | β οΈ | Uses single starting guess h0=0.5. Missing multiple guesses (0.2, 0.5, 0.8) requirement. |
| 3.4 | Record iterations and residuals | β οΈ | Records iterations but doesnβt display residuals table properly |
| 3.5 | Compare and discuss convergence | β | Provides discussion comparing bisection and Newton convergence |
π Technical Implementation
- Critical IS-LM Error: Wrong system formulation. IS equation doesnβt match the homework specification
- Critical Labor Supply Error: Function F(h) is algebraically incorrect. Should be
c^(-sigma)*(1-tau)*w - chi*(1-h)^phi - Code Structure: Good organization with clear sections and logical flow
- Comparative Statics: Good addition beyond requirements, analyzing multiple parameters (tau, a, chi, phi, sigma)
- Error Handling: Sophisticated bracket-finding logic for bisection when no sign change exists
- Newton Method: Implements Newton correctly but missing damping parameter (alpha=0.5)
- Figure Management: Creates multiple figures but missing
exportgraphics()commands to save them - Advanced Features: Includes comparative statics analysis, convergence tracking, and economic interpretation
π¬ Style & Clarity
- Code Quality: Good structure with clear section headers and comments
- Variable Naming: Logical names (
h_bis,c_bis,it_bis,conv_bis) - Comments: Good comments explaining the economic theory and methodology
- Output: Appropriate use of
fprintfwith formatted tables and progress indicators - Organization: Clear separation into logical sections with proper headers
- Documentation: Includes economic interpretation and discussion of results
- Advanced: Includes comparative statics analysis beyond requirements
π Visual Output Assessment
Please remember to save the figures in the Figures folder!
Figure 1: Labour-Leisure Results β οΈ
- Layout: Three subplots showing h, c, and iterations vs sigma
- Features: Compares bisection and Newton methods
- Styling: Good styling with proper labels and legends
- Saving: No figure saving in code
- Issue: Results based on incorrect function formulation
Figure 2-6: Comparative Statics β οΈ
- Layout: Multiple figures for different parameters (tau, a, chi, phi, sigma)
- Features: Shows h* and c* vs varying parameters
- Styling: Clean appearance with proper colors and formatting
- Saving: No figure saving in code
- Issue: Results based on incorrect function formulation
Missing: IS-LM Plot β
- No IS-LM curve plotting code found
- Requirement was to plot IS and LM curves with equilibrium point
β Suggestions for Improvement
- Critical: Fix IS equation to match homework specification:
Y = C0 + c*(Y-T) + I0 - beta*i^2 + G - Critical: Fix LM equation to:
M/P = k*Y - lambda*i(note: gamma should be lambda) - Critical: Fix labor supply function to:
Z(h) = c(h)^(-sigma)*(1-tau)*w - chi*(1-h)^phiwherec(h) = (1-tau)*w*h + a - g - Important: Add second initial guess for IS-LM (requirement: two different starting points)
- Important: Add IS-LM curve plotting code with equilibrium point marked
- Important: Add damping parameter (alpha=0.5) to Newton method implementation
- Important: Add multiple starting guesses (0.2, 0.5, 0.8) for convergence comparison
- Important: Add
exportgraphics()commands to save all figures automatically - Style: Consider using more descriptive variable names for the IS-LM system
- Verification: Check that results are economically reasonable (e.g., positive interest rates)
π― Summary
Good effort with critical mathematical errors. The student demonstrates programming skills, code organization, and comparative statics analysis beyond requirements. However, fundamental errors in the IS-LM system formulation and labor supply function definition prevent correct economic interpretation. The bisection and Newton implementations are methodologically sound but solving the wrong equations.
Grade Level: β οΈ Partial <50% Correct (5/15 tasks fully correct, 4/15 partially correct, 6/15 incorrect)