{ "cells": [ { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Foundations of Computational Economics\n", "\n", "by Fedor Iskhakov, ANU\n", "\n", "" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "fragment" } }, "source": [ "## Course introduction. Housekeeping\n", "\n", "" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "\n", "\n", "[https://youtu.be/CJF45YGXKXw](https://youtu.be/CJF45YGXKXw)\n", "\n", "Description: What is computational economics. Course structure and house keeping. Choice of programming language." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false, "scrolled": true, "slideshow": { "slide_type": "slide" } }, "outputs": [], "source": [ "# Install the RISE extension for Jupyter notebook to display slides\n", "# Reload the page and press Alt-r to switch to presentation mode\n", "!pip install RISE\n", "!jupyter-nbextension install rise --py --sys-prefix\n", "!jupyter nbextension enable rise --py --sys-prefix" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### Computational economics\n", "\n", "This course will teach the basics of *programming and computational\n", "skills* for economic analysis and enable the students to take *numerical\n", "approach to familiar mathematical problems*.\n", "\n", "Students will learn to\n", "graphically represent familiar ideas such as supply and demand curves,\n", "equilibrium prices and consumer choice. They will explore how these\n", "choices and equilibria change with shifts in policy instruments,\n", "preferences and technologies.\n", "\n", "In the process they will learn to use\n", "common computational solution methods, such as root finding and\n", "optimization, function approximation, numerical integration, and\n", "working with random variables.\n", "\n", "Students will also learn how to obtain, manipulate and\n", "represent data, using tools such as scatter plots and histograms." ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### What is computational economics?\n", "\n", "Use of computer to analyze (solve + simulate) complicated economic\n", "models that do not allow for analytical solutions\n", "\n", "Useful because the models are becoming more realistic and thus\n", "complicated\n", "\n", "- Macroeconomics: heterogeneous agents, overlapping generations \n", "- Microeconomics: dynamic games \n", "- Structural econometrics: estimating complex models with micro-data \n", "- Advanced econometrics: computationally intensive methods " ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### You will learn\n", "\n", "1. Code up a given economics model and numerically solve it \n", " - basic programming skills \n", " - how to better design and write code \n", " - how to be more efficient in programming \n", "1. Implement familiar mathematical methods on a computer \n", "1. Study model behavior for economic analysis \n", " - analyze what happens with predictions when parameters change \n", "1. Manipulate and visualize economic data \n", " - both simulated from models and observed " ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Lecturer: Dr. Fedor Iskhakov\n", "\n", "Фёдор Валентинович Исхаков\n", "\n", "Professor of Economics, Research School of Economics, Australian National University\n", "\n", "- PhD in Economics from University of Oslo, Norway, 2009 \n", "- Candidate Sc. (к.э.н.) in Economic Cybernetics, St.Petersburg State University, 2006 \n", "\n", "\n", "Research interests: applied econometrics, i.e. structural estimation of\n", "dynamic models\n", "\n", "Email: [fediskhakov@gmail.com](mailto:fediskhakov@gmail.com) (office hours: by appointment in Zoom)\n", "\n", "More info: [fedor.iskh.me](http://fedor.iskh.me)" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Schedule\n", "\n", "**Course delivery: remotely, asynchronously, with bi-weekly synchronous Q&A sessions**\n", "\n", "Teaching materials will be published **on Tuesday or Wednesdays**\n", "\n", "Every other week starting from week 3 **on Thursdays** we’ll have\n", "live Q&A sessions with no compulsory attendance\n", "\n", "I’ll collect more information about your scheduling preferences,\n", "and we’ll work out the clashes." ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### What lectures and lab tutorials contain\n", "\n", "- Material is organized by technical topics, but each time will be\n", " illustrated with various **economic problems** \n", "- Theoretical videos provide the theoretical background and some small\n", " executable examples \n", "- Practical videos give *hands on* experience of how the studied methods help\n", " in particular economic applications " ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Book(s)\n", "\n", "$ \\downarrow\\quad $ **Computer science**\n", "\n", "- [Introduction to Python for Econometrics, Statistics and Data Analysis by Kevin Sheppard](https://www.kevinsheppard.com/files/teaching/python/notes/python_introduction_2019.pdf) \n", "- [Lectures in Quantitative Economics (QuantEcon.org)](https://quantecon.org/python-lectures/) \n", "- [Dynamic Economics. Quantitative Methods and Applications by Russel&Cooper](https://books.google.com.au/books/about/Dynamic_Economics.html?id=d6MD_DWhqwwC&redir_esc=y) \n", "\n", "\n", "$ \\uparrow\\quad $ **Economics**\n", "\n", "There will be additional materials referenced for each topic." ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Assessment 1: Weekly problem sets\n", "\n", "Small exercises to give you an opportunity to\n", "try implementation of the material from the lectures. Intended to be\n", "solved individually or in groups during the week.\n", "Should be discussed in Q&A sessions, and serve as building blocks in the\n", "larger assignments and applications.\n", "\n", "**25% of final grade**" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Assessment 2: Midterm assignment\n", "\n", "Midterm assignments are coding tasks of implementing simple economic\n", "models to be performed in groups of 2-3 people. The assignments will be graded for correct implementation of\n", "the economic model, but also for code style and proper use of version\n", "control tools. Several models will be offered for implementation, each\n", "accompanied with a set of tasks to perform.\n", "\n", "Grade will be in part based on the video presentation of the model\n", "and the implementation to be prepared by each group (via zoom/other video conferencing).\n", "\n", "**27.5% of the final grade**" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Assessment 3: Video presentation\n", "\n", "Midterm project will require a (video) presentation of the completed assignment\n", "(details will follow)\n", "\n", "**20% of the final grade**" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Assessment 4: Final exam\n", "\n", "Open book exam with time constraint (3 hours)\n", "\n", "The final exam will contain several short answer questions (knowing the\n", "facts), several middle size questions (find a bug in the code) and\n", "several small individual coding tasks (write your code).\n", "\n", "Why is it hard: there is no time to search for an answer.\n", "\n", "**27.5% of the final grade**" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Communication with the lecturer\n", "\n", "1. Announcements on the course page \n", "1. Email\n", " [fed.iskhakov@gmail.com](mailto:%20fediskhakov@gmail.com) \n", "1. Zoom by appointment " ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Version control with Git\n", "\n", "We will use **version control** software Git and online community\n", "GitHub\n", "\n", "- Using version control is essential for efficient coding work \n", "- Having registration at GitHub is essential for computational\n", " economist \n", "\n", "\n", "1. Learning Git is part of the course, will be tested in the\n", " exam/assignments \n", "1. Registration at GitHub is optional and not essential for passing the\n", " course, although will make the workflow a lot smoother \n", "\n", "\n", "This week’s lab is about Git and GitHub" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Jupyter Notebooks\n", "\n", "- We will use Juputer Notebook for exploring and running the code \n", "- Great way to present your coding work \n", "- This and all other slides are made in notebooks \n", "- Assignments and the exam will be done in notebooks \n", "- You should consider using notebooks to present your work! " ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### Introduction to Python\n", "\n", "\n", "\n", "- General–purpose programming language capable of performing *many\n", " different tasks* including scientific computing \n", "- Open source (free!), development coordinated through the [Python\n", " Software Foundation](https://www.python.org/psf/) \n", "- Experienced rapid adoption in the last decade, and is now one of the\n", " most popular programming languages " ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Popularity of Python\n", "\n", "\n", "\n", "Source: [StackOverflow](https://stackoverflow.blog/2017/09/06/incredible-growth-python/)." ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Scope of Python\n", "\n", "\n", "\n", "Source: [Quora](https://www.quora.com/What-are-the-places-where-Python-is-used)." ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Low and high level programming languages\n", "\n", "1. Low level languages (Assembler, FORTRAN, C, C++) \n", " - Very fast \n", " - Very verbose \n", "1. High level languages (Matlab, R, **Python**) \n", " - Slower (although not for all tasks and circumstances) \n", " - A lot more concise \n", " - Versatile with (usually) many libraries \n", "\n", "\n", "What to choose?" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Trade-off\n", "\n", "" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Verbosity\n", "\n", "\n", "\n", "Source: [blog.revolutionanalytics.com](http://blog.revolutionanalytics.com/2012/11/which-programming-language-is-the-most-concise.html)." ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Speed comparisons for economic problems\n", "\n", "[Aruoba, S. Borağan & Fernández-Villaverde, Jesús, 2015. “A comparison of programming languages in macroeconomics,”](http://econweb.umd.edu/~webspace/aruoba/research/paper24/Aruoba_FernandezVillaverde_Programming)\n", "Journal of Economic Dynamics and Control, Vol. 58(C), pages 265-273.\n", "\n", "[Aruoba, S. Borağan & Fernández-Villaverde, Jesús, 2015. “A Comparison of Programming Languages in Economics: An Update”](https://www.sas.upenn.edu/~jesusfv/Update_March_23_2018.pdf)\n", "\n", "[Jules Kouatchou, NASA. “Basic Comparison of Python, Julia, Matlab, IDL and Java (2018 Edition)”](https://modelingguru.nasa.gov/docs/DOC-2676)" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Speed comparisons from Aruoba & Fernández-Villaverde\n", "\n", "\n", "\n", "" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Objective function\n", "\n", "Development and maintenance time $ + $ (run time $ \\times $\n", "number of runs) $ \\longrightarrow $ MIN\n", "\n", "**Minimizing one component only is suboptimal!** (premature optimization)\n", "\n", "- High level language (Python) for overall structure and appearance \n", "- Low level language (C or C++) for computational bottlenecks \n", "- Necessary to also think about \n", " - Vectorization \n", " - Parallelization (scalability) " ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "#### Why Python for Computational Economics?\n", "\n", "- Versatile high level programming language \n", "- High quality scientific libraries (NumPy, SciPy, Pandas, Matplotlib) \n", "- Parallelization and just-intime (JIT) compilation \n", "- Modern machine learning libraries (Tensorflow API, Scikit Learn) \n", "- Vast array of free libraries in other fields (web, networks, natural\n", " language processing) \n", "- Positive spillovers from popularity (Stack Overflow) " ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### Further learning resources\n", "\n", "- Why Python by QuantEcon\n", " [https://python-programming.quantecon.org/about_py.html#overview](https://python-programming.quantecon.org/about_py.html#overview) \n", "- Guide to choosing programming language by Florian Oswald (SciencesPo Paris)\n", " [https://scpo-compecon.github.io/CoursePack/assets/static/HTML/intro.html#40](https://scpo-compecon.github.io/CoursePack/assets/static/HTML/intro.html#40) \n", "- Comparing programming languages by NASA Modeling Guru\n", " [https://modelingguru.nasa.gov/docs/DOC-2676](https://modelingguru.nasa.gov/docs/DOC-2676) " ] } ], "metadata": { "celltoolbar": "Slideshow", "date": 1612589584.261502, "download_nb": false, "filename": "01_introduction.rst", "filename_with_path": "01_introduction", "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.6" }, "title": "Foundations of Computational Economics" }, "nbformat": 4, "nbformat_minor": 4 }