Skip to main content

Module 5: uncertainty and risk, seasonal analysis

DSSAT training, module 5 of 6. Follows day 5 of the course, with code instead of the DSSAT shell

How to use this module. Read this page for the ideas; every chart comes from the module 5 notebook (), which runs the DSSAT engine and writes the small data files the charts read. The runs on this build were made on .

What you will learn

  • Why a management choice has to be judged over many seasons, and how DSSAT runs a seasonal analysis.
  • How to turn simulated yields into money and compare strategies by their whole distribution: cumulative distributions, stochastic dominance, mean and spread, the attitude to risk.
  • How the best fertilizer rate changes from season to season, and what a “blanket” recommendation gives up.
  • How a regional study adds up farms, soils and prices to the response of a whole area.

1. Seasonal analysis: irrigation strategies

The seasonal experiment UFGA7812 of DSSAT runs Bragg soybean at Gainesville, Florida, for seasons (DSSAT Foundation 2026). Treatment 1 is rainfed; treatments 2 to 10 irrigate automatically when the available water in the top 30 cm falls to 10%, 20% … 90% of its capacity. The weather is generated: with WTHER = W the engine draws daily weather from the monthly statistics of the climate file UFGA.CLI, so the seasons are samples of Gainesville’s climate, not the weather of particular years.

Monthly means of Weather/Climate/UFGA.CLI (dssat-csm-data), the input of the weather generator.

From yields to money

The experiment’s price and cost file UFGA7812.PRI (codes defined in the engine’s ECONOMIC.CDE) draws the soybean price from a normal distribution with mean and standard deviation $/t, and sets base costs of $/ha, $ per mm of irrigation and $ per application. The notebook drew one price per season, used for all ten strategies. The gross margin of strategy \(s\) in season \(t\) is

\[ GM_{s,t} = p_t\,Y_{s,t} - C_{base} - c_{mm}\,I_{s,t} - c_{app}\,n_{s,t} \]

with \(p_t\) the price, \(Y\) the yield, \(I\) the irrigation in mm and \(n\) the number of applications (seed is left out: the file prices it per kg but gives no seeding rate).

The course’s first exercise asks what happens when each irrigation costs $25.00 instead of $0.50:

At $ per irrigation and $ per mm, the biologically best strategy (highest mean yield) is and the economically best (highest mean margin) is .

Comparing whole distributions

The cumulative distribution shows, for every margin, the share of seasons below it; a curve further to the right is better.

Where one curve lies entirely to the right of another, its strategy is better in every respect that money measures: first-degree stochastic dominance, \(F_A(m) \le F_B(m)\) for every margin \(m\), with \(F\) the cumulative distribution. At the costs set above: . Between the other strategies the choice depends on how much the farmer minds a bad season.

Attitude to risk

A farmer who dislikes risk values a sure margin more than an uncertain one with the same mean. With an exponential utility \(u(m) = -e^{-r m}\), the certainty equivalent

\[ CE = -\frac{1}{r}\,\ln\!\left(\frac{1}{n}\sum_{t=1}^{n} e^{-r\,GM_t}\right) \]

is the sure margin worth as much as the uncertain one; \(r\) is the risk aversion (\(r \to 0\): only the mean counts).

With r = , the best strategy is , with a certainty equivalent of $/ha.

2. The nitrogen exercise: maize at Kadoma, Zimbabwe

The course asks for the urea rate that maximizes the gross margin of rainfed maize at the Cotton Research Institute, Kadoma, in Natural Region II of central Zimbabwe: first for one season (part A, one per participant), then as a “blanket” rate over all seasons of measured weather (part B). The experiment, KADO9901.SNX, is hypothetical and fully specified by the exercise: the Malawian hybrid MH-16 (entered in the cultivar file with the coefficients the exercise gives), the Millhopper fine sand, initial conditions on 7 October (previous crop maize, 100 kg/ha of residue with 0.5% N, soil water at 50% of the available range, 5 kg/ha of soil N), planting on 15 October at 3.7 plants/m², urea in two equal splits at planting and 30 days later, no irrigation. The notebook writes the file in code:

The exercise’s “5 kg/ha of soil N” is spread here as nitrate at the same concentration in every layer ( ppm), a choice: the exercise does not say how XBuild divides it.

Part A: one season

The exercise’s prices, in Zimbabwean dollars:

\[ GM = Y \cdot P - N \cdot C - F \]

with Y the yield in t/ha, P = Z$ /t, C = Z$ /kg and F = Z$ /ha of fixed costs. The exercise calls N both “the amount of urea used” and “the amount of urea N”; the page prices each kilogram of N, and you can change the price (Z$ 2.0 per kilogram of urea, which is 46% N, would be about Z$ 4.35 per kilogram of N).

