Skip to main content

Crop Portfolio Selection

ROBUST PORTFOLIO OPTIMIZATION

Agriculture · Production · Strategic

Crop diversification reduces income volatility by 20–40% compared to monoculture, yet most farmers allocate acreage based on intuition rather than data. Each pre-season, the farmer must decide how to split limited land across candidate crops to balance expected profit against weather risk. This is a Robust Portfolio Optimization problem — the same Markowitz mean-variance framework used in financial asset management.

Where This Decision Fits

Agricultural planning chain — the highlighted step is what this page optimizes

Soil Testing Assess field conditions
Crop Selection Allocate acres across crops
Seed & Input Procurement Purchase seeds, fertilizer
Planting Field operations scheduling
In-Season Management Irrigation, pest control
Harvest & Marketing Sell or store crop yields

The Problem

From crop planning to portfolio theory

A farmer with 500 acres must decide what fraction of land to allocate to each of 5 crops. Each crop has an expected profit per acre (affected by weather and market conditions) and a risk profile (variance in yields). The farmer wants to maximize expected profit while controlling risk through diversification.

You have land fractions to assign across candidate crops. The constraint is that all acres must be planted and no crop can receive a negative share. The question is: what mix of crops maximizes expected profit while keeping income volatility at an acceptable level?

This is precisely the structure of a Robust Portfolio Optimization problem. Each crop is an asset, each land fraction is a portfolio weight, and crop yield correlations form the covariance matrix. The Markowitz (1952) mean-variance framework, originally developed for financial assets, applies perfectly to agricultural crop diversification under weather uncertainty.

Agriculture Domain Portfolio Model
Crop Asset
Land fraction Portfolio weight wi
Expected profit Expected return μi
Yield variance Risk σi2
Crop correlations Covariance Σ
Weather uncertainty Ellipsoidal ambiguity
Risk tolerance Parameter λ
max μTw − λ · wTΣw  —  Quadratic Programming

Try It Yourself

Allocate acres among crops with risk-return tradeoff — edit any cell

Configuration

5 Crops · 500 Acres · Click any cell to edit
A 500-acre Midwest farm choosing among standard row crops. Corn, wheat, and soybeans share strong weather correlation, making naive diversification less effective than optimized allocation.
Total Acres
acres to allocate
Crop Data
Crop Exp. Profit μ ($/acre) Risk σ ($/acre)
Risk Aversion (λ)
Max Return Min Risk 0.50
Crop Allocation & Efficient Frontier

The Algorithm

Markowitz mean-variance portfolio optimization

Equal Weight (1/n) 20% each Ignores risk & return differences vs Same crops, different allocation Mean-Variance Optimized 35% 25% 20% 15% 5% Tilts toward low-correlation crops

Markowitz Mean-Variance Optimization

The Markowitz (1952) framework finds the optimal allocation that maximizes expected return for a given level of risk, or equivalently, minimizes risk for a given return. The risk aversion parameter λ traces the efficient frontier — the set of Pareto-optimal portfolios in risk-return space.

1

Define Objective Function

Formulate the quadratic program: maximize μTw − λ · wTΣw, where μ is the vector of expected profits per acre, Σ is the crop covariance matrix, and λ controls the profit-risk tradeoff.

2

Initialize Weights on the Simplex

Start with equal weights wi = 1/n as a feasible initial point. The simplex constraint ensures Σwi = 1 and wi ≥ 0 (all land is allocated, no negative acreage).

3

Projected Gradient Ascent

Compute the gradient ∇f = μ − 2λΣw, take a step w ← w + η∇f, then project back onto the simplex to maintain feasibility (Duchi et al., 2008). This ensures weights remain non-negative and sum to one after each iteration.

4

Iterate Until Convergence

Repeat gradient steps until the change in objective value falls below a tolerance threshold. The converged weights give the optimal crop allocation that balances expected profit against yield risk according to λ.

Real-World Complexity

Why crop planning goes beyond the basic portfolio model

Weather Correlation

Crops in the same region share weather risk (drought, frost, excess rain), creating correlated returns that the covariance matrix must capture accurately.

Government Programs

Subsidies, price floors, and crop insurance programs change the effective risk-return profile, often making certain crops artificially attractive.

Crop Insurance

Revenue protection and yield insurance truncate the downside risk distribution, requiring adjustments to the variance-covariance structure.

Rotation Requirements

