| name | capri-scenario-design |
| description | Comprehensive guide for CAPRI scenario creation, simulation design, and result interpretation. Use this skill when the user asks about designing scenarios, running simulations, baseline generation, calibration, CAPTRD projections, counterfactual analysis, comparative static analysis, policy shocks, price changes, subsidy modifications, technology shifts, welfare analysis, result interpretation, dual value decomposition, baseline reproduction runs, or any question about how to set up and evaluate a CAPRI scenario. Also trigger when the user mentions DG-AGRI Outlook, Aglink-COSIMO projections, PMP calibration, scenario GDX files, or comparing baseline vs. scenario results.
|
CAPRI Scenario Design
This skill provides a condensed working guide for designing, running, and interpreting CAPRI
scenarios. For detailed calibration parameters and pipeline references, consult
references/calibration.md in this skill directory.
1. Baseline concept
The CAPRI baseline represents the status quo projection under current legislation (e.g.
CAP 2014-2020 and subsequent reforms). It serves as the counterfactual against which all
scenario results are compared.
Key properties:
- Incorporates all policy changes already foreseen in current legislation
- Combines trend analysis, model runs, and expert consultations
- Market balance projections are globally harmonised via Aglink-COSIMO
- Regional supply projections are generated by the CAPTRD forecast tool
- The baseline is not a pure model outcome but a calibrated projection
2. CAPTRD projection pipeline
CAPTRD generates consistent projections for EU+ regions in four steps:
Step 1 -- Independent trends. Weighted nonlinear least squares on each time series
independently. The trend curve is X = a + b * t^c (Box-Cox style). Statistics on goodness
of fit feed into subsequent steps as variance weights.
Step 2 -- Consistency constraints + expert support. Imposes identities (e.g.
production = area x yield), technical bounds (non-negativity, maximum yields, growth rate
corridors), and MS-level expert information. Key files: captrd/fix_est.gms,
captrd/comibounds.gms, captrd/expert_support.gms.
Step 3 -- EU-aggregate expert supports (DG-AGRI Outlook). Integrates Aglink-COSIMO
projections at EU15/EU12 level. Step 2 results are scaled proportionally to match these
supports. A "trust level" (1-10) controls the tightness: level 5 (default for DG-AGRI)
implies a ~27.5% corridor at 99.9% probability. File: captrd/define_eu_supports.gms.
Step 4 -- Regional breakdown. MS-level results are disaggregated to NUTS2 regions
and optionally to farm types, preserving consistency with regional CAPREG data.
3. Calibration stages
Calibration proceeds in three sequential tasks after CAPTRD projections are ready.
3.1 Market model calibration
Takes Aglink projections, GLOBAL trade database, CAPREG base year data, CAPTRD trends,
and baseline policy files. Outputs calibrated behavioural parameters and producer prices.
Stages:
- Stage I: Data balancing -- align market balances with trade flows and price data
- Stage II: Elasticity trimming -- calibrate supply/demand behavioural functions;
Armington CES share parameters from observed trade flows
- Stage III: Feed and fertilizer demand calibration -- NQ profit function parameters
for processing, dairy fat/protein balancing
- Stage IV: Test run -- solve market model at trend values to verify calibration
reproduces baseline (
arm/prep_market.gms)
3.2 Supply model calibration
Uses CAPREG data, CAPTRD trends, producer prices from market calibration, and policy files.
Calibrates PMP parameters so that projected regional production is optimal at given prices.
Stages:
- Feed and fertilizer restriction calibration
- Land supply and land use change calibration (
cal_land_nests.gms, prep_cal.gms)
- Marginal cost function calibration (quadratic PMP terms)
- Calibration tests per NUTS2 region / farm type
3.3 Baseline reproduction run
After calibration, run a "no change" simulation to verify:
- Supply model reproduces calibrated activity levels at baseline prices
- Market model reproduces baseline market balances and trade flows
- All reports can be generated and inspected in the GUI
4. Scenario setup
CAPRI scenarios use comparative static analysis: compare a counterfactual simulation
against the calibrated baseline at the same projection year.
4.1 Policy file structure
Scenarios are defined in GAMS policy files under gams/pol_input/. The policy file name
is controlled by the %result_type% macro variable. A scenario file typically:
- Loads baseline data (calibrated parameters + behavioural functions)
- Loads policy declarations (
policy/policy_sets.gms)
- Modifies selected parameters vs. baseline
- Processes premium schemes via
policy/policy.gms
4.2 Types of shocks
| Shock type | How to implement |
|---|
| Price changes | Modify world market prices, admin prices (padm), or exchange rates in scenario file |
| Subsidy modifications | Change premium rates (PRMR), ceilings (ceilLev, ceilVal), or add/remove schemes |
| Trade policy | Adjust tariffs (v_tarAdVal, v_tarSpec), TRQ quotas, or FTA settings |
| Technology shifts | Modify yield coefficients, I/O coefficients, or feed conversion factors in CAPTRD supports |
| Environmental policy | Change emission factors, fertilizer restrictions, or greening requirements |
| Quota changes | Modify sugar quotas, milk quotas (historic), or biofuel mandates |
4.3 Defining a shock in GAMS
Shocks are applied by overwriting baseline parameter values in the scenario policy file:
* --- Example: remove voluntary coupled support
p_premDataE("EU27","DPVCS",MPACT,"PRMR") = 0;
* --- Example: 20% tariff cut on all cereals
v_tarAdVal.fx(CERE,RM,RM1) = v_tarAdVal.l(CERE,RM,RM1) * 0.80;
5. Iterative solution method
The supply and market modules interact iteratively:
- Market model delivers prices to supply models
- Supply models return quantities (supply + feed demand) to market model
- Constant terms in market behavioural equations are updated so that at last-iteration
prices, market model quantities match supply model quantities
- Supply model uses weighted average of prices from recent iterations for stability
- Convergence is aided by price elasticities extracted from supply models and used to
calibrate market model parameters
- Premium ceilings are checked iteratively via
policy/premcut.gms
6. Result interpretation
6.1 Welfare analysis
CAPRI computes welfare changes for multiple agents (file: reports/welfare.gms):
- Consumer welfare: Equivalent variation using the money metric concept based on the
Generalised Leontief indirect utility function
- Producer welfare (non-EU): Change in normalised quadratic profit function value
- Producer welfare (EU): Change in Gross Value Added (GVA) + premiums -- the sum
available to remunerate land, capital, and labour
- Taxpayer: Changes in tariff revenues, export subsidy costs, premium outlays
(allocated to EU/national budgets and Pillar I/II)
- Land owner: Changes in land rents from land supply functions
- Processing/dairy/feed industry: Margin-based welfare from NQ profit functions
6.2 Dual value decomposition
The file supply/margcr.gms decomposes changes in activity levels by comparing first-order
conditions between baseline and scenario. For each activity, the decomposition shows how
much of the change is attributable to:
- Change in marginal profit (prices, revenues)
- Change in land rent (dual value of land constraint)
- Change in fodder cost (dual value of feed restrictions)
- Change in young animal cost
- Change in PMP terms (behavioural calibration)
- Lower bound effects
6.3 Yield and income decomposition
File reports/yield_change_decomp breaks down aggregate yield/income changes into:
- Effect of endogenous I/O coefficients
- Effect of technology shares (high/low yield variants)
- Effect of prices
- Effect of regional composition
- Residual cross-effects
7. GDX result inspection
Use the LM tools chrispahm.gdx-viewer/gdx-sql and chrispahm.gdx-viewer/gdx-reveal to compare baseline and scenario results:
- Identify result files: Baseline results are in
results/ with the baseline
%result_type% name; scenario results use the scenario name.
- Compare key parameters with
chrispahm.gdx-viewer/gdx-sql: Query specific symbols (e.g. DATA2,
p_supplyData, market balances) across both GDX files.
- Highlight changes with
chrispahm.gdx-viewer/gdx-reveal: Show the user which parameters changed
significantly between baseline and scenario.
- Focus on: activity levels (LEVL), prices (UVAG, PMRK), trade flows, premium
payments (PRME), welfare indicators, and environmental indicators.
8. Step-by-step scenario creation workflow
When helping a user create a CAPRI scenario, follow this sequence:
- Clarify the research question. What policy change or shock is being analysed?
- Identify the baseline. Which baseline year and calibration is being used?
- Design the shock. Map the policy change to specific CAPRI parameters. Consult
references/calibration.md for parameter names and GDX locations.
- Create or modify the policy file. Write GAMS code following CAPRI coding
conventions (see
capri-gams-style skill).
- Run the baseline reproduction first to confirm calibration integrity.
- Run the scenario simulation via the GUI or batch file.
- Check convergence. Inspect iteration logs for supply-market convergence.
- Analyse results. Use welfare analysis, dual decomposition, and yield decomposition.
Compare GDX files with
chrispahm.gdx-viewer/gdx-sql and chrispahm.gdx-viewer/gdx-reveal.
- Interpret and communicate. Translate model results into a policy narrative using
the decomposition tools to explain causality.