In ( mm of rain over the season) the best rate is kg N/ha, for kg/ha of grain and a gross margin of Z$ /ha.

Part B: the blanket rate

The best rate in hindsight varies from to kg N/ha between seasons (dots). The blanket rate, the one with the highest mean margin over all seasons, is kg N/ha (dashed line), with a margin of Z$ ± /ha. Not knowing the season costs on average Z$ /ha against perfect foresight: an upper limit on what a seasonal forecast could be worth for this decision.

Part C: beyond yield and profit, the nitrogen that is lost

Risk is not only money. The course’s lecture on uncertainty listed environmental outcomes beside the biophysical and economic ones (nitrogen leaching, runoff, pollution), and its nitrogen lectures used the models to improve best management practices (BMPs) for nitrogen that minimize nitrate leaching, by looking at the rate and timing of fertilizer over many seasons. The same Kadoma runs give the nitrogen leached below the profile at each rate:

Without fertilizer kg N/ha is leached in a mean season; at the blanket rate of kg N/ha (dashed line) , and at kg N/ha . The margin peaks at the blanket rate, so rates above it cost money and add to the nitrogen lost. A rate somewhat below it, or the same amount split into more doses, are the kinds of practice a BMP analysis would compare, with leaching as a criterion beside the margin.

3. Regional risk analysis and adoption: millet in Niger

The course’s third exercise is a small regional study. Should the farmers around Tillabery, Niger, change from millet cultivar Niger 1 to Niger 2? The course’s NIGE1101.SNX simulates both cultivars on the area’s two soils, a medium alfisol (soil type A) and a Niger sandy soil (type B), for 10 years of measured weather. There are 100 farms on soil A (2 ha each on average; 20% of these farmers do not grow millet) and 150 farms on soil B (1.8 ha each). The cultivars are entered as the exercise gives them; Niger 2’s coefficients turn out to be identical to the cultivar file’s generic “NORTH VARIETY”.

Part A: yield and the regional response

On soil A Niger 2 yields kg/ha against for Niger 1; on soil B against . Over the region’s ha of millet ( ha on soil A after leaving out the 20% of farmers who do not grow it, ha on soil B), full adoption of Niger 2 would change the expected harvest from to t.

Part B: a price penalty for late maturity, and the farmer’s utility

Late millet is paid less, and the exercise compares the cultivars by a mean-variance utility:

\[ \begin{gathered} p = 300 - 0.02\,D^2 \ \ \text{(CFA/t)}, \qquad GM = Y\,p \\[4pt] U = E[GM] - 0.35\,\mathrm{Var}[GM] \end{gathered} \]

with \(D\) the days from planting to maturity and \(Y\) the yield in t/ha (other costs ignored). Change the penalty and the weight on risk:

With these settings a farmer who maximizes utility grows on soil A and on soil B. The region would then harvest about t of millet. Niger 1 yields more but matures about days later, and the penalty grows with the square of the season length; move the penalty to see where the choice turns.

From one field to a grid: xdssat

A seasonal analysis gives a distribution of outcomes for one field. xdssat gives one for every cell: in the rice case study, 30 seasons of measured weather (1991-2020) for each 0.1° cell of Java. The coefficient of variation of the simulated yield over those seasons, and the share of seasons below a yield you choose, are a map of production risk:

The median cell’s yield varies from season to season by (coefficient of variation) for rainfed wet-season rice and for irrigated. The same tools as above (cumulative distributions, dominance, certainty equivalents) apply cell by cell; xdssat writes the seasons as a netCDF grid for that.

Self-test

  1. Strategy A has a higher mean margin than B; B has a smaller spread. When would you recommend B?
  2. Why does the comparison use the same price draw for all strategies in a season?
  3. The weather of part 1 is generated. What can such a run tell you that measured weather from 30 years cannot, and what can it not?
  4. At Kadoma, what would change the blanket rate more: doubling the price of N, or a run of dry seasons?
  5. Exercise 4 of the course: set up a seasonal experiment of your own, 4 to 8 treatments over at least 8 years, with costs and prices that fit the place, and report what you assumed.

Where this goes next

Module 6 turns from single seasons to crop sequences, where each crop starts from the soil the previous one left. The plan for all six modules is on the training overview.

References

DSSAT Foundation. 2026. DSSAT-CSM Example Data (Dssat-Csm-Data), Commit 99c95b3. https://github.com/DSSAT/dssat-csm-data.
Back to top