Assignment for Applied Econometrics
Find a file
2024-12-30 22:05:03 +01:00
data simulation code done 2024-12-30 19:59:18 +01:00
figures question 2.3 2024-12-30 22:05:03 +01:00
report question 2.3 2024-12-30 22:05:03 +01:00
scripts question 2.3 2024-12-30 22:05:03 +01:00
.gitignore added parskip to format paragraphs, better plot formatting. 2024-12-29 19:56:53 +01:00
LICENSE Initial commit 2024-12-29 14:40:51 +01:00
poetry.lock initial commit 2024-12-29 18:42:48 +01:00
pyproject.toml initial commit 2024-12-29 18:42:48 +01:00
README.md clarify anaconda and poetry 2024-12-30 00:43:42 +01:00

applied-econometrics-2024

Assignment for Applied Econometrics

Installation

This project requires reasonable recent versions of

  • numpy
  • pandas
  • matplotlib
  • spyder

OS specific notes

Instructions are added for Mac and Ubuntu based linux. For windows use the Ubuntu based WSL2.

Windows

To enable WSL2 and install Ubuntu see Microsoft Learn Article for WSL2.

In summary running the following as Administrator in a shell should enable WSL2 and install Ubuntu:

``` shell
$ wsl --install
```

Ubuntu

Anaconda

This is probably the best solution for Windows based environments, however be careful that there are no conflicts with other installed python environments, notably the one automagically installed from the Microsoft Store.

Poetry (Optional)

Poetry enables sane package management for python projects. It creates and manages virtual python environments with just the required packages and their dependencies installed isolated from the system installed libraries, which is a boot for reproducible research and continuous integration.

Install Poetry

Modern python installations often come with pipx or allow it to be easily installed, e.g. brew install pipx on Mac or sudo apt install pipx on Ubuntu based Linux distros.

``` shell
$ pipx install poetry
```

Usage

Once installed you can start a shell in the correct python environment with all needed dependencies using :

```
$ poetry shell
```

On initial invocation it will create the environment from the lock file in the git repo.

The main configuration file is pyproject.toml, which is shared with a lot of other tools in thet python ecosystem. This allows the dependencies to be specified:

``` yaml
[tool.poetry]
name = "applied-econometrics-2024"
version = "0.1.0"
description = "Assignment for Applied Econometrics"
authors = ["Henrik Tillemans <hendrik@snamellit.com>"]
readme = "README.md"
package-mode = false

[tool.poetry.dependencies]
python = "^3.12"
pandas = "^2.2.3"
numpy = "^2.2.0"
matplotlib = "^3.10.0"
spyder = "^5.4.3"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
```

Usually poetry does things as expected. If there are significant changes to the dependencies it might be necessary to update the virtual environment by "locking" the actual versions used by creating a poetry.lock file with the exact versions used:

``` shell
$ poetry lock
```

This will resolve the configured dependencies and all transitive dependencies in a coherent configuration and write all details to allow the exact same setup to be reproduced on another machine or at another time.

Updating the virtual environment is then done with

``` shell
$ poetry install
```

LaTeX

Installation

on Ubuntu derived Linux:

``` shell
$ sudo apt install texlive-full
```

on Mac

``` shell
$ brew install --cask mactex
```