SWAP Model

This website provides and overview and resources on the Statewide Agricultural Production Model (SWAP).

The Statewide Agricultural Production (SWAP) model is a multi-region, multi-input and output economic optimization model of the agricultural economy in California. The current model version covers over 93 percent of irrigated production in the state with primary regions in the Central Valley, Southern California, and the Central Coast. The model is currently used for policy analysis and planning by consultants and state and federal agencies. Some of the key features of the SWAP model include:

  • Self-calibrates using Positive Mathematical Programming (PMP)
  • Constant Elasticity of Substitution (CES) regional production functions
  • Exponential PMP cost functions
  • Groundwater pumping cost module including change in depth and electricity costs
  • Regional input constraints
  • Water broken out into 6 sources
  • Endogenous crop prices
  • Technological change and exogenous demand shift modules
  • 31 agricultural production regions based on homogenous hydrologic and agronomic conditions
  • Linkage to hydrologic, agronomic, and engineering models

The SWAP model is a fully calibrated optimization model which is well-suited to estimate spatially heterogenous commodity, resource, and input specific policies. Projects span a wide range of applications over many years. Some recent examples include: 

  • Costs of Central Valley salinity
  • Effects of Delta export restrictions
  • Nitrate externalities in the Salinas Valley
  • New CVP surface water storage feasibility analysis
  • South-of-Delta water markets
  • Yolo Bypass flood date and flow volume agricultural impact analysis
  • Climate change effects on California agriculture

A Brief Overview of the SWAP Model

This is an introduction to the SWAP Model, the full documentation of the model has been published in The Journal of Environmental Modeling and Software.

The SWAP model is a regional economic model of irrigated agricultural production that simulates the decisions of agricultural producers (farmers) in California. Its data coverage is most detailed in the Central Valley, but it also includes production regions in the Central Coast, South Coast, and desert areas. The model assumes that farmers maximize profit subject to resource, technical, and market constraints. Farmers sell and buy in competitive markets, and no one farmer can affect or control the price of any commodity. The model selects those crops, water supplies, and other inputs that maximize profit subject to constraints on water and land, and subject to economic conditions regarding prices, yields, and costs.

SWAP incorporates project water supplies (SWP and CVP), other local water supplies, and groundwater. As conditions change within a SWAP region (e.g., the quantity of available project water supply increases or the cost of groundwater pumping increases), the model optimizes production by adjusting the crop mix, water sources and quantities used, and other inputs. It also fallows land when that appears to be the most cost-effective response to resource conditions.

When compared to previous PMP based models of irrigated agriculture, SWAP offers three key improvements. First, SWAP includes regional exponential PMP land cost functions, which corrects the inability of previous models, with a quadratic PMP cost function, to handle large policy shocks. Second, SWAP includes regional Constant Elasticity of Substitution (CES) crop production functions which allow for limited substitution between inputs. Leontief production functions were common in many previous models. Finally, regional crop prices are endogenously determined based on a statewide demand function.

Model calibration uses Positive Mathematical Programming (PMP) which has been used in models since the 1980s and was formalized by Howitt (1995). PMP allows the modeler to infer the marginal decisions of farmers while only being able to observe limited average production data through a non-linear cost or revenue function introduced to the model. PMP is fundamentally a three-step procedure for model calibration that assumes farmers optimize input use for maximization of profits. The first step solves a linear profit-maximization program. In addition to basic resource availability and non-negativity constraints, the LP includes a set of calibration constraints to restrict land use to observed values. In the second step, the dual (shadow) values from the calibration and resource constraints are used to derive the parameters for an exponential "PMP" cost function and CES production function. The third step combines the calibrated CES and PMP cost function into a full profit maximization program. The exponential PMP cost function captures the marginal decisions of farmers through the increasing cost of bringing additional land into production (e.g. through decreasing quality). Other input costs, (supplies, land, and labor) enter linearly into the objective function in both the first and third step.

As shown in the image below, the SWAP model has 27 base regions in the Central Valley in addition to agriculture in the Central Coast, South Coast, South Lahontan, and Colorado River regions. There are a total of 37 regions in the current model.


Sequential Calibration and Validation in SWAP

The SWAP model includes a sequential calibration routine and series of validation checks. The calibration phase of the SWAP model uses a sequential six-step process. The six steps are: 

  1. Assemble input, output and elasticity data
  2. Solve a linear program subject to fixed resource and calibration constraints
  3. Derive the CES production function parameters using input opportunity costs from step two
  4. Estimate the crop and region-specific PMP cost functions using a least squares method
  5. Calibrate the aggregate demand functions and regional adjustment costs using prior demand elasticity estimates, and
  6. Optimize and simulate the calibrated SWAP model which includes tests for adequate calibration in terms of input and output prices and quantities.