Agronomic best practices require crop rotation (e.g., corn after soybeans). This adds temporal linking constraints across planning periods.

Equipment Compatibility

Similar crops share planting and harvesting equipment. Too much diversification increases capital costs and scheduling complexity.

Market Contracts

Forward contracts and futures lock in prices before harvest, reducing price risk but adding minimum quantity commitments to the model.

A second lens: the agronomic LP

Same crop-selection decision, through soil, water, and rotation constraints

The Markowitz Robust Portfolio model above treats crop selection as a risk-return trade-off — an elegant framing transplanted from finance that captures diversification value and hedging behaviour. Agricultural economists, however, typically start from a different place: given this farm's fields, soils, rotation history, and resource budgets, which crop should go where to maximize expected margin? This is the classical agricultural sector LP, formalized by Hazell & Norton (1986) and elaborated in McCarl & Spreen (1997). Together the two lenses give a fuller picture of the crop-mix decision than either alone.
OR family
Linear Programming
Complexity
P (simplex, interior point)
Solver realism
★★☆ LP-feasible heuristic
Canonical reference
Hazell & Norton (1986)

Sets & indices

SymbolMeaningDomain
\(c \in C\)Crop (corn, soy, wheat, barley, canola)\(|C| = 5\)
\(f \in F\)Field on the farm (distinct soil, drainage, slope)\(|F| = 8\)

Parameters

SymbolMeaningUnit
\(A_f\)Area of field \(f\)ha
\(\text{prev}(f)\)Crop grown on field \(f\) last year (rotation block)
\(m_{c,f}\)Expected net margin from crop \(c\) on field \(f\), accounting for soil suitabilityCAD / ha
\(w_c\)Seasonal water demand for crop \(c\)mm
\(n_c\)Nitrogen requirement of crop \(c\)kg N / ha
\(W\)Seasonal water budget (irrigation + effective rainfall)mm · ha
\(N\)Seasonal nitrogen budget (mineralized + applied)kg N
\(\alpha\)Maximum share of total area devoted to any single crop\(\in (0,1]\)

Decision variable

SymbolMeaningDomain
\(x_{c,f}\)Hectares of field \(f\) planted to crop \(c\)\(\geq 0\)

Objective

Maximize total expected margin across the farm:

$$\max \; \sum_{c \in C} \sum_{f \in F} m_{c,f} \, x_{c,f}$$

Constraints

Every field is fully planted, the two seasonal budgets are respected, no crop occupies more than its diversification cap, and rotation history forbids planting the previous year's crop:

$$\sum_{c \in C} x_{c,f} \;=\; A_f \qquad \forall\, f \in F \qquad \text{(field area balance)}$$ $$\sum_{c \in C} \sum_{f \in F} w_c \, x_{c,f} \;\leq\; W \qquad \text{(water budget)}$$ $$\sum_{c \in C} \sum_{f \in F} n_c \, x_{c,f} \;\leq\; N \qquad \text{(nitrogen budget)}$$ $$\sum_{f \in F} x_{c,f} \;\leq\; \alpha \sum_{f \in F} A_f \qquad \forall\, c \in C \qquad \text{(diversification)}$$ $$x_{\text{prev}(f),\, f} \;=\; 0 \qquad \forall\, f \in F \qquad \text{(rotation)}$$ $$x_{c,f} \;\geq\; 0 \qquad \forall\, c,f$$

The same LP, with stochastic margins and chance constraints, becomes a stochastic agricultural sector LP (Hazell, 1971) — a natural bridge back to the Markowitz framing above.

Why this formulation matters

The portfolio model is silent on which field a crop goes on, and implicitly assumes any acre can be any crop. The agronomic LP forces the model to respect the spatial heterogeneity (soil suitability), the temporal link (rotation), and the resource envelope (water, nitrogen) that every farmer operates within. The two models can disagree sharply: a portfolio-optimal 40% soy allocation may be infeasible if the nitrogen budget is tight and last year's fields were already dominated by soy. Running both formulations sheds light on which constraints actually bind.

Real-world → OR mapping

