🌍 Week 4 Homework β€” Feedback

Student: Sofia Bruga
Assignment: Extended IS–LM and Cholesky Decomposition


βœ… Overall Assessment

Result: βœ… More than 50% Correct

The student demonstrates good code organization and effort, implementing most components correctly with proper figure saving and workspace management. While there is a critical error in the A matrix construction that affects the economic interpretation, she completes 6/8 tasks correctly, showing good programming skills and attention to detail.


πŸ” Task-by-Task Check

Task Description Status Notes
1 Parameter setup & system definition ❌ Critical Error: A matrix is [1, alpha; beta, -gamma] instead of [1, alpha; -beta, gamma]. Missing negative sign on beta. b vector is correct.
2 Equilibrium solution ⚠️ Solves system correctly given the wrong A matrix, but results are economically incorrect due to matrix error.
3 Comparative statics setup βœ… Correctly creates G grid (0:10:200), loops through values, and stores results in Y_values and i_values arrays.
4 Plotting comparative statics βœ… Creates single plot with both Y and i vs G. Shows relationships correctly given the wrong system. Saves figures properly.
5 Cholesky decomposition βœ… Correctly defines Sigma matrix, checks eigenvalues > 0, computes L using chol(Sigma, 'lower'), and verifies decomposition.
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, variances, and covariances. Verifies means β‰ˆ deterministic equilibrium.
8 Visualization of stochastic results βœ… Creates scatter plot correctly with proper labels and styling. Saves figure and workspace.

πŸ“ˆ Technical Implementation

  • Critical Matrix Error: A matrix [1, alpha; beta, -gamma] should be [1, alpha; -beta, gamma] (missing negative sign on beta)
  • Code Structure: Excellent organization with clear sections and detailed comments
  • Numerical Methods: Uses correct A\b method and efficient A^(-1) computation
  • Figure Management: Properly saves both figures (.png and .fig files) and workspace (.mat file)
  • Error Handling: Checks positive definiteness of Sigma matrix
  • Output Formatting: Good use of fprintf and disp for results

πŸ’¬ Style & Clarity

  • Code Quality: Very well-commented with clear section headers and economic interpretation
  • Variable Naming: Logical names (G_values, Y_values, i_values, x_star)
  • Documentation: Includes economic equations in comments (IS and LM curves)
  • Visualization: Clean plots with proper legends, labels, and styling
  • Effort: Shows excellent attention to detail and professional code organization

πŸ“Š Visual Output Assessment

Please remember to save the figures in the Figures folder!

Figure 1: Comparative_statics.png ⚠️

  • Layout: Single plot with both Y and i vs G (alternative to subplots, but valid)
  • Relationships: Shows relationships, but based on incorrect A matrix
  • Labels: Proper axis labels and title
  • Styling: Clean appearance with legend and grid
  • Saving: Correctly saves figure and .fig file

Figure 2: stochastic_scatter.png ⚠️

  • Distribution: Elliptical scatter plot showing correlated shocks
  • Correlation: Shows correlation structure correctly
  • Styling: Good use of MarkerFaceAlpha for transparency
  • Saving: Correctly saves figure and workspace
  • Issue: Results based on incorrect underlying system due to matrix error

βœ… Suggestions for Improvement

  1. Critical: Fix A matrix to [1, alpha; -beta, gamma] instead of [1, alpha; beta, -gamma]
  2. Important: Consider creating separate subplots for Y vs G and i vs G for clearer visualization
  3. Style: Add semicolons on assignment lines to reduce command window output
  4. Verification: Check that results are economically reasonable (positive interest rates, correct slopes)

🎯 Summary

High-quality submission with excellent code organization and effort, but one critical economic error. The student demonstrates strong programming skills, proper figure management, and attention to detail. However, the missing negative sign in the A matrix prevents correct economic interpretation of the IS-LM system.

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