Skip to content

Commit

Permalink
Adding correct documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoMarcinkovic committed Mar 28, 2021
1 parent adb7476 commit 0d518b0
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 36 deletions.
8 changes: 4 additions & 4 deletions src/documentation/analysis.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.. _analysis:

************************************
Main model estimations / simulations
Main model estimations
************************************

Documentation of the code in *src.analysis*. This is the core of the project.
Here we estimate our regressions with the different specifications we have specified in *src/model_specs*.


Schelling example
Regression analysis
=================

.. automodule:: src.analysis.task_schelling
.. automodule:: src.analysis.task_regression_analysis
:members:
2 changes: 2 additions & 0 deletions src/documentation/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Welcome to the covid-19 Mobility project's documentation!
introduction
original_data
data_management
model_code
model_specs
analysis
final
paper
Expand Down
29 changes: 9 additions & 20 deletions src/documentation/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,22 @@
Introduction
************

You can find the documentation on the rationale, pytask, and more background at https://econ-project-templates.readthedocs.io/en/stable/.

The Python version of the template uses a modified version of Stachurski's and Sargent's code accompanying their Online Course :cite:`StachurskiSargent13` for Schelling's (1969, :cite:`Schelling69`) segregation model as the running example.
Welcome to our project! We (Bahar, Timo and Anto) have built this project to analyze mobility on different levels:

1. We compare German mobility with other european countries' mobility.
2. We compare German mobility on state level and on pre-specified divisions of Germany such as "City-States vs Non-City-States" and "Former BRD vs DDR".
3. We analyze whether there is "Lockdown fatigue" in Germany by setting up several regressions with different specifications.

.. _getting_started:

Getting started
===============

**This assumes you have completed the steps in the `Getting Started section of the documentation <https://econ-project-templates.readthedocs.io/en/stable/getting_started.html>`_ and **everything worked.**
**To be able to run our project, please follow the steps in the README file of our Github repository <https://github.com/baharcos/covid_19_mobility>`**

The logic of the project template works by step of the analysis:
To give you a rough idea of how our project is built, here is a short overview:

1. Data management
2. The actual estimations / simulations / ?
3. Visualisation and results formatting (e.g. exporting of LaTeX tables)
4. Research paper and presentations.

It can be useful to have code and model parameters available to more than one of these steps, in that case see sections :ref:`model_specifications`, :ref:`model_code`, and :ref:`library`.

First of all, think about whether this structure fits your needs -- if it does not, you need to adjust (delete/add/rename) directories and files in the following locations:

* Directories in **src/**;
* The documentation source files in **src/documentation/** (Note: These should follow the directories in **src** exactly);
* The list of included documentation source files in **src/documentation/index.rst**

Later adjustments should be painlessly possible, so things won't be set in stone.

Once you have done that, move your source data to **src/original_data/** and start filling up the actual steps of the project workflow (data management, analysis, final steps, paper). All you should need to worry about is to specify the tasks for `pytask`.
2. Visualization and results formatting (e.g. exporting of LaTeX tables)
3. Estimations
4. Presentation.
10 changes: 5 additions & 5 deletions src/documentation/model_code.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
Model code
**********

The directory *src.model_code* contains source files that might differ by model and which are potentially used at various steps of the analysis.
We run several regressions to find out which model represents the data best. The file in this directory produces the different specifications.
They can be found in the directory *src/model_specs*.

For example, you may have a class that is used both in the :ref:`analysis` and the :ref:`final` steps. Additionally, maybe you have different utility functions in the baseline version and for your robustness check. You can just inherit from the baseline class and override the utility function then.

The ``Agent`` class of the Schelling example
============================================
Regression specifications
=========================

.. automodule:: src.model_code.agent
.. automodule:: src.model_code.task_regression_specifications
:members:

6 changes: 4 additions & 2 deletions src/documentation/model_specs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
Model specifications
********************

The directory *src.model_specs* contains `JSON <http://www.json.org/>`_ files with model specifications. The choice of JSON is motivated by the attempt to be language-agnostic: JSON is quite expressive and there are parsers for nearly all languages. [#]_
We create the following three pickle files containing specification details:

1. regression_models.pkl:
2. regression_variable_names.pkl:
3. time_lockdowns:

.. [#] Stata is the only execption I know of. You find a converter in the pytask file of the Stata branch. Note that there is `insheetjson <http://ideas.repec.org/c/boc/bocode/s457407.html>`_, but that will read a JSON file into the data set rather than into macros, which is what we need here.
9 changes: 4 additions & 5 deletions src/documentation/original_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
Original data
*************

In this folder, there are four different datasets:
To be able to conduct our analysis, we need the following three different datasets:

1. apple_data: This dataset contains mobility information generated by Apple users
2. google_data: This dataset contains mobility information generated by Google users
3. owid_data: This dataset contains information on COVID-19 numbers (such as infection numbers on country level)
4. stringency_index_data: This dataset contains the stringency index for different countries
1. google_data: This dataset contains mobility information generated by Google users
2. owid_data: This dataset contains information on COVID-19 numbers (such as infection numbers on country level)
3. stringency_index_data: This dataset contains the stringency index for different countries

0 comments on commit 0d518b0

Please sign in to comment.