Skip to content

PSLmodels/OG-UK

Repository files navigation

Python 3.11+ CI Docs

OG-UK

OG-UK is an overlapping-generations model of the UK economy that allows for dynamic general equilibrium analysis of fiscal policy. It builds on OG-Core, using a calibration specific to the UK sourced from ONS, OBR, Bank of England, and GOV.UK data. The model outputs changes in macroeconomic aggregates (GDP, investment, consumption), wages, interest rates, and tax revenues over time.

Regularly updated documentation is available at https://pslmodels.github.io/OG-UK.

Quickstart (uv — recommended)

uv is a fast Python package manager. If you already have Python 3.11+ and uv installed:

git clone https://github.com/PSLmodels/OG-UK.git
cd OG-UK
uv sync
uv run python examples/run_oguk.py

This solves the baseline and reform (1pp basic rate rise) steady states and prints real-world £bn impacts.

Full setup from scratch

If you are starting without Python installed:

  1. Install Python 3.11+ from https://www.python.org/downloads/ (tick "Add Python to PATH" on Windows).

  2. Install uv (Python package manager):

    • macOS / Linux: curl -LsSf https://astral.sh/uv/install.sh | sh
    • Windows: powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
  3. Clone and install OG-UK:

    git clone https://github.com/PSLmodels/OG-UK.git
    cd OG-UK
    uv sync
  4. Set the HuggingFace token (required to download PolicyEngine-UK microdata):

    export HUGGING_FACE_TOKEN=hf_your_token_here   # macOS/Linux
    set HUGGING_FACE_TOKEN=hf_your_token_here       # Windows

    Obtain a token with read access to policyengine/policyengine-uk-data from https://huggingface.co/settings/tokens.

  5. Run the example:

    uv run python examples/run_oguk.py

Alternative: conda + pip install

If you prefer Anaconda:

conda env create -f environment.yml
conda activate oguk-dev
pip install -e .
python examples/run_oguk.py

Development

uv sync --dev
uv run ruff check .
uv run ruff format --check .
uv run pytest -x -m "not full_run" --tb=short

CI secrets

The test suite downloads private microdata from HuggingFace. To run tests (locally or in CI), set the HUGGING_FACE_TOKEN environment variable to a token with read access to the policyengine/policyengine-uk-data repo. In GitHub Actions this must be added as a repository secret.

Citing OG-UK

Please do not cite — the model is under active development.

Sponsor this project

Packages

 
 
 

Contributors