• header Image

Computing for Economics

Home/ Computing For Economics
Course Type Course Code No. Of Credits
Discipline Elective SLS2EC241 4

Course coordinator and team

Does the course connect to, build on or overlap with any other courses offered in AUD?

This course does not build on any prior courses. It provides the foundation for courses that use computation methods in data analysis and modelling..

Specific requirements on the part of students who can be admitted to this course: (Pre-requisites; prior knowledge level; any others – please specify)

Everyday familiarity with computer use. No prior programming experience is required.

No. of students to be admitted (with justification if lower than usual cohort size is proposed):

As per University norms.

Course scheduling (semester; semester-long/half-semester course; workshop mode; seminar mode; any other – please specify):

Semester.

How does the course link with the vision of AUD?

Computers are basic tools for knowledge workers today and equipping students to use them skillfully and effectively is necessary to fulfill AUD’s vision of becoming a premier institution of higher learning.

How does the course link with the specific programme(s) where it is being offered?

Economists must increasingly be able to program computers to carry out their tasks, whether in industry or academia, and whether their work be empirical or theoretical. This course equips masters students in Economics with this very imporant skill.

Pre-requisites: None

Objective:  This course is an in-depth introduction to the modern computing environment. It introduces students to the basics of programming, the fundamental types of data that might generally be encountered by economists and the most popular software libraries for working with them. It seeks to develop practical skills by hands-on work on tasks related to economics. It is proposed that the course be taught using either the R or Python language depending on the interests of the instructor/student as these are the most common programming language used currently by students.

Along with the development of particular skills and thereby increasing the efficiency with which students can make use of computers, another aim of this course is to demystify computing and equip students to participate in an informed way in debates and research regarding the social and economic impact of computing technology.

Course outcomes:

On successful completion of this course students will be able to:

  • Describe how numbers, text, columnar data and web documents are represented on computers and the limitations of these representations.
  • Write code for basic numerical analysis tasks.
  • Use databases for basic data cleaning, transformation and summarization tasks.
  • Write code to access services through web APIs.
  • Write code to scrape data from websites.
  • Produce documents and presentations using LaTeX
  • Carry out basic operations on a local or remote Linux shell.

Brief description of modules/ Main modules:

Citations in square brackets such as [PDA] refer to readings given in section 11 below.

 

Session

(2 hours each)

Topics

Description

Python Libraries/Readings

R Libraries/Readings

Common readings

Programming I: Introduces the basic skills and concepts required for students to start programming.

1-3

Introduction to the  programming environment.

Running code from the REPL and from a notebook. Expressions, variables, function calls, vectors, lists, subscripting. Defining functions. Variable scope.

[PDA], Ch. 1-3

[PCC], Ch. 2-5

[RDS2], Ch. 1,2

 

Data types: Internal representation of numbers, numeric vectors and text. Basic operations on these data types.

4-5

Numbers

Representations of numbers on the machine. Limits of 64- and 32-bit integers. Limits and precision of 64-, 32- and 16-bit IEEE754 floating point numbers. Floating point arithmetic and roundoff error.

 

Generating vectors of random numbers. Arithmetic with numeric vectors and matrices. Basic linear algebra operations. Speed/precision tradeoff in choice of floating point types.

numpy

[PDA], Ch. 4

[RDS2], Ch. 12

[ARP], Ch. 2-3

Goldberg, D. (1991). What every computer scientist should know about floating-point arithmetic. ACM computing surveys (CSUR)23(1), 5-48.

 

https://en.wikipedia.org/wiki/IEEE_754

 

 

6

 Text

Introduction to the Unicode standard. Encodings: latin1, UTF-8. Common string operations. Regular expressions.

[PDA], Ch. 7

[RDS2], Ch. 14-15

Spolsky, J.  (2003) ‘The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)’ https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/

 

 

7.

Dates/times

UTC. The Unix epoch. Time zones. Conversion of date/time to/from strings. Extracting components. Date/time arithmetic. Measuring run time of code.

[PDA], Ch. 12
datetime

[RDA2], 17
lubridate

 

  1. Databases: Using databases for data analysis tasks, specially on larger than memory datasets, making efficient use of modern multi-core CPUs.
  1. 8-13

