A cyclone trigger, taken apart

How the Trigger Lab is made: storm tracks turned into one small table, an open record of which seasons hurt, and what ten seasons can and cannot tell

showcase
parametric-insurance
tropical-cyclones
basis-risk
The Trigger Lab, taken apart: 47 seasons of storm tracks reduced to a lookup table, Mozambique’s open impact record, the four outcomes of a trigger, and why a short record sees misses but hardly sees false alarms. With code, figures and a reading list.
Published

November 21, 2026

The Trigger Lab lets you design a parametric cyclone cover for Mozambique: pick a place, a radius and a wind speed, and see in which seasons since 1979/80 it would have paid, and how that matches the seasons that hurt. This article takes it apart: what each piece does, the code that does it, the ideas behind it, what it cannot tell, and what to read to go further.

NoteHow this was made

Built with AI coding tools: I set the direction, tested and decided; the tools wrote the code and the first draft of this article. The reference list was checked against Crossref, and what I say about each source against its abstract or an open copy.

A trigger, not a claim

An ordinary insurance pays after someone has counted the damage. A parametric cover pays when something measured crosses a line agreed in advance: a wind speed, a rainfall total, a modelled loss. That makes it fast, because nobody has to count anything first. The price of that speed is that the measurement is not the loss. The cover can pay when little was lost, or stay silent when a lot was. That gap is called basis risk.

Index insurance of this kind is also used in farming: Barnett and Mahul (2007) describe weather index products for agriculture in lower-income countries and what they need to work. The Trigger Lab uses the simplest trigger there is, one storm, one wind speed, one zone, so that every part of the gap can be seen.

Four outcomes

In any season, two questions have yes-or-no answers: did the trigger pay, and was there a disaster? That makes four outcomes (Figure 1).

A two-by-two table: paid and disaster is a hit, paid and no disaster a false alarm, no payout and disaster a miss, neither is quiet
Figure 1: The four outcomes of a trigger in one season. Basis risk is the two cells off the diagonal.

This is the same table that weather forecasters use to check a yes-or-no forecast: a forecast of rain against whether it rained. The parallel is more than a picture. A trigger is a forecast of loss made from a hazard measurement, and it can be judged the way forecasts are. Murphy (1993) separates three kinds of goodness in a forecast: consistency, quality (how well forecasts match what was observed) and value (what a decision maker gains by using them). The Trigger Lab shows quality, the four counts. It does not show value: what a miss costs a government against what a false alarm costs in premium.

Figueiredo et al. (2018) take the parallel further. A trigger that answers only yes or no, they argue, is open to basis risk; they propose triggers that give a probability of loss instead, and judge them with the tools of forecast verification. The Trigger Lab stays with yes or no, on purpose: it is the version a reader can hold in their head.

The storms

The storms come from IBTrACS (Knapp et al. 2010), the archive that gathers the best tracks of all the agencies that watch tropical cyclones. For the South Indian Ocean it holds, among others, the tracks of the US Joint Typhoon Warning Center and of the regional centre on La Réunion. The page uses only the US columns: USA_LAT, USA_LON and USA_WIND. Two reasons:

  • One way of measuring wind. According to IBTrACS’ column documentation, agencies average the wind over different times: the US agencies over one minute, others over three or ten. A slider that mixed them would compare different things.
  • Terms of use. NCEI, which publishes IBTrACS, names the World Meteorological Organization’s Resolution 40 as the guide for commercial use. Using only the US agencies’ data keeps the page clear of the limits that resolution allows other agencies to set.

The wind is the storm’s maximum sustained wind: the highest one-minute average anywhere in the storm, not the wind at a given place. Over the open ocean, that number is often an estimate from satellite images of the storm’s clouds, with methods that go back to Vernon Dvorak (Velden et al. 2006). A trigger on it inherits that estimate.

A southern-hemisphere season runs from July to June, so the season 2018/19 holds Idai and Kenneth. The page covers 47 seasons, from 1979/80 to 2025/26. For the two latest, the US tracks are still provisional and will change when they are made final.

