Syllabus

Undergraduate Computational Macroeconomics

Author

Jesse Perla, UBC

Course Overview

This is a course in computational tools used in macroeconomics. You are expected to have some proficiency in Matlab, Python, Julia, and similar languages as fulfilled in the prerequisites (i.e., ECON 323, CPSC 103, CPSC 110, MATH 210, COMM 337). Even intermediate knowledge of R is typically not sufficient.

Models in macroeconomics and financial economics are constructed from a core set of tools which model each agents’ decisions while maintaining an internal consistency between the decisions of complicated distributions of other agents in an economy.

Some of the common features of models in macroeconomics and financial economics include:

  1. dynamic and forward looking decisions: If I consume less today, I can save more for tomorrow;
  2. randomness and uncertainty about the future: If reject a job offer, I am not sure when the next offer will occur;
  3. prices and resources reflecting the collective decisions of other agents: The wage I am offered depends on the number of similar workers I am competing with, the intensity which the unemployed search for jobs, and the demand for my skills from firms;
  4. social learning from other agents’ with information aggregated through prices: If many others consider a particular equity or bond asset a good buy, then I can infer this by the price of the asset itself; and
  5. distributions and heterogeneity in the economy influencing decisions and prices: If the distribution of income is askew and there are many poor agents living hand-to-mouth, government policy such as sending out stimulus cheques has a different effect on inflation and consumer welfare than if every person had similar incomes.

The interaction between these makes it difficult to do counter-factual experiments with “partial-equilibrium” in macroeconomics—i.e., changing one price or element of the model in isolation—because of the interconnection of decisions, prices, and distributions. However, by writing formal models in mathematics, we can conduct policy experiments and interpret data while still ensuring all of these conditions for self-consistency. Using precise mathematical language will (1) uncover unanticipated consequences implicit in your assumptions; (2) keep everyone honest; (3) provide a framework to investigate changes in assumptions; and (4) allow disciplined nesting of models to add enough “reality” for quantitative analysis.

The downside is that while this set of mathematical tools provides a rich set of economic theories that can be explored and tested against the data, the inherent difficulty of dynamic models means that we may usually need to solve them approximately and on a computer.

This course is designed to jointly explore these sorts of theoretical models in conjunction with the computational tools to solve and simulate them. We will learn using the Julia programming language—–a modern language for scientific and technical computing. If you have an existing background in Python or Matlab from other courses you will find that Julia compliments those skills.

Learning Outcomes

By the end of the course, you will be able to

  1. program using tools from linear algebra, probability, and optimization
  2. simulate and analyze stochastic processes for the purpose of understanding the evolution of the wealth distribution
  3. describe economic dynamics as a linear state space model and solve them numerically
  4. implement and analyze Markov chains, and apply them to models of unemployment and asset pricing
  5. investigate the role of general equilibrium and prices in aggregating information and reflecting the real economy
  6. define economic problems recursively, such labor market search and consumption savings models, and solve them numerically
  7. define and implement dynamic models of growth

Assignments and Assessment

The only way to learn how to apply programming to economic problems is practice. To aid this, a significant portion of the assessment will be in the form of problem sets.

The weighting in the grade is:

  • 6-8 problem sets: 20% (total)
  • Midterm exam: 30%
  • Final exam: 50%

Both the midterm and final examinations will be done in a computer lab or on your own computer in class and contain a mixture of theory and computational questions.

The problem sets will start off short and easy to help those with less programming experience, and then build in complexity. This is a macroeconomics class, not a programming class, so you should not be worried about the quantity of code required.

Missed Exam Policy: You are responsible for ensuring that you take these exams as scheduled; no make-up exams will be given. - Missing a midterm for ANY acceptable reason will result in its weight being automatically transferred to the final exam. - The final exam date will be announced by Student Services about half-way through the term. - There is no make-up final. Travel plans and/or cheap tickets are not a reason to miss exams. If you have a medical or other compelling reason why you cannot take the final exam at its scheduled time you must follow the formal process and get an Academic Concession from your Faculty Advising Office (see below)

