🌍 Week 4 Homework β€” Feedback

Student: Felice Urciuoli
Assignment: Extended IS–LM and Cholesky Decomposition


βœ… Overall Assessment

Result: βœ… More than 50% Correct

The student implements most components with reasonable code structure, but has critical errors in matrix construction that lead to economically incorrect results. The Cholesky decomposition and stochastic simulation are implemented correctly, but the IS-LM system setup contains fundamental mistakes that affect all economic interpretations.


πŸ” Task-by-Task Check

Task Description Status Notes
1 Parameter setup & system definition ❌ Critical Error: A matrix is [1, alpha; -beta, 1] instead of [1, alpha; -beta, gamma]. b vector is [-MP + theta*G] instead of [MP - theta*G]. These errors cause negative interest rates.
2 Equilibrium solution ⚠️ Solves system correctly given the wrong matrices, but results are economically meaningless (negative interest rates). Includes comparison of methods.
3 Comparative statics setup βœ… Correctly creates G grid using linspace(50, 150, 101), loops through values, and stores results in Y_grid and i_grid arrays.
4 Plotting comparative statics ⚠️ Creates separate figures for Y vs G and i vs G instead of subplots. Shows relationships but based on wrong system. No figure saving in code.
5 Cholesky decomposition βœ… Correctly defines Sigma matrix, computes eigenvalues, computes L using chol(Sigma, 'lower'), and verifies reconstruction error.
6 Stochastic simulation setup βœ… Correctly generates u ~ N(0,I) with proper dimensions (2Γ—10000), transforms to eps = L*u, and sets random seed (123).
7 Equilibrium distribution analysis βœ… Correctly computes means and covariance matrix. Results are based on wrong underlying system but method is correct.
8 Visualization of stochastic results βœ… Creates scatter plot correctly with proper labels and styling. No figure saving in code.

πŸ“ˆ Technical Implementation

  • Critical Matrix Errors:
    • A matrix: [1, alpha; -beta, 1] should be [1, alpha; -beta, gamma]
    • b vector: [-MP + theta*G] should be [MP - theta*G]
    • These errors cause negative interest rates and wrong economic relationships
  • Code Structure: Reasonable organization with clear sections and Italian comments
  • Numerical Methods: Uses correct A\b method and includes method comparison
  • G Grid: Uses linspace(50, 150, 101) which is economically reasonable
  • Figure Management: Missing saveas() commands in code
  • Error Handling: Checks reconstruction error for Cholesky decomposition

πŸ’¬ Style & Clarity

  • Code Quality: Reasonable structure with Italian section headers
  • Variable Naming: Logical names (G_grid, Y_grid, i_grid, x_eq)
  • Comments: Minimal comments, mostly in Italian
  • Output: Good use of fprintf with appropriate precision
  • Organization: Clear separation into three main parts

πŸ“Š Visual Output Assessment

Please remember to save the figures in the Figures folder!

Figure 1: week4_IS_LM1.png ⚠️

  • Layout: Separate figure for Y vs G
  • Relationships: Shows relationship, but interest rates are negative (economically wrong)
  • Labels: Proper axis labels and title
  • Styling: Clean appearance with grid
  • Issue: Negative interest rates indicate fundamental matrix errors

Figure 2: week4_IS_LM2.png ⚠️

  • Layout: Separate figure for i vs G
  • Relationships: Shows relationship, but interest rates are negative (economically wrong)
  • Labels: Proper axis labels and title
  • Styling: Clean appearance with grid
  • Issue: Negative interest rates indicate fundamental matrix errors

Figure 3: week4_scatter.png ⚠️

  • Distribution: Scatter plot showing correlated shocks
  • Correlation: Shows correlation structure, but based on wrong underlying system
  • Styling: Clean appearance with proper labels
  • Issue: Results based on incorrect matrix construction

βœ… Suggestions for Improvement

  1. Critical: Fix A matrix to [1, alpha; -beta, gamma] instead of [1, alpha; -beta, 1]
  2. Critical: Fix b vector to [MP - theta*G] instead of [-MP + theta*G]
  3. Important: Add saveas() commands to save figures automatically
  4. Style: Consider creating subplots instead of separate figures for comparative statics
  5. Verification: Check that interest rates are positive and economically reasonable

🎯 Summary

Reasonable implementation with critical economic errors. The student demonstrates understanding of matrix operations and stochastic simulation, but makes fundamental mistakes in the IS-LM system setup that lead to economically nonsensical results. Code structure is adequate but lacks figure saving.

Grade Level: βœ… More than 50% Correct (4/8 tasks fully correct, 2/8 partially correct, 2/8 incorrect)