From tracks to one small table

The page must answer every combination of zone, radius and wind threshold the instant a slider moves. Computing that from the tracks in the browser would be slow. So a script, scripts/showcase_trigger_lab/prepare.py, does all of it once, and the page only looks the answer up.

Hourly positions. The US agency fixes are six-hourly, and IBTrACS adds points in between, so the file has a position every three hours; the script fills in every hour by straight lines between them, but never across a gap of more than six hours (from prepare.py):

    for i in range(len(g) - 1):
        h = (t[i + 1] - t[i]) / np.timedelta64(1, "h")
        n = int(h) if 0 < h <= 6 else 1
        for k in range(n):
            f = k / n if h <= 6 else 0
            rows.append((t[i] + np.timedelta64(k, "h") if h <= 6 else t[i], *(v[i] + f * (v[i + 1] - v[i]))))

Distance to the country. For the zone “anywhere in Mozambique, within r km”, the script needs the distance from each hourly position to the country’s outline (Natural Earth, 1:50m). It flattens the Earth locally around each point, measures the distance to every segment of the outline, and keeps the smallest; inside the country the distance is zero. The script’s notes put the error of the flat approximation under 1 % for distances up to 500 km:

        c = np.cos(np.radians(py))
        ux, uy = (ax - px) * c * k, (ay - py) * k
        vx, vy = (bx - px) * c * k, (by - py) * k
        dx, dy = vx - ux, vy - uy
        t = np.clip(-(ux * dx + uy * dy) / (dx * dx + dy * dy + 1e-12), 0, 1)
        qx, qy = ux + t * dx, uy + t * dy
        out[s:s + chunk] = np.sqrt(qx * qx + qy * qy).min(axis=1)

t is how far along a segment the nearest point lies, clipped to the segment’s ends. For the six cities, the distance is the ordinary great-circle distance.

The table. For every storm and every zone, the script keeps one number per radius step (0 to 500 km in steps of 25): the strongest wind while the centre was inside. That is the whole trick:

        mw = {"Mozambique": [int(wind[dm <= r].max()) if (dm <= r).any() else 0 for r in RADII]}

97 storms came within 500 km of Mozambique with a US track. For each, seven zones times 21 radii is 147 numbers. Whether a storm triggers a cover is then one comparison: is the number for this zone and radius at least the threshold? 23 more storms came near but have no US track; they are counted on the page and left out.

What counts as a disaster

The trigger needs a truth to be tested against: which seasons hurt. That is harder to find than the storms.

Mozambique’s disaster management institute, INGD, publishes a table of the cyclones that affected the country since the 2016/17 season, with the number of people affected, on the Humanitarian Data Exchange under CC0. The page uses it: a season counts as a disaster if INGD lists a storm in it. Each of INGD’s 13 storms is matched to a track by name and season, and the script stops if a name matches no track or more than one:

    for e in events:
        cand = [s for s in by_name.get(e["name"], []) if s["season"] in (e["year"], e["year"] + 1)]
        assert len(cand) == 1, (e, [c["id"] for c in cand])
        impacts.append({**e, "sid": cand[0]["id"], "season": cand[0]["season"]})

Before 2016/17 no open record by season was found for the page. Mozambique’s national disaster inventory for 1979 to 2012 is open on the same platform, but only as totals by year or by hazard. The other large disaster databases that were checked do not allow use on a site like this one. So 37 of the 47 seasons can show whether the trigger paid, but not whether it should have. The page marks them “no open record” and says that this is not the same as “nothing happened”.

The page

The page is written in Observable JavaScript, which Quarto runs in the browser. Its cells work like a spreadsheet: when a slider changes, every cell that uses it is computed again. The heart of the page is one cell that sorts every season into the four outcomes (from showcases/trigger-lab-mozambique.qmd):