Course Outline

We will cover the following topics, with the later topics only if time-permits.

Basic Programming Review

  • Topics include: Getting Started and Julia Essentials
  • At the end of the section you will have reviewed the basic setup of the Julia programming language and can comfortably accomplish simple tasks as they would in to Python or Matlab.

Linear algebra and basic scientific computing

  • Topics include Arrays and Related Types and related topics in implementing Linear Algebra. In addition, you will review Optimizers and Solvers.
  • Interested students can review bonus material in Generic Programming but it wouldn’t be required or tested.
  • At the end of the section you will feel comfortable working with matrices, vectors, and arrays; solving linear systems and calculating eigenvalues; optimizing unconstrained and constrained functions; and solving systems of equations.

Geometric Series and Discrete Time Dynamics

  • Topics include Geometric Series and Dynamics in One Dimension
  • At the end of the section you will understand how to calculate present discounted values, work with Keynesian money-multipliers, and fixed points of dynamic Models.

Stochastic Processes and Dynamics of Wealth and Distributions

  • Topics include AR1 Processes and Wealth Distribution Dynamics
  • At the end of the section you will better ergodic distributions, measures of inequality, and how to simulate the dynamics of the wealth distribution.

Linear State Space Models

  • Topics include Linear State Space Models
  • At the end of this week you will understand how to describe processes such as asset pricing and consumption smoothing as linear-state space models, simulate them, and calculate present-discounted values using those stochastic processes.

Permanent Income Model

  • Topics include The Permanent Income Model
  • At the end of the section you will understand how to implement the classic consumption-savings model with linear-quadratic preferences in the LSS framework of the previous lecture, and to simulate permanent and transitory shocks to income.

Markov Chains

  • Topics include Finite Markov Chains
  • At the end of the section you will understand how to describe discrete-state stochastic processes as Markov chains and simulate models of unemployment for a worker.

Models of Unemployment

  • Topics include the Lake Model of Employment and Unemployment
  • At the end of the section you will build on the previous tools of Markov chains to look at a aggregated models of employment and unemployment in the economy.

Rational Expectations and Firm Equilibria

  • Topics include Rational Expectations Equilibrium
  • At the end of the section you will understand the core “big K, little k” insight for implementing rational expectations equilibria and apply it to models of firm dynamics.

Asset Pricing

  • Topics include Asset Pricing with Finite State Models
  • At the end of the section you will understand pricing assets with payouts following a Markov-chain as derived in the previous lectures.

Lucas Trees

Recursive Equilibria and the McCall Search Model

  • Topics include The McCall Search Model
  • At the end of the section you will be able to define and solve basic models of labor market search.

General Policies

Policy on Collaborating on Assignments:

Students are encouraged to work together on assignments throughout the course. However, all students must independently write solutions up and submit separately. If the code and writeup is too close then a penalty or a zero will be given for all students involved.

Student Success:

UBC provides resources to support student learning and to maintain healthy lifestyles but recognizes that sometimes crises arise and so there are additional resources to access including those for survivors of sexual violence. UBC values respect for the person and ideas of all members of the academic community. Harassment and discrimination are not tolerated nor is suppression of academic freedom. UBC provides appropriate accommodation for students with disabilities and for religious, spiritual and cultural observances. UBC values academic honesty and students are expected to acknowledge the ideas generated by others and to uphold the highest academic standards in all of their actions. Details of the policies and how to access support are available here: https://senate.ubc.ca/policies-resources-support-student-success/.

Policy on sharing course materials:

