🌍 Week 4 Homework β€” Feedback

Student: Giovanni Rampello
Assignment: Extended IS–LM and Cholesky Decomposition


βœ… Overall Assessment

Result: βœ… More than 50% Correct

The student demonstrates good code organization and implements most components correctly, including proper figure saving. The A matrix is correct. However, there is a critical sign error in the b vector construction in both Part 1 and Part 3 (uses theta*G - MP instead of MP - theta*G), which flips the LM intercept and affects the economic interpretation (can lead to negative interest rates for some G). Cholesky and simulation are implemented correctly.


πŸ” Task-by-Task Check

Task Description Status Notes
1 Parameter setup & system definition ❌ A is correct [1, alpha; -beta, gamma]. b has wrong sign: uses 0.1*G - 80 (Part 1) and theta*G - MP (Part 3) instead of MP - theta*G.
2 Equilibrium solution ⚠️ Solves A\\b correctly, but equilibrium values reflect the wrong b vector sign; includes backslash vs inv comparison.
3 Comparative statics setup βœ… Varies G over 50:2.5:200, recomputes equilibrium, preallocates arrays.
4 Plotting comparative statics βœ… Separate figures for Y(G) and i(G) with labels; saves as Output_vs_G.png and InterestRate_vs_G.png.
5 Cholesky decomposition βœ… Uses Sigma = [4 1.2; 1.2 3], checks eigenvalues, computes chol(...,'lower').
6 Stochastic simulation setup βœ… Generates u = randn(2,N), applies eps = L*u, uses N=10000, sets RNG seed.
7 Equilibrium distribution analysis βœ… Computes empirical covariance cov(Y_sim', i_sim'); reasonable pipeline.
8 Visualization of stochastic results βœ… Scatter of (Y,i) under shocks; saves Simulated_Y_i_Shocks.png.

πŸ“ˆ Technical Implementation

  • A matrix: Correct [1, alpha; -beta, gamma].
  • b vector sign error: Should be [Abar + bG*G; MP - theta*G]. Code uses 0.1*G - 80 and later theta*G - MP (sign flipped). This drives non-standard outcomes (e.g., negative i) beyond the simple linear model comment.
  • Figure saving: Correctly saves comparative statics and simulation figures.
  • Structure: Clear sections for Part 1–3; uses preallocation and consistent plotting.
  • Clarity: Helpful comment on negative rates, though the primary cause is the sign error in b.

πŸ’¬ Style & Clarity

  • Clear variable naming (Y_values, i_values, Y_sim, i_sim).
  • Uses fprintf and disp effectively.
  • Multiple clc,clear,close all resets within parts; works since parameters are redefined, but a single reset at the top would suffice.

πŸ“Š Visual Output Assessment

  • Output_vs_G.png and InterestRate_vs_G.png: Clean single-series plots; relationships reflect the sign choice in b.
  • Simulated_Y_i_Shocks.png: Reasonable scatter cloud with correlation consistent with Sigma.

βœ… Suggestions for Improvement

  1. Fix b vector to b = [Abar + bG*G; MP - theta*G] in both Part 1 and Part 3.
  2. Optionally combine comparative statics into subplots to mirror the solution file.
  3. Add means/covariance comparison to deterministic equilibrium for completeness.

🎯 Summary

Good implementation with a critical sign mistake in the b vector. With the sign corrected, the results would align with the expected IS–LM comparative statics and simulated distributions.

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