rows = seasons.map((s) => {
  const paying = tl.storms.filter((d) => d.season === s && d.mw[zone][ri] >= wind)
    .map((d) => ({id: d.id, name: d.name, mw: d.mw[zone][ri]}));
  const eventsAll = tl.impacts.filter((e) => e.season === s);
  const events = eventsAll.filter((e) => e.people_affected >= minAffected);
  const record = s >= recordSpan[0] && s <= recordSpan[1];
  const paid = paying.length > 0, disaster = events.length > 0;
  const cat = !record ? (paid ? "paid-norec" : "none-norec")
    : paid && disaster ? "hit" : paid ? "false" : disaster ? "miss" : "quiet";
  return {season: s, paying, events, eventsAll, record, paid, disaster, cat};
})

d.mw[zone][ri] is the lookup from the table above. The map, the season grid, the 2×2 and the sentence “would have paid … about once every n years” all read rows. That last number is simply the number of seasons divided by the number that paid; it is a rough return period, not a model of one. The page needs no server: the data file is about 245 KB, and the page carries no other library than the plotting tools that come with Quarto.

What ten seasons can tell

Ten seasons have an open record, 2016/17 to 2025/26. In eight of them INGD lists at least one storm. Of the other two, 2017/18 had no storm within 500 km of the country, and in 2019/20 Belna never came within 450 km and Diane came within 350 km only at 20 kt. So the record is mostly disasters, and that shapes what it can say (Figure 2).

Two charts against the wind threshold: paying seasons fall from 24 to none for all of Mozambique and from 7 to none around Beira; missed disaster seasons rise from 0 to 8 for Mozambique and from 6 to 8 around Beira
Figure 2: What moving the wind threshold does, for two zones: how many of the 47 seasons would have paid, and how many of the 8 disaster seasons in the record it misses. The marked thresholds are where the Saffir–Simpson categories 1, 3, 4 and 5 begin (64, 96, 113 and 137 kt), and 34 kt, the lowest value of the page’s slider.

Misses are easy to see. With the page’s starting setting, anywhere in Mozambique within 100 km and 64 kt, the cover pays in 18 of 47 seasons and misses one disaster season, 2023/24 (Filipo). Raise the threshold to 96 kt and it misses four of the eight. Shrink the zone to 100 km around Beira and it misses at least six of the eight at any threshold: most of the storms that hurt Mozambique in these years did not come within 100 km of Beira.

False alarms are almost invisible. In the two seasons without a listed disaster, almost nothing came near. Within 100 km of the country, no setting gives a single false alarm. One appears only with the widest zones: Belna pays in 2019/20, without a listed disaster, for all of Mozambique within 475 km or more, or around Nacala within 500 km, at thresholds up to 100 kt. A record this short cannot tell how often a trigger pays for nothing, which is exactly what decides its price.

And the record itself is a choice. “INGD lists a storm” counts Gezani in 2025/26, with 9,040 people affected, the same as Idai in 2018/19, with 1,628,167 (INGD’s sheet for Idai may include a tropical storm of the same weeks). The page lets the reader raise the bar to 100,000 or 500,000 people, and the outcomes shift with it.

What basis risk costs the people covered is a question of its own. Clarke (2016) shows that basis risk changes demand at its root: a buyer with infinite risk aversion would rationally buy none of an index cover, and demand need not rise with risk aversion, wealth or a lower price. Jensen, Barrett, and Mude (2016) measured basis risk with eight seasons of household data for a livestock index cover in northern Kenya, and found that insured households were still left with, on average, 69 % of their original risk from high-loss events.

What the lab leaves out

The wind is the storm’s peak, wherever it blew, not the wind at a town. Rain, rivers and storm surge are not seen at all: Idai in 2019 brought more than 200 mm of rain in a day and flooded about 3,000 km², as the page quotes from the government-led Post-Disaster Needs Assessment (2019). A season pays all or nothing, once. There is no premium, no cost and no money amount. The record of disasters covers ten seasons, and a disaster is a line in a table, not a loss. The page reproduces no real insurance product.

From lab to trigger

