π Week 4 Homework β Feedback
π 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 uses0.1*G - 80and latertheta*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
fprintfanddispeffectively. - Multiple
clc,clear,close allresets within parts; works since parameters are redefined, but a single reset at the top would suffice.
π Visual Output Assessment
Output_vs_G.pngandInterestRate_vs_G.png: Clean single-series plots; relationships reflect the sign choice inb.Simulated_Y_i_Shocks.png: Reasonable scatter cloud with correlation consistent withSigma.
β Suggestions for Improvement
- Fix b vector to
b = [Abar + bG*G; MP - theta*G]in both Part 1 and Part 3. - Optionally combine comparative statics into subplots to mirror the solution file.
- 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)