On the farmIn the LP
Corn / soy / wheat / barley / canola\(c \in C\)
Each delineated field\(f \in F\)
Field area (from land registry / GPS boundary)\(A_f\)
Last year's crop on the same field\(\text{prev}(f)\)
Expected margin — yield × price − variable costs, adjusted by soil suitability\(m_{c,f}\)
Crop water requirement (ETc, from CROPWAT/FAO-56)\(w_c\)
Fertilizer nitrogen recommendation (soil test + yield target)\(n_c\)
Seasonal water availability\(W\)
Affordable nitrogen budget for the season\(N\)
Risk-management cap on any single crop\(\alpha\)
Hectares of crop \(c\) planted on field \(f\)\(x_{c,f}\)
Total farm net marginObjective value

Interactive solver

Agronomic LP allocator
5 crops × 8 fields · budget-aware greedy with rotation
★★☆ Heuristic
1200 ha × 400 mm default
Including manure-N credits
Diversification cap
Total margin (CAD)
Water used / budget
Nitrogen used / budget
Area allocated (ha)

How the solver works

The heuristic runs in three passes. (1) For each field, it ranks all rotation-feasible crops by margin per unit of the most-scarce resource (water or nitrogen, whichever is tighter at current shadow prices). (2) It walks through (crop, field) pairs in descending margin order, assigning full-field allocations while tracking remaining water, nitrogen, and per-crop diversification caps. (3) If any field ends up unallocated, it is filled with the cheapest feasible crop (still respecting rotation). This yields a feasible solution that is typically within a few percent of the true LP optimum for instances of this size; a commercial LP solver (Pyomo + CBC, Gurobi) would return the exact optimum in milliseconds.

Reading the heatmap

  • Colored cell = crop allocated to that field. Cell height encodes soil suitability (taller = better match), cell width is proportional to field size.
  • Binding constraints matter most. The KPI cards show whether water or nitrogen is close to 100% of budget — whichever binds is the one the farmer should watch.
  • Diversification vs. margin. Loosening \(\alpha\) from 0.40 to 1.00 usually lifts the objective by 3–8%, at the cost of concentrating on one or two crops — exactly the trade-off the Markowitz model above quantifies more rigorously.

When to use which model

Portfolio model (above): use when the question is “how much risk to take?” — when yield/price uncertainty is central and the farm has flexibility in total acreage per crop.

Agronomic LP (this section): use when the question is “where does each crop go, given my real resources?” — when rotation, soil heterogeneity, or tight water/nitrogen budgets are the binding constraints.

Both, jointly: formulations exist that combine them (stochastic agricultural LP with CVaR risk measure) — the subject of decades of research in agricultural economics.

References

Key literature on portfolio optimization and agricultural applications

Markowitz, H. (1952).
"Portfolio Selection."
The Journal of Finance, 7(1), 77–91.
Goldfarb, D., & Iyengar, G. (2003).
"Robust Portfolio Selection Problems."
Mathematics of Operations Research, 28(1), 1–38.
Hardaker, J.B., Huirne, R.B.M., Anderson, J.R., & Lien, G. (2004).
"Coping with Risk in Agriculture."
2nd Edition, CABI Publishing.
DeMiguel, V., Garlappi, L., & Uppal, R. (2009).
"Optimal Versus Naive Diversification: How Inefficient is the 1/N Portfolio Strategy?"
Review of Financial Studies, 22(5), 1915–1953.
Kazaz, B., & Webster, S. (2011).
"The Impact of Yield-Dependent Trading Costs on Pricing and Production Planning Under Supply Uncertainty."
Manufacturing & Service Operations Management, 13(3), 404–417. doi:10.1287/msom.1100.0329
Hazell, P. B. R. (1971).
"A Linear Alternative to Quadratic and Semivariance Programming for Farm Planning Under Uncertainty."
American Journal of Agricultural Economics, 53(1), 53–62. doi:10.2307/1237835
Hazell, P. B. R., & Norton, R. D. (1986).
Mathematical Programming for Economic Analysis in Agriculture.
New York: Macmillan. Canonical text on the agricultural sector LP and its extensions — the foundation of the agronomic variant above.
McCarl, B. A., & Spreen, T. H. (1997).
Applied Mathematical Programming Using Algebraic Systems.
Texas A&M University course notes, regularly revised. agecon2.tamu.edu/mccspr
Ahumada, O., & Villalobos, J. R. (2009).
"Application of planning models in the agri-food supply chain: A review."
European Journal of Operational Research, 196(1), 1–20. doi:10.1016/j.ejor.2008.02.014

Need to optimize agricultural
portfolio diversification?

Get in Touch
Data shown is illustrative. This is a simplified model for educational purposes.
 Home
ESC