A cover that people rely on is built differently. Real programmes calibrate on long modelled event sets as well as on history, and some trigger on a modelled loss instead of the wind, as the page notes with the example of the Caribbean risk pool’s technical paper. They pay in steps, from an attachment point to an exhaustion point, rather than all or nothing. A modelled-loss trigger weighs the hazard by where people and buildings are. And all of them need what the lab lacks most: a long, open record of losses to test against, at the scale of the zone.

Data and sources

As on the Trigger Lab page:

  • Storm tracks: NOAA’s International Best Track Archive for Climate Stewardship (IBTrACS), version 4r01, South Indian basin, US-agency columns only, accessed 19 November 2026 (NCEI); Knapp et al. (2010); Gahtan, J., K. R. Knapp, C. J. Schreck, H. J. Diamond, J. P. Kossin and M. C. Kruk (2024): IBTrACS Project, Version 4r01, NOAA National Centers for Environmental Information, doi:10.25921/82ty-9e16. No endorsement by NOAA implied.
  • Disaster seasons: INGD (Instituto Nacional de Gestão e Redução do Risco de Desastres), “Mozambique: Impact of Cyclones”, via the Humanitarian Data Exchange (OCHA), public domain (CC0), accessed 19 November 2026.
  • Map and distances: made with Natural Earth (public domain), 1:50m countries and 1:10m populated places.

A reading guide

Index insurance and basis risk. An overview (Barnett and Mahul 2007), a theory of demand (Clarke 2016), basis risk measured in the field (Jensen, Barrett, and Mude 2016), probabilistic triggers (Figueiredo et al. 2018).

Judging a yes-or-no forecast. What makes a forecast good (Murphy 1993).

The storms. The archive (Knapp et al. 2010) and how storm strength is estimated from space (Velden et al. 2006).

References

Barnett, Barry J., and Olivier Mahul. 2007. “Weather Index Insurance for Agriculture and Rural Areas in Lower-Income Countries.” American Journal of Agricultural Economics 89 (5): 1241–47. https://doi.org/10.1111/j.1467-8276.2007.01091.x.
Clarke, Daniel J. 2016. “A Theory of Rational Demand for Index Insurance.” American Economic Journal: Microeconomics 8 (1): 283–306. https://doi.org/10.1257/mic.20140103.
Figueiredo, Rui, Mario L. V. Martina, David B. Stephenson, and Benjamin D. Youngman. 2018. “A Probabilistic Paradigm for the Parametric Insurance of Natural Hazards.” Risk Analysis 38 (11): 2400–2414. https://doi.org/10.1111/risa.13122.
Jensen, Nathaniel D., Christopher B. Barrett, and Andrew G. Mude. 2016. “Index Insurance Quality and Basis Risk: Evidence from Northern Kenya.” American Journal of Agricultural Economics 98 (5): 1450–69. https://doi.org/10.1093/ajae/aaw046.
Knapp, Kenneth R., Michael C. Kruk, David H. Levinson, Howard J. Diamond, and Charles J. Neumann. 2010. “The International Best Track Archive for Climate Stewardship (IBTrACS): Unifying Tropical Cyclone Data.” Bulletin of the American Meteorological Society 91 (3): 363–76. https://doi.org/10.1175/2009BAMS2755.1.
Murphy, Allan H. 1993. “What Is a Good Forecast? An Essay on the Nature of Goodness in Weather Forecasting.” Weather and Forecasting 8 (2): 281–93. https://doi.org/10.1175/1520-0434(1993)008<0281:WIAGFA>2.0.CO;2.
Velden, Christopher, Bruce Harper, Frank Wells, John L. Beven, Ray Zehr, Timothy Olander, et al. 2006. “The Dvorak Tropical Cyclone Intensity Estimation Technique: A Satellite-Based Method That Has Endured for over 30 Years.” Bulletin of the American Meteorological Society 87 (9): 1195–1210. https://doi.org/10.1175/BAMS-87-9-1195.