View on GitHub

Short version of the CAPRI market module

An extremely simplified version of the CAPRI market module

Download this project as a .zip file Download this project as a tar.gz file

About

The shortcapri project is about developing a simple, demonstrative example for the CAPRI market model.

I aimed at creating the simplest structure possible, making as many simplifications as I could. The "bare" market model features only one commodity, three regions, no processing and no feeds, etc. But the core structure of the CAPRI market model is well represented:

Extra features

Unlike real CAPRI, this model is formulated as an Mixed Complementarity Problem (MCP). I believe this formulation highlights the economic intuition behind the market model: the equation system represents first order (KKT) conditions of behavioural optimization problems. But have no fear, an equivalent NLP formulation is also included in the code. Remember, we solve a (squared) system of equations using the complementarity conditions. The MCP formulation shows explicitely the equation-variable pairs.

The code contains lengthy routines for checking the calibration. This might look unnecessary at the first glance but I think it's useful to emphasize which parameters are calibrated and how. And best modelling practice is to always check if the calibration worked out well...

Installation

Just download the files by clicking on the zip folder above. You can also browse the code online by clicking on the blue 'Wiew on Github' button above. The main file is market_mcp.gms; that's the one you want to run.

[Those of you who are familiar with git can clone or fork the repository].

Run market_bare_onec.gms with GAMS for the most simple version.

The content of the package

The main files are in the main folder. The different sub-modules (e.g. data preparation, calibration) are sitting in the folder "include". In the folder "R" you can find some R routines for reporting purposes.

The main files:

Why?

For training purposes, obviously. But even in 'real life' I used to analyse hypothetical scenarios with this and similar small models. It can be useful to get an idea what you can expect from CAPRI after implementing a real scenario there. I publish it in the hope that others might find it useful too.

Miscellaneous

The repository contains some additional (extended) model versions which have been used for a research project on the interlinkages between TRQ representations and simulated trade diversion effects in applied equilibrium models. You can safely ignore these model versions. For more information have a look at the conference paper from the 135th EAAE Seminar:

Himics, Britz: "Trade diversion effects of Preferential Trade Agreements under Tariff Rate Quota regimes"