From 0d518b0fc3b508c17c2582843933ef15cf1bfec5 Mon Sep 17 00:00:00 2001 From: AntoMarcinkovic Date: Mon, 29 Mar 2021 00:14:14 +0200 Subject: [PATCH] Adding correct documentation. --- src/documentation/analysis.rst | 8 ++++---- src/documentation/index.rst | 2 ++ src/documentation/introduction.rst | 29 +++++++++-------------------- src/documentation/model_code.rst | 10 +++++----- src/documentation/model_specs.rst | 6 ++++-- src/documentation/original_data.rst | 9 ++++----- 6 files changed, 28 insertions(+), 36 deletions(-) diff --git a/src/documentation/analysis.rst b/src/documentation/analysis.rst index 3e610b2..685bbba 100644 --- a/src/documentation/analysis.rst +++ b/src/documentation/analysis.rst @@ -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: diff --git a/src/documentation/index.rst b/src/documentation/index.rst index a7b01a2..c967934 100644 --- a/src/documentation/index.rst +++ b/src/documentation/index.rst @@ -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 diff --git a/src/documentation/introduction.rst b/src/documentation/introduction.rst index 85cb323..039097b 100644 --- a/src/documentation/introduction.rst +++ b/src/documentation/introduction.rst @@ -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 `_ and **everything worked.** +**To be able to run our project, please follow the steps in the README file of our Github repository `** -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. diff --git a/src/documentation/model_code.rst b/src/documentation/model_code.rst index 74659d9..d1bab47 100644 --- a/src/documentation/model_code.rst +++ b/src/documentation/model_code.rst @@ -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: diff --git a/src/documentation/model_specs.rst b/src/documentation/model_specs.rst index 88aeabf..707861a 100644 --- a/src/documentation/model_specs.rst +++ b/src/documentation/model_specs.rst @@ -4,7 +4,9 @@ Model specifications ******************** -The directory *src.model_specs* contains `JSON `_ 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 `_, but that will read a JSON file into the data set rather than into macros, which is what we need here. diff --git a/src/documentation/original_data.rst b/src/documentation/original_data.rst index 836a098..adc68d6 100644 --- a/src/documentation/original_data.rst +++ b/src/documentation/original_data.rst @@ -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