Week 4
Week 4 – Matrix Algebra for Economics
Learning Outcomes By the end of this week, students will be able to:
- Create and manipulate matrices in MATLAB.
- Understand the difference between element-wise and matrix operations.
- Solve systems of linear equations relevant to economics.
- Compute matrix inverses, determinants, and eigenvalues.
- Apply matrix algebra to a simple macroeconomic model (e.g., IS–LM).
Suggested Readings
- Frain, MATLAB for Economics and Econometrics, Ch. 2.1.1–2.1.13 (Matrix operations).
- Greenwood & Marto, Numerical Methods for Macroeconomists, Appendix A.10 (Eigenvalues & Eigenvectors).
- MatlabCheatSheet.pdf – Matrix operations section.
In-Class Activities
- Construct small matrices and perform:
- Addition, subtraction, scalar multiplication.
- Element-wise multiplication (
.*
) vs. matrix multiplication (*
).
- Solve a 2×2 linear system representing goods and money market equilibrium using:
- The backslash operator (A\b).
- inv() (and discuss why it’s less efficient).
- Compute determinants and eigenvalues of a transition matrix.
- Demonstrate stability analysis in a 2-equation dynamic system using eigenvalues.
Homework / Practice
- Write a script that:
- Defines an IS–LM model as a system of equations.
- Represents it in matrix form.
- Solves for equilibrium output and interest rate.
- Extend the script to:
- Change a parameter (e.g., government spending) and re-solve.
- Plot how equilibrium values change with the parameter.
- Compute the Cholesky decomposition of a given covariance matrix to simulate correlated shocks to the IS and LM equations and analyze their impact on equilibrium outcomes.
Files
- Slides Week 4 – Slides from lecture.
- week4.m – Example script from lecture.
- codes_week4 on Matlab online
- week4_micro_exercise1.m – Solution file for micro-exercise 1 in class.
- week4_micro_exercise2.m – Solution file for micro-exercise 2 in class.
- week4_micro_exercise3.m – Solution file for micro-exercise 3 in class.
- week4_homework_solution.m – Solution file for homework.
Homework submission
- Submit your homework here
- Please upload your homework as a single zip file. Access it’s now open with any email address! But remember to name your file with your full name and or student ID.
- The submission should include the .m file used to produce the results.
- You can modify you submission until the beginning of week 5.