Preparing a model
Preparing a macroeconomic model is always complicated. The AMES model was built to reduce the complexities to some extent, but they cannot be entirely eliminated.
The task of calibrating a AMES model can be made easier by calibrating with PEST, a parameter estimation tool. However, calibration cannot start until the some preliminary steps are carried out. It is a good idea to read this page in its entirety before considering PEST as an option.
Here are some proposed steps. It is best to start with an existing configuration file, for example the one from the Freedonia sample model:
- Prepare the supply-use table;
- Estimate or assume external parameters;
- Set the
report-diagnostics
value totrue
in the configuration file; - Set the
run_leap
value tofalse
in the configuration file general settings; - Set the initial value adjustments to zero;
- Set the start and end years appropriately (see below) in the configuration file general settings;
- Run the model by calling
AMES.run(CONFIG_FILE, include_energy_sectors = true)
, whereCONFIG_FILE
is the name of your configuration file; - Check the
AMES_log_XXXX_full.txt
log file[1], whereXXXX
is the name of theoutput_folder
setting in the configuration file general settings, to check that the model ran without errors; - If there were errors, troubleshoot using the
diagnostics
files; - Confirm that the reported value in the
nonenergy_energy_link_measure.txt
file in thediagnostics
folder is reasonably small (see the Tip at the end of this page for what to do if it is large); - Once the model is running without errors, calibrate by adjusting model parameters systematically in the configuration file;
- If needed, adjust initial values to fine-tune the calibration and, optionally, further adjust the model parameters.
When calibrating, the start and end years for the simulation should:
- Include all of the years for which there is data;
- Extend far enough in the future to ensure the parameter set does not create instabilities.
When calibrating, note the "sanity checks" listed in the page on output files. Note that a failed sanity check could be because of how the AMES files are set up, such as the configuration file, supply-use table, or output files. For example, the configuration file might point to the wrong rows and columns in the supply-use table. But it could also be because there is a problem with the data. For example, an incorrectly prepared supply-use table can generate strange results.
To link to LEAP:
- Set the list of excluded
energy
sectors to ones relevant to the analysis; - Ensure that the link between the AMES model and LEAP is set correctly in the configuration file;
- Set
run_leap
totrue
in the configuration file general settings; - See the guidelines for running the AMES model to place the files and scripts correctly;
- Run the AMES model from LEAP.
It is a good idea to follow the LEAP tutorial for running AMES. It explains where to place the files and how to set up multiple scenario runs.
The reported value in the nonenergy_energy_link_measure.txt
file saved in the diagnostics
folder is a measure of how important the energy sector is as a source of demand for non-energy goods and services. A key assumption of AMES is that the energy sector is not an important source of non-energy demand: see Isolating the energy sector. That is a reasonable assumption if the non-energy–energy link measure is a few percent at most. However, even if the value is large, it may be possible to apply AMES. An example is given in the documentation for the configuration file, where the energy sector coal
is included in AMES's calculations, but potential production is taken from LEAP. That way, demand by the coal sector for non-energy products are calculated by AMES, but the level of activity in the coal sector is provided by LEAP.
- 1The log file and output folder names have
_full
added at the end because the call toAMES.run()
included energy sectors: see the page on Output files.