All the materials provided to you as part of this course are protected by copyright. All assignment instructions, quiz questions and answers, discussion questions, announcements, lecture slides, audio/video recordings, Canvas modules, and any other materials provided to you by your instructor or in the textbook are for use only by students enrolled in this course this term. Sharing any of these materials beyond this course, including by posting on file-sharing websites (e.g., CourseHero, Google Docs) is a violation of copyright law and an academic offence. Copying and pasting sentences from the lecture notes or the textbook (e.g., definitions) into for-profit software (e.g., Quizlet) is likewise a violation of copyright law, and an academic offence. Violations of this policy will be treated according to the provisos of the Code of Student Conduct. For further information about copyright law, please refer to (https://copyright.ubc.ca/students/).

Policy on Academic Honesty:

It is the policy of the Vancouver School of Economics to report all violations of UBC’s standards for academic integrity to the office of the Dean of Arts. All violations of academic integrity standards will result in a grade of zero on the relevant assessment (exam, paper, assignment etc.). Students who do not have a previous offence may have the option to enter into a diversionary process with the Dean of Arts to resolve their misconduct (https://academicintegrity.ubc.ca/diversionary-process/). Any student who has a previous academic offence will be referred to the President’s Advisory Committee on Student Discipline (PACSD) (https://universitycounsel.ubc.ca/homepage/guides-and-resources/discipline/). PACSD may impose additional penalties including: a transcript notation indicating that the student has committed an academic offence, zero in the course, and/or suspension or expulsion from the University. You are personally responsible for understanding and following the UBC’s policies for academic integrity: https://vancouver.calendar.ubc.ca/campus-wide-policies-and-regulations/academic-honesty-and-standards. A Canvas module has been made available you for this purpose titled “Avoiding Academic Misconduct”. It is your responsibility to read the materials in that module before submitting any work in this course. Speak to your instructor if you have any questions regarding the standard for academic integrity at UBC and/or the VSE polices on academic misconduct.

Policy on Academic Concessions:

There are only three acceptable grounds for academic concessions at UBC: unexpected changes in personal responsibilities that create a schedule conflict; medical circumstances; and compassionate grounds when the student experiences a traumatic event, sexual assault, or death in the family or of a close friend. Academic concessions for graded work and exams are granted for work that will be missed due to unexpected situations or circumstances. Situations that are expected (such as time constraints due to workload in other courses) or are predictable (such as being scheduled for paid work) are not grounds for academic concession.

Requests for academic concessions should be made before the due date for that graded work and/or the writing of the exam. UBC policy does not allow for concessions to students who have missed work because they have registered for a course after the due date for that work. You can read more about the rules for academic concessions here: https://students.ubc.ca/enrolment/academic-learning-resources/academic-concessions. Students in the Faculty of Arts who require a concession can apply for concessions using this form here: https://students.air.arts.ubc.ca/academic-concession-form/. Students in other Faculties should consult their faculty website on academic concessions. Please note that the role of the faculty advising office is to review the evidence and to either support or not support concession requests. The final decision to grant the request always rests with your instructor.

Policy on the Use of AI Learning Tools:

Students are permitted to use artificial intelligence tools, including generative AI, to gather information, review concepts or to help produce assignments. However, students are ultimately accountable for the work they submit, and any content generated or supported by an artificial intelligence tool must be cited appropriately. Use of AI tools of any type is not permitted during exams.

VSE Policy Prohibiting the Hiring of Tutors:

The Vancouver School of Economics expressly prohibits any student from hiring a tutor and/or editor to assist with any portion of written work or academic research. If at any point you feel in need of additional writing support, please speak with your instructor and/or arrange for a writing consultation with UBC’s Centre for Writing and Scholarly Communication (https://writing.library.ubc.ca/). Additionally, you have access to research support through the UBC Library: https://guides.library.ubc.ca/econ and https://guides.library.ubc.ca/econ490.

Any student who hires a tutor and/or editor to assist with any portion of written work or academic research will be given a zero on that component of the course and will be reported to the Dean’s office for academic misconduct (please see Policy on Academic Honesty).