Crop Portfolio Selection
ROBUST PORTFOLIO OPTIMIZATION
Agriculture · Production · StrategicCrop 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
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 λ |
Try It Yourself
Allocate acres among crops with risk-return tradeoff — edit any cell
Configuration
5 Crops · 500 Acres · Click any cell to edit| Crop | Exp. Profit μ ($/acre) | Risk σ ($/acre) |
|---|
The Algorithm
Markowitz mean-variance portfolio optimization
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.
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.
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).
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.
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
Sets & indices
| Symbol | Meaning | Domain |
|---|---|---|
| \(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
| Symbol | Meaning | Unit |
|---|---|---|
| \(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 suitability | CAD / 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
| Symbol | Meaning | Domain |
|---|---|---|
| \(x_{c,f}\) | Hectares of field \(f\) planted to crop \(c\) | \(\geq 0\) |
Objective
Maximize total expected margin across the farm:
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:
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 farm | In 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 margin | Objective value |
Interactive solver
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