Uses git repository template for APERC models. This repository holds many of the input assumptions/data that will be used for the forthcoming 9th APEC Energy Demand and Supply Outlook.
One of the main components of this repository is GDP projections for APEC economies.
The starting point is IMF GDP projections for APEC economies out to 2027. This is then built on out to 2100.
The model used is a Solow Swan constant elasticity of substitution Cobb Douglas production model, with labour and capital inputs, and derived efficiency of labour.
Inputs to the model include:
- Population estimates to 2100 (provided by UN DESA)
- Capital stock (Penn World Tables)
- Depreciation (Penn World Tables)
- National savings rate (IMF)
- Labour efficiency (derived for historical years or for where data is available, such as to 2027, from IMF projections)
Capital stock, depreciation, national savings, and labour efficiency are assumed to change through the projection period, based on qualitative assessment.
- a1_UN_DESA_population_data.py: Grabs UN DESA population data, visualises population trajectories out to 2100, and saves data in required format for use later.
- a2_IMF_data_grab.py: Grabs relevant IMF data as input for the model.
- a3_PWT_data_grab.py: Grabs Penn World Tables data and visualises relevant data.
- a4_combined_mini_projection.py: Uses Swan Solow model to derive labour efficiency for historical/available data. Packages all relevant data: Available GDP (to 2027 from IMF), capital (k stock from PWT), labour (UN DESA choice to 2100), labour efficiency.
- b1_GDP_model_APERC.py
Builds a function that allows choice of how labour efficiency, savings, and depreciation evolves through time (these values are not static and have large implications for long-term GDP projections). The function then generates GDP estimates and plots these estimates alongside older GDP projections (from the 8th Outlook, published in 2022).
- b2_generate_GDP_results.py
Executes function built in the previous script for all 21 economies, with ability to make choices about how the inputs change through time, and visualises the results.
- b3_GDP_population_sensitivity.py
Executes the functions with the same selections in 2b, but with a population sensitivity of Low, Medium and High (UN DESA has more than 10 different population scenarios, but High, Medium, and Low are chosen as representative of most of the range).
- z_GDP_model_Pugh.py: A different approach from David Pugh for reference
Project organization is based on ideas from Good Enough Practices for Scientific Computing and the SnakeMake recommended workflow.
- Put each project in its own directory, which is named after the project.
- Put data in the
data
directory. This can be input data or data files created by scripts and notebooks in this project. - Put configuration files in the
config
directory. - Put text documents associated with the project in the
docs
directory. - Put all scripts in the
workflow/scripts
directory. - Install the Conda environment into the
workflow/envs
directory. - Put all notebooks in the
workflow/notebooks
directory. - Put final results in the
results
directory. - Name all files to reflect their content or function.
Note: input data for the models is not pushed to git. They are available from public sources (or from internal directories (Teams)) that you will need to save in the relevant location in the data folder on your cloned repository.
After adding any necessary dependencies to the Conda environment.yml
file you can create the
environment in a sub-directory of your project directory by running the following command.
$ conda env create --prefix ./env --file ./workflow/envs/environment.yml
Once the new environment has been created you can activate the environment with the following command.
$ conda activate ./env
Note that the env
directory is not under version control as it can always be re-created from
the environment.yml
file as necessary.
You can also use the macro_variables_env environment that finn has created for his use.
Change the environment folder and environment.yml file in the steps above from:
./env and ./workflow/envs/environment.yml
to:
./macro_variables_env and ./workflow/envs/macro_variables_env.yml
If you add (remove) dependencies to (from) the environment.yml
file after the environment has
already been created, then you can update the environment with the following command.
$ conda env update --prefix ./env --file ./workflow/envs/environment.yml --prune
The list of explicit dependencies for the project are listed in the environment.yml
file. To see the full list of packages installed into the environment run the following command.
conda list --prefix ./env