UC-MACSS / persp-analysis_A18

Perspectives on Computational Analysis (MACS 30000), Autumn 2018
31 stars 49 forks source link

MACS 30000: Perspectives on Computational Analysis (Autumn 2018)

Dr. Richard Evans Joshua G. Mausolf (TA) Nora Nickels (TA)
Email rwevans@uchicago.edu jmausolf@uchicago.edu nnickels@uchicago.edu
Office 208 McGiffert House 204 McGiffert House 205 McGiffert House
Office Hours Tu 10:30a-12:30p M 1:30p-3:00p W 2:00p-4:00p
GitHub rickecon jmausolf nnickels

Course Description, Objectives, and Outcomes

Computational Social Science (CSS) combines the theoretical paradigms of the social sciences with the expanded data and computational methods of computer science. Massive digital traces of human behavior and ubiquitous computation have both extended and altered classical social science inquiry. This course surveys successful social science applications of computational approaches to the representation of complex data, information visualization, and model construction and estimation. We will examine the scientific method in the social sciences in context of both theory development and testing, exploring how computation and digital data enables new answers to classic investigations, the posing of novel questions, and new ethical challenges and opportunities. Students will review fundamental research designs such as observational studies and experiments, statistical summaries, visualization of data, and how computational opportunities can enhance them. The focus of the course is on exploring the wide range of contemporary approaches to computational social science, with problem sets, programming exercises, and written assignments to gain experience with these methods.

Required Text

Grades

Grades will be based on your performance on nine assignments, each of which is worth 10 points.

Late Problem Sets

Late problem sets will be penalized 1 points for every hour they are late. For example, if an assignment is due on Monday at 11:30am, the following points will be deducted based on the time stamp of the last commit.

Example PR last commit points deducted
11:31am to 12:30pm -1 points
12:31pm to 1:30pm -2 points
1:31pm to 2:30pm -3 points
2:31pm to 3:30pm -4 points
... ...
8:31pm and beyond -10 points (no credit)

Daily Course Schedule

Date Day Topic Readings Homework
Oct. 1 M Introduction to Comp Soc Sci Slides
Oct. 3 W Git and GitHub Notes, Slides A1
CS2014
Oct. 8 M Observational data, large data S2018, Ch. 2
Oct. 10 W Observational data Slides A2
Oct. 15 M Observational data F2015, RW2000
KW2009, A2017
EKLS2015
Oct. 17 W Simulated data Slides A3
Oct. 22 M Simulated data M2002
Oct. 24 W Asking questions S2018, Ch. 3, Slides A4
Oct. 29 M Asking questions CE2015, WRGG2015
S2014, S2016
AH2012, B2014
Oct. 31 W Experiments S2018, Ch. 4, Slides A5
Nov. 5 M Experiments SNCGG2007, AR2014
CK2013, L2006
Nov. 7 W Collaboration S2018, Ch. 5, Slides A6
Nov. 12 M Collaboration W2014, BKV2010
EJQ2016
Nov. 14 W Research collaboration Slides, HJ2018 A7
Nov. 19 M Ethics S2018, Ch. 6, Slides
Nov. 21 W Ethics BF2015, Z2010 A8
Nov. 26 M CSS: Sociology KTE2018, MDSW2017, Slides
Nov. 28 W CSS: Political Science B2018, GST2018, Slides A9
Dec. 3 M CSS: Psychology SMBMYF2018, YSCBGS2014, Slides
Dec. 5 W CSS: Economics A2018, BS2017, Slides

References

Jupyter Notebooks

Jupyter notebooks are files that end with the *.ipynb suffix. These notebooks are opened in a browser environment and are an open source web application that combines instructional text with live executable and modifyable code for many different programming platforms (e.g., Python, R, Julia). Jupyter notebooks are an ideal tool for teaching programming as they provide the code for a user to execute and they also provide the context and explanation for the code. A number of Jupyter notebooks are provided in the OSM Lab boot camp repository Tutorials folder.

These notebooks used to be Python-specific, and were therefore called iPython notebooks (hence the *.ipynb suffix). But Jupyter notebooks now support many programming languages, although the name still pays homage to Python with the vestigal "py" in "Jupyter". The notebooks execute code from the kernel of the specific programming language on your local machine.

Jupyter notebooks capability will be automatically installed with your download of the Anaconda distribution of Python. If you did not download the Anaconda distribution of Python, you can download Jupyter notebooks separately by following the instructions on the Jupyter install page.

