Skip to content

Many collapse draws

New in 0.2.0

cascade.run draws one correlated collapse realisation. The damage probabilities say how likely each building is to collapse, but debris, road closure and everything after them need concrete collapses, so one set is sampled with collapse_seed. The closed roads of a run therefore hold for that draw only. This tutorial shows how much they vary from draw to draw, and how to get frequencies instead of one draw. The script is examples/03_realisations_and_gis.py.

python examples/03_realisations_and_gis.py

Repeating the draw

from quakecascade import cascade, datasets

town = datasets.synthetic_town(seed=0)
inputs = cascade.inputs_from_town(town)
# params: the CascadeParams of the first tutorial
rz = cascade.realisations(inputs, params, seeds=range(40))

realisations reruns the chain for every seed, with only collapse_seed changed. The ground motion and the damage probabilities are the same in every run. The stages that do not depend on the draw (liquefaction, Monte Carlo bands, allocation, lifelines) are left out of the repeated runs. On the synthetic town, 40 draws take about ten seconds.

rz.runs has one row per draw:

== 40 collapse draws (collapse_mode='between_event')
collapsed                  median   143.5   5-95 %:    62.4 -   275.6
closed_edges               median    30.0   5-95 %:    10.9 -    62.3
newly_cut_off_population   median     0.0   5-95 %:     0.0 -     0.0

The draw used in the first tutorial (seed 7) closed 23 edges. Another seed could just as well have closed 11 or 62. With collapse_mode="between_event", the ground-motion residual shared by all buildings moves every building together, so some draws are much more destructive than others. This is the same correlation the Monte Carlo bands quantify for the city totals.

Closure frequency per road

rz.roads gives, for every road, the share of draws in which it closed (closed_frequency). It also gives the share in which it stayed open but was touched by debris of unknown extent (uncertain_frequency):

== roads by closure frequency
never      702
< 10 %      13
10-25 %     62
25-50 %     59
> 50 %       4

Closure frequency

A road that closes in half of the draws is a far more robust finding than one that closed in a single run. For clearance priority, rank roads by closed_frequency rather than by the closures of one draw.

Isolation frequency per unit

rz.units gives, for every planning unit, the share of draws in each isolation category (newly_cut_off_frequency, worse_frequency, ...). The shares of a unit sum to one, with unknown_frequency for draws in which it had no travel time. In the synthetic town no unit is cut off from every hospital in any draw, because the grid of streets offers detours. On a real network with bridges, dead ends and narrow old quarters, these frequencies are the headline numbers.

How many draws?

A frequency f estimated from n draws has a standard error of about sqrt(f (1 - f) / n): ±0.08 at f = 0.5 with 40 draws, and ±0.05 with 100. Report n with every frequency.

A GeoPackage for QGIS

The same script writes one run to a GeoPackage:

result = cascade.run(inputs, params)
written = cascade.export_geopackage(result, inputs, "synthetic_town.gpkg")
# layers: buildings, roads, units, sites, hospitals, fire_stations
# + synthetic_town.manifest.json beside it

See Open the results in QGIS for the layers and their columns.