Relational databases and SQL

Row-oriented and column oriented databases. Programming-language interface for databases.

Designing databases: column types, keys, relationships.

Single-table queries. Aggregation. SQL functions

Joins. Correlated queries.

Window functions.

Importing/exporting from CSV. Parquet files.

duckdb

duckdb

Beaulieu, A. (2020), Learning SQL, 3rd ed. O’ Reilly, Chs. 1-16

  1. Programming II: Develop the skills to develop slightly more complicated programs using control and data structures and files.
  1. 14-19

Data and control

Loops and conditionals. Standard imperative patterns like searching through a collection or accumulating a result in a loop.

 

Using data structures like lists, arrays and dictionaries.

 

Exception handling.

 

Example programs:

I. Produce Fibonacci series

2. Print multiplication table

3. Separate odd and even numbers from a list

4. Produce a histogram

5. Produce a word-frequency count from a text

6. Find roots using the bisection method

7. Solve a system of linear equations using Gaussian elimination.

8. Sudoku solver

9. Simple spelling checker

[PDA], Chapter 2

[PCC], Ch. 3-8

[RDS2], Ch. 25,26

[ARP], Ch. 4,7,8

 

  1. 20

Files

Filesystems and paths. Manipulating paths. Searching for files using patterns. Reading and writing text files.

[PDA], Ch. 2, 6

[PCC], Ch. 10

 

 

  1. Web: Obtaining data from the web using both APIs and web scraping
  1. 21-22

HTTP

High-level understanding of the HTTP protocol. Accessing APIs over HTTP. JSON.

[PDA], Ch. 6;

[PCC], Ch. 17
requests

[RDS], Ch 23, 23

httr2

Mozilla HTTP reference https://developer.mozilla.org/en-US/docs/Web/HTTP

  1. 23-25

HTML and Web scraping

High-level understanding of HTML. Using the developer console on the browser. Web-scraping of static pages. Web scraping of dynamic pages.

[PDA], Chapter 6

beautifulsoup, selenium, lxml

[RDS2], Ch. 24

rvest, rselenium

Mozilla HTML reference https://developer.mozilla.org/en-US/docs/Web/HTML

LaTeX: The LaTeX document preparation system

26

The LaTeX document preparation system

Structure of a LaTeX document. Equations. Bibliography. Presentations using Beamer.

 

 

Overleaf, “Learn LaTeX” in 30 minutes https://www.overleaf.com/learn/latex/Learn_LaTeX_in_30_minutes

Linux: A basic proficiency with the Linux environment is useful for using many open-source tools and cloud services. This module introduces the basics of Linux. It may be taught using the Windows Subsystem for Linux or cloud instances

27-28

The shell

The shell, redirection and basic file manipulation commands.

 

 

[LCL], Ch. 1-6

29

Permissions, processes and package management

The Linux security model, monitoring resource use and managing processes, package management

 

 

[LCL], Ch. 9,10,14

30

Accessing remote machines

ssh, rsync, wget, tmux

 

 

[LCL], Ch. 16,18

Main Reading list:

  • [ARP] Matloff, N. (2011) The Art of R Programming, No Starch Press
  • [LCL] Shotts, W. E., Jr (2012) The Linux Command Line, O’Reilly
  • [RDS2] Wickham, H. (2023) R for Data Science, 2nd ed., O’Reilly
  • [PCC] Mathes, E. (2023) Python Crash Course, 3rd ed, No Starch Press
  • [PDA] McKinney, W. (2022)  Python for Data Analysis, 3rd ed., O’Reilly. https://wesmckinney.com/book/

Pedagogy:

  • Instructional design: Classroom lectures supplemented by independent work by students.
  • Special needs (facilities, requirements in terms of software, studio, lab, clinic, library, classroom/others instructional space; any other – please specify): Classroom with audio-visual equipment and internet connection.
  • Expertise in AUD faculty or outside: expertise exists within the AUD faculty to teach this course.
  • Linkages with external agencies (e.g., with field-based organizations, hospital; any others): None

Assessment structure (modes and frequency of assessments)

  • Two mini-projects: 30% each.
  • Summative project: 40%.

 

Top