{ "cells": [ { "cell_type": "markdown", "id": "e309e767", "metadata": {}, "source": [ "# Course Syllabus" ] }, { "cell_type": "code", "execution_count": 1, "id": "0fce9ea9", "metadata": { "tags": [ "remove_input", "remove_output" ] }, "outputs": [ { "data": { "text/plain": [ "'252 Chancellors Hall'" ] }, "metadata": { "scrapbook": { "mime_prefix": "", "name": "officeg" } }, "output_type": "display_data" }, { "data": { "text/plain": [ "'Spring 2024'" ] }, "metadata": { "scrapbook": { "mime_prefix": "", "name": "termg" } }, "output_type": "display_data" }, { "data": { "text/plain": [ "'rob.hicks@wm.edu'" ] }, "metadata": { "scrapbook": { "mime_prefix": "", "name": "emailg" } }, "output_type": "display_data" }, { "data": { "text/plain": [ "'MW 5:00-6:20 pm'" ] }, "metadata": { "scrapbook": { "mime_prefix": "", "name": "classtimeg" } }, "output_type": "display_data" }, { "data": { "text/plain": [ "'Tuesday 3:30 - 4:30pm'" ] }, "metadata": { "scrapbook": { "mime_prefix": "", "name": "officehoursg" } }, "output_type": "display_data" }, { "data": { "text/plain": [ "'219 Chancellors Hall'" ] }, "metadata": { "scrapbook": { "mime_prefix": "", "name": "classroomg" } }, "output_type": "display_data" }, { "data": { "text/plain": [ "'March 8'" ] }, "metadata": { "scrapbook": { "mime_prefix": "", "name": "midtermg" } }, "output_type": "display_data" } ], "source": [ "# set variables for this semester\n", "office = '252 Chancellors Hall'\t\t\n", "term = 'Spring 2024'\t\t\t\t\t\t\n", "email = 'rob.hicks@wm.edu'\t\t\t\n", "classtime = 'MW 5:00-6:20 pm'\t\n", "officehours = 'Tuesday 3:30 - 4:30pm'\n", "classroom = '219 Chancellors Hall'\n", "midterm = 'March 8' #'TBD' #'Feb 23' \n", "\n", "# set dates for this semester\n", "dates =\t [['First day of class',\t 'January 24 '], \n", "\t\t ['Spring Break',\t\t\t 'March 9-17'], \n", "\t\t ['Mid-Term Due',\t\t\t midterm], \n", " ['Last day of this class', 'May 1'], \n", "\t\t ['Final Project Due',\t 'May 7 (Midnight)']] \n", "\n", "from myst_nb import glue\n", "# put all data for this semester here\n", "glue(\"officeg\", office)\n", "glue(\"termg\", term)\n", "glue(\"emailg\", email)\n", "glue(\"classtimeg\", classtime)\n", "glue(\"officehoursg\", officehours)\n", "glue(\"classroomg\", classroom)\n", "glue(\"midtermg\", midterm)\n", "\n", "import pandas as pd\n", "df = pd.DataFrame(dates, columns=['Item', 'Date'])" ] }, { "cell_type": "markdown", "id": "25d022f5", "metadata": {}, "source": [ "- **Instructor**: Rob Hicks\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n", "- **Office**: {glue:text}`officeg`\n", "- **Term**: {glue:text}`termg`\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n", "- **E-mail**: {glue:text}`emailg` \n", "- **Class Time**: {glue:text}`classtimeg` \n", "- **Class Room**: {glue:text}`classroomg`\n", "\n", "## Course Summary\n", "\n", "This course examines the use of Bayesian estimation methods for a wide\n", "variety of settings in applied economics. After a brief primer on\n", "Bayesian statistics, we will examine the use of the\n", "Metropolis-Hastings algorithm for parameter estimation via Markov\n", "Chain Monte Carlo methods. The student will write their own\n", "Metropolis-Hastings estimation algorithm for an ordinary least squares\n", "model. Building on this foundation, we will explore heirarchical and\n", "other models, and how they are implemented in Python PyMC.\n", "\n", "## Prerequisites\n", "\n", "ECON 308 (Econometrics) is required for this course. It is also\n", "*highly recommended* that you have had ECON 408 (Cross Section) or are\n", "willing to learn independently maximum likelihood estimation. It is\n", "also advantageous to have some programming skills and a working\n", "knowledge of linear algebra. This class is a very serious undertaking\n", "and if you aren't willing to go the extra mile and get up to speed, it\n", "will make for a long semester.\n", "\n", "## Software Resources\n", "\n", "There are various ways you can perform the modeling excercises for this\n", "course- all using `python` and the `pymc` package. These include\n", "\n", "- [`https://jupyterhub.wm.edu`](https://jupyterhub.wm.edu) and choosing the `SciPy with PyMC` image\n", "- `https://colab.google.com` and installing software to enable `pymc`\n", "- Running `anaconda python` on your own pc and installing software to enable `pymc`\n", "\n", "These are all acceptable to me provided your jupyter notebook executes on\n", "my computing environment (identical to `https://jupyterhub.wm.edu`).\n", "\n", "```{tip}\n", "Students are advised to use [`https://jupyterhub.wm.edu`](https://jupyterhub.wm.edu) with the `SciPy with PyMC` image.\n", "```\n", "\n", "Use of other software packages for Bayesian analysis (e.g. Stata,\n", "BUGS, Stan, etc.) is neither recommended or accepted without prior\n", "permission.\n", "\n", "## Important Dates\n", "\n", "
" ] }, { "cell_type": "code", "execution_count": 2, "id": "917231df", "metadata": { "tags": [ "remove_input" ] }, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
ItemDate
First day of classJanuary 24
Spring BreakMarch 9-17
Mid-Term DueMarch 8
Last day of this classMay 1
Final Project DueMay 7 (Midnight)
" ], "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from IPython.display import HTML\n", "def make_lalign_formatter(df, cols):\n", " return {col: '{{:<{}s}}'.format(df[col].str.len().max()).format for col in cols}\n", "\n", "HTML(df.to_html(index=False, justify='left'))" ] }, { "cell_type": "markdown", "id": "e75883f4", "metadata": {}, "source": [ "
\n", "\n", "## Review Materials \n", " 1. [Intro to python numpy and linear algebra](https://econ.pages.code.wm.edu/414/notes/docs/numpy.html)\n", " 2. [Maximum Likelihood notes from Cross Section Econometrics](https://econ.pages.code.wm.edu/407/notes/docs/mle_intro.html#) \n", " 3. [Introduction to python pandas](https://econ.pages.code.wm.edu/414/notes/docs/pandas.html)\n", " 4. [Some statistical functions in python](https://econ.pages.code.wm.edu/414/notes/docs/scipy_statfuns.html)\n", "\n", "## Logistics\n", "- *Office Hours* : I am available on {glue:text}`officehoursg`, or\n", " by appointment.\n", "- *Email Policy* : I will respond to emails but only if they contain\n", " the tag `[BAYESIAN]` in the subject line. If they do not, the\n", " google will likely delete your email. Emails must contain concise\n", " questions no longer than what would be amenable to respond to\n", " email. If you have a coding problem, use gitlab (see next point).\n", "- *Asking Questions*: Substantive questions about course material\n", " (but not specifics about assignments) or coding in python must be\n", " submitted to the Bayesian Econometrics issue tracker at\n", " [https://code.wm.edu/econ/414/issue-tracker/-/issues](https://code.wm.edu/econ/414/issue-tracker/-/issues).\n", " Part of Problem Set 1 requires you to file an issue at this site.\n", "- *Grades*: Your grade will be based on a few short (shorter than\n", " cross-section problem sets) weekly (or bi-weekly) assignments\n", " during the first half of the course (20% of course total grade), a\n", " take home mid-term (25%), an oral presentation for your final\n", " project (15%), and a final project (40%).\n", " - The *homework assignments* will consist of hands-on problem\n", " solving assignments. In each, you will be given a dataset and\n", " will need to conduct an econometric analysis thinking critically\n", " about which technique to employ as well as key tests that should\n", " be run. The write-up *must* use the Jupyter Notebook that you\n", " will be submitting via blackboard. A good problem set will\n", " include clear interpretations of your results, tables with clear\n", " variable names, and be well-formatted with code, tables, and\n", " writeup combined in a convenient (for me) way. You will have at\n", " least 1 week to complete the assignment once you receive it from\n", " me. If I can't execute (run) the worksheet, the assignment is\n", " not completed. The assignments can be worked on in groups of two\n", " (although this isn't mandatory). If you choose to work in a\n", " group, turn in separate Jupyter notebooks and at the top include\n", " your teammates name and the grade you would assign for their\n", " contribution to the group work.\n", " - The *mid-term* is due on {glue:text}`midtermg`. Unfortunately, I\n", " can't reschedule either the mid-term or the final the exam, so\n", " if this time doesn't work for you please drop the course. If you\n", " you are forced to miss the mid-term for medical reasons, the 25%\n", " weight will be proportionally allocated to all other future\n", " assignments. Under no circumstances will a make-up mid-term be\n", " granted, except as specified in the illness policies outlined\n", " below.\n", " - Oral presentations for your *final project* will occur during\n", " the final two weeks of class. This will summarize your idea,\n", " data sources, and any results you may have.\n", " - The *final project* will be your application of a Bayesian\n", " Econometric Technique to a problem of your choosing. You should\n", " plan on meeting with me *no later than Spring Break* to refine\n", " your project idea. The project, to be turned in as an ipython\n", " notebook on blackboard, is due at the time of the final exam.\n", " \n", "- *Illness*:\n", " - This class will abide by campus-wide mask/distancing policy if applicable\n", " - If you are diagnosed with, come in close contact with, or are having\n", " symptoms consistent with the flu/Covid please follow all university policies\n", " for these cases. You are not required to document your illness for\n", " missing classes nor will I be taking attendance. More details about absences:\n", " - __Missing Classes__: If you miss class due to Covid note that\n", " each day we will be covering topics very closely aligned with\n", " the distributed presentation, written lecture notes, and/or\n", " jupyter notebook. It is your responsibility to contact me\n", " within one week of missing class if you have questions about\n", " what content you may have missed.\n", " - __Missing Problem Set Deadlines__: In addition to the policies about\n", " missing assignments outlined below, note that the problem sets in this class\n", " involve take home work that can be submitted digitally. In the\n", " hopefully highly unlikely event that your **flu/Covid-related** illness\n", " prohibits you from meeting these deadlines please contact me ASAP.\n", "\n", "- *Policy on Late Assignments* : University policy will not allow me\n", " to reschedule the due date for the final exam (see the Dean of\n", " Students for exceptions). Course assignments must be turned in on\n", " time. Late work will be accepted for up to two additional days\n", " (with Saturday and Sunday counting as 1 day in total) with a letter\n", " grade deduction for each late day. After two days, late assignments\n", " will not be accepted. See below for some examples:\n", "\n", "| Due Date | Turned in | Your Grade | Your Grade after Penalty |\n", "|------------|----------------------|--------------|----------------------------|\n", "| Tuesday | Thursday | A | C |\n", "| Thursday | Saturday or Sunday | A | C |\n", "| Tuesday | Friday | A | F (not accepted) |\n", "| Thursday | Monday | A | F (not accepted) |\n", " Exceptions to this policy based on COVID-related illness will proceed as outlined above.\n", "- *Hardcopy Policy* : No hardcopies are accepted under any\n", " circumstances.\n", "- *Grade Discrepancies and Grade Questions* : I am happy to discuss\n", " questions you have about your grade on class assignments. Any\n", " questions you have regarding a potential grade change on an\n", " assignment must be cleared up within 1 week of receiving your work\n", " back from me. The only exception to this policy is if I made a data\n", " entry or error in adding your score up.\n", " \n", "- *Course Materials* All course materials are available on my website for this course at the links listed below. I will *only* be using blackboard for posting grades and for you to submit assignments.\n", "\n", "| Item | Location |\n", "|----------|----------------------------------------------------------------------------------------------------------------------------|\n", "| Syllabus | [https://econ.pages.code.wm.edu/414/syllabus/docs/index.html](https://econ.pages.code.wm.edu/414/syllabus/docs/index.html) |\n", "| Notes | [https://econ.pages.code.wm.edu/414/notes/docs/index.html](https://econ.pages.code.wm.edu/414/notes/docs/index.html) |\n", "\n", "- *Book* : The highly recommended book (although not required) for\n", " the class is\n", " [Bayesian Data Analysis, 3rd edition by Gelman et al.](https://www.amazon.com/Bayesian-Analysis-Chapman-Statistical-Science/dp/1439840954/ref=sr_1_1?ie=UTF8&qid=1448383027&sr=8-1&keywords=bayesian+data+analysis)\n", "\n", "- *A note on COLL400 requirements*: In various assigments in this\n", " class you will be required to communicate statistical concepts to\n", " various audiences. As this is a core College-wide requirement under\n", " the Curriculum, your work communicating these concepts will be\n", " evaluated as an important part of your score for assignments.\n", "\n", "- *A note on coding* : Some of you don't have alot of coding\n", " experience outside of stata. You will find the early parts of this\n", " class frustrating as you struggle to translate your logic into\n", " workable code. The curious student who is willing to experiment\n", " (and creatively search google) will keep frustration levels to a\n", " minimum. To facilitate the learning process, you can\n", "\n", " - Work in groups of two for the homework assignments.\n", " - Ask anyone to help solve specific coding syntax errors.\n", " - My office hours on Tuesday afternoons can be used for tackling\n", " these types of problems.\n", " - The google is a great resource for syntax problems. In\n", " particular, I find the following web resources very useful:\n", " - [`stackoverflow.com`](https://www.stackoverflow.com)\n", " - [`ChatGPT`](https://chat.openai.com/)\n", "\n", "## Class Schedule\n", "\n", "| Topic | Approx. Duration | Summary |\n", "|------------------|------------------|------------------------------------|\n", "| Introduction | 6 weeks | Brief Introduction to Python |\n", "| | | Bayesian Statistics |\n", "| | | Markov Chains and Sampling Methods |\n", "| | | Application: OLS |\n", "| Heterogeneity | 2 weeks | Heirarchical Models |\n", "| Switching Models | 2 weeks | Endogenous Breakpoints |\n", "| Missing Data | 1 week | Bayesian Imputation |\n", "| Classifification | 1 week | Discrete Choice Models |\n", "| Other Models | As Time Allows | Time Series Models |\n", "| | | Spatial Econometric Models |\n", "| | | Multinomial Probit |" ] } ], "metadata": { "jupytext": { "text_representation": { "extension": ".md", "format_name": "myst", "format_version": 0.13, "jupytext_version": "1.10.3" } }, "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.17" }, "source_map": [ 12, 16, 47, 101, 109 ] }, "nbformat": 4, "nbformat_minor": 5 }