Opening a Jupyter notebook

Once Jupyter is installed--whether through Anaconda or through the Jupyter website--you can open a Jupyter notebook by the following steps.

  1. Navigate in your terminal to the folder in which the Jupyter notebook files reside. In the case of the Jupyter notebook tutorials in this repository, you would navigate to the ~/BootCamp2018/Tutorials/ directory.
  2. Type jupyter notebook at the terminal prompt.
  3. A Jupyter notebook session will open in your browser, showing the available *.ipynb files in that directory.
    • In some cases, you might receive a prompt in the terminal telling you to paste a url into your browser.
  4. Double click on the Jupyter notebook you would like to open.

It is worth noting that you can also simply navigate to the URL of the Jupyter notebook file in the GitHub repository on the web (e.g., https://github.com/OpenSourceMacro/BootCamp2018/blob/master/Tutorials/PythonReadIn.ipynb). You can read the Jupyter notebook on GitHub.com, but you cannot execute any of the cells. You can only execute the cells in the Jupyter notebook when you follow the steps above and open the file from a Jupyter notebook session in your browser.

Using an open Jupyter notebook

Once you have opened a Jupyter notebook, you will find the notebook has two main types of cells: Markdown cells and Code cells. Markdown cells have formatted Jupyter notebook markdown text, and serve primarily to present context for the coding cells. A reference for the markdown options in Jupyter notebooks is found in the Jupyter markdown documentation page.

You can edit a Markdown cell in a Jupyter notebook by double clicking on the cell and then making your changes. Make sure the cell-type box in the middle of the top menu bar is set to Markdown. To implement your changes in the Markdown cell, type Shift-Enter.

A Code cell will have a In [ ]: immediately to the left of the cell for input. The code in that cell can be executed by typing Shift-Enter. For a Code cell, the cell-type box in the middle of the top menu bar says Code.

Closing a Jupyter notebook

When you are done with a Jupyter notebook, you first save any changes that you want to remain with the notebook. Then you close the browser windows associated with that Jupyter notebook session. You should then close the local server instance that was opened to run the Jupyter notebook in your terminal window. On a Mac or Windows, this is done by going to your terminal window and typing Cmd-C or Ctrl-C and then selecting y for yes and hitting Enter.

Python tutorials

This course is not a programming course in which you receive in-class instruction on using a programming language such as Python or R. However, you will have assignments that requires some basic use of a programming language. For this reason, I am pointing you to the OSM Lab boot camp repository, which contains six basic Python tutorials in the Tutorials directory.

  1. PythonReadIn.ipynb. This Jupyter notebook provides instruction on basic Python I/O, reading data into Python, and saving data to disk.
  2. PythonNumpyPandas.ipynb. This Jupyter notebook provides instruction on working with data using NumPy as well as Python's powerful data library pandas.
  3. PythonDescribe.ipynb. This Jupyter notebook provides instruction on describing, slicing, and manipulating data in Python.
  4. PythonFuncs.ipynb. This Jupyter notebook provides instruction on working with and writing Python functions.
  5. PythonVisualize.ipynb. This Jupyter notebook provides instruction on creating visualizations in Python.
  6. PythonRootMin.ipynb. This Jupyter notebook provides instruction on implementing univariate and multivariate root finders and unconstrained and constrained minimizers using functions in the scipy.optimize sub-library.

To further one's Python programming skills, a number of other great resources exist.

In addition, a number of excellent textbooks and reference manuals are very helpful and may be available in your local library. Or you may just want to have these in your own library. Lutz (2013) is a giant 1,500-page reference manual that has an expansive collection of materials targeted at beginners. Beazley (2009) is a more concise reference but is targeted at readers with some experience using Python. Despite its focus on a particular set of tools in the Python programming language, McKinney (2018) has a great introductory section that can serve as a good starting tutorial. Further, its focus on Python's data analysis capabilities is truly one of the important features of Python. Rounding out the list is Langtangen (2010). This book's focus on scientists and engineers makes it a unique reference for optimization, wrapping C and Fortran and other scientific computing topics using Python.

Disability services

If you need any special accommodations, please provide Dr. Evans with a copy of your Accommodation Determination Letter (provided to you by the Student Disability Services office) as soon as possible so that you may discuss with me how your accommodations may be implemented in this course.