# Europe and Turkey earthquake: the ESRM20 lane

The model lab's `openquake-esrm` lane gives an **annual earthquake loss
view for Europe and Turkey** from the European Seismic Risk Model 2020
(ESRM20), run in the OpenQuake engine. For each place you send it returns
the average annual loss, the occurrence and aggregate loss at return
periods up to 1 in 1,000, tail value at risk, and how much the sample
itself moves those figures. How to submit a run is in
[the agent walk](agents.md); the metrics block shared by every lane is in
[Lab metrics](lab-metrics.md). Every lab model is an open model, run as its
authors published it on fixed inputs. Craton has not validated it.

| Spec `model` | Version | Model | Where |
|---|---|---|---|
| `openquake-esrm` | `openquake-3.26.2-esrm20-r1` | ESRM20 (EFEHR), hazard from ESHM20, OpenQuake engine 3.26.2 | The 43 countries of the ESRM20 site model, Portugal to Turkey, Ireland to Cyprus; not Iceland |

**Basis:** a probabilistic view. Every figure comes from a stochastic event
set sampled from the ESHM20 source model with ESRM20 vulnerability: not
observed history, not a forecast.

```json
{"model": "openquake-esrm",
 "building_class": "rc_infilled_frame_moderate_code_4",
 "exposure": {"points": [
   {"lat": 41.0082, "lon": 28.9784, "value": 10000000},
   {"lat": 40.9906, "lon": 29.029, "value": 10000000}
 ]}}
```

Up to 500 places a run. Every figure is **ground-up**: the loss to the
buildings before any deductible, limit or reinsurance. Values are building
replacement values, in whatever currency you send.

## The model

ESRM20 is the European Facilities for Earthquake Hazard and Risk's
open risk model for Europe, published with its OpenQuake input files under
CC BY 4.0 (commercial use allowed, with attribution):

- **Hazard:** the ESHM20 source model as ESRM20 packages it for risk, a
  two-branch source logic tree (area sources, and faults with smoothed
  seismicity) plus deep, volcanic and subduction-interface sources, and the
  ESHM20 ground-motion logic tree: Kotha et al. (2020) with slope and
  geology site terms for shallow crust, BC Hydro variants for subduction
  and Vrancea, a craton model and a volcanic model, each with stress and
  attenuation branches.
- **Site conditions:** the ESRM20 30 arc-second site model (Vs30, slope,
  geology, attenuation region, distance to the volcanic front). Each place
  takes the values of the nearest cell. A place more than 5 km from every
  cell (at sea, outside the 43 countries, or in unbuilt land) comes back
  `unmodeled`, not refused. Iceland is outside the lane: ESRM20 runs it
  with a separate source model.
- **Vulnerability:** the ESRM20 total replacement cost vulnerability
  functions, one for the building class you choose (below).

Cite it as: Crowley H., Dabbeek J., Despotaki V., Rodrigues D., Martins L.,
Silva V., Romao X., Pereira N., Weatherill G. and Danciu L. (2021)
European Seismic Risk Model (ESRM20), EFEHR Technical Report 002, V1.0.0,
https://doi.org/10.7414/EUC-EFEHR-TR002-ESRM20, with the hazard from
Danciu L. et al. (2021), https://doi.org/10.12686/a15. Every result
carries the citation in `model_source`.

## Building classes

`building_class` picks one ESRM20 vulnerability function for every place.
The ids follow ESRM20's own classes (the GEM building taxonomy): material
and lateral system, seismic design level, and height.

| `building_class` | What it is | ESRM20 function |
|---|---|---|
| `rc_infilled_frame_moderate_code_4` (default) | Reinforced concrete frame with masonry infill, moderate seismic code (15% g design force), 4 stories | `CR_LFINF-CDM-15_H4` |
| `rc_infilled_frame_low_code_4` | The same frame, low seismic code (10% g) | `CR_LFINF-CDL-10_H4` |
| `rc_infilled_frame_high_code_4` | The same frame, high seismic code (20% g) | `CR_LFINF-CDH-20_H4` |
| `rc_infilled_frame_no_code_4` | The same frame, no seismic design | `CR_LFINF-CDN-0_H4` |
| `rc_moment_frame_moderate_code_4` | Reinforced concrete moment frame without infill, moderate code (15% g), 4 stories | `CR_LFM-CDM-15_H4` |
| `rc_wall_moderate_ductility_8` | Reinforced concrete shear walls, moderate ductility, 8 stories | `CR_LWAL-DUM_H8` |
| `unreinforced_clay_brick_2` | Unreinforced fired clay brick masonry, 2 stories | `MUR-CL99_LWAL-DNO_H2` |
| `unreinforced_rubble_stone_2` | Unreinforced rubble stone masonry, 2 stories | `MUR-STRUB_LWAL-DNO_H2` |
| `confined_masonry_3` | Confined masonry, moderate ductility, 3 stories | `MCF_LWAL-DUM_H3` |
| `steel_moment_frame_2` | Steel moment frame, moderate ductility, 2 stories | `S_LFM-DUM_H2` |
| `timber_frame_2` | Timber frame, moderate ductility, 2 stories | `W_LFM-DUM_H2` |

Each function is driven by one intensity measure (peak ground acceleration
or spectral acceleration at 0.3, 0.6 or 1.0 seconds), which the result
names in `building_class.intensity_measure`. The lane applies the mean
damage ratio of the curve; see the assumptions below.

## What a run does

The event set and its settings are fixed by the model version, so the same
places give the same figures every time and the caller cannot trade
accuracy for speed:

- **10,000 sample years:** 20 branches of the logic tree, sampled with
  ESRM20's own seed, each with 500 one-year stochastic event sets sampled
  with a fixed seed. Earthquakes of magnitude 5 and above.
- **Every run draws the same earthquakes.** The engine samples ruptures
  from the whole ESHM20 source model before it looks at your places, so a
  place's earthquakes do not depend on the rest of the schedule.
- **Reach:** ground motion is computed out to 100 km at magnitude 5,
  rising to 300 km (ESRM20's own limit) at magnitude 7 and above.
- **The year of an event** comes from the engine: each branch owns a run of
  500 years and each event is placed in one of them. Summing a year's
  events gives the aggregate (AEP) view; its largest event gives the
  occurrence (OEP) view.

ESRM20's own configuration, 10,000 event sets on each of 100 branches (a
million years), holds a hundred times the events of a run here, far beyond
the lab's run ceiling. The settings here were chosen from a measurement of
how much the answer moves between independent event sets (below), inside
that ceiling.

## The metrics

The `metrics` block (schema `lab-metrics/1`, basis `event_set`) has the
fields of the synthetic tropical-cyclone lane: `aal`, `aal_share` and
`aal_per_mille` (over the value of the modeled places, `modeled_value`),
`sd`, `cv`, `aal_standard_error`, `ep` (OEP and AEP at 1 in 10, 25, 50,
100, 200, 250, 475, 500 and 1,000), `tvar` (on the AEP basis at 1 in 100,
250 and 475), `sampling`, `per_point`, `events`, `year_loss_table`,
`event_loss_table`, `assumptions` and `warnings`. It adds:

- `building_class`: the class, its label and the ESRM20 function.
- `per_point[]`: the country, Vs30, slope and geology the place took, and
  how far it is from the site-model cell (`cell_km`).
- `events[]`: the magnitude, hypocenter, ESHM20 source id and tectonic
  region of each of the 50 largest events, with the loss at each place for
  schedules of up to 200 places. Event ids are the engine's.
- `sampling`: the spread across ten 1,000-year blocks, each holding two
  whole branches, of the AAL and the 1-in-100, 1-in-250 and 1-in-475 OEP
  and AEP, and `aal_standard_error_between_branches`: the AAL's standard
  error from the spread of the 20 branches' own averages (each branch is
  an independent draw of a logic-tree path and its 500 years). Unlike
  `aal_standard_error` (`sd / sqrt(years)`), it carries the logic-tree
  sampling as well as the event sampling, and it is usually the larger.

## How much the sample moves the answer

Ten thousand years is a large sample for a hurricane lane and a modest
one for European earthquakes: most years bring no damaging shaking to a
given place, and much of the average comes from a few rare, strong events.
To state how far a single run can sit from the long-run answer, the same
five places (two in Istanbul, one each in Naples, Athens and Lisbon, all at
$10,000,000, the default building class) were run over six independent
event sets at the lane's settings, each with its own event-sampling seed
and its own branch-sampling seed. The mean of the six, with the
coefficient of variation (CV) across them in brackets, which reads as the
one-sigma sampling error of one run:

| Case | AAL | 1 in 100 AEP | 1 in 250 AEP | 1 in 475 AEP |
|---|---|---|---|---|
| Istanbul, 2 places, $20,000,000 | 47,575 (0.18) | 409,432 (0.43) | 3,714,026 (0.30) | 8,602,197 (0.18) |
| Naples, $10,000,000 | 4,348 (0.34) | 0 | 19,300 (0.60) | 132,093 (0.58) |
| Athens, $10,000,000 | 3,573 (0.31) | 4,569 (0.44) | 77,941 (0.47) | 250,440 (0.33) |
| Lisbon, $10,000,000 | 1,269 (0.62) | 0 | 0 | 10,404 (1.01) |
| All five, $50,000,000 | 56,765 (0.15) | 827,744 (0.28) | 4,904,190 (0.18) | 9,097,184 (0.11) |

So: a portfolio spread over several cities is pinned to about 15% at the
average and 10 to 30% in the tail; one place in a moderate-hazard city is
pinned to about a third at the average and worse in the tail; one place in
a low-hazard city (Lisbon) is not pinned at all beyond its order of
magnitude. Every result says which of these it is: `sampling_noise` states
the run's own standard error and the range of its 1-in-250 across its
blocks, and `rare_years_dominate` says when most of the average comes from
years rarer than 1 in 250.

What else was measured, on the same five places, before fixing the
settings:

- **Sampling each place's damage ratio** from ESRM20's beta spread instead
  of using the mean: the same AAL, but the five-place 1-in-250 CV rose from
  0.18 to 0.29 and Naples' from 0.60 to 1.28, because one draw per place
  and event makes a place's tail two-humped. The lane uses the mean.
- **100 branches of 100 years** instead of 20 of 500: no clear gain over
  six runs (five-place AAL CV 0.15 either way) and 10 to 17% slower at the
  worst case, which then passed 300 s.
- **Where the noise comes from:** event seeds alone (branches fixed) moved
  the five-place AAL with a CV of 0.16 over four sets; branch seeds alone
  (events fixed) with 0.22. The two are comparable, so halving the noise
  needs about four times the years and the branches together, and about
  four times the run time.
- **Stratified (Latin hypercube) branch sampling** would cut the branch
  part, but the engine refuses it for event-based risk that pools its
  branches.

**Against ESRM20's own results.** ESRM20 publishes average annual loss
ratios by region for its whole building stock: Istanbul 2.79 per mille,
Campania (Naples) 0.74, Attica (Athens) 0.85, Lisboa 0.16. The lane's
city-centre places in one moderate-code concrete class average 2.38, 0.43,
0.36 and 0.13 per mille over the six sets: the same order and the same
ranking, lower where the regional stock holds weaker masonry and
higher-hazard hinterland.

## Assumptions and warnings

Every result lists its assumptions in plain sentences: ground-up only;
shaking only (no fire following, liquefaction, landslide or tsunami); a
synthetic event set, not history and not a forecast; one building class at
every place; building replacement cost only (no contents, no business
interruption); site conditions from the nearest site-model cell; magnitude
5 and above, out to the reach above; no spatial correlation of shaking
beyond each earthquake's shared term, so a clustered schedule's tail may be
understated; no demand surge; the ground-motion logic tree with one
parameter name corrected (below); and mean damage ratios, with the spread
between buildings of one class not sampled, so one building's own tail
would be wider.

Warnings, each with an `id`:

- `sampling_noise`: the AAL's standard error (the larger of the two
  estimates) and the range of the 1-in-250 annual loss across the run's
  blocks.
- `rare_years_dominate`: at least half the AAL comes from years rarer than
  1 in 250, so the average rests on a few large earthquakes.
- `single_event_dominates`: one earthquake makes up at least half of a
  place's AAL.
- `unmodeled_points`, `return_periods_withheld`, `zero_loss`.

## What we changed in ESRM20, and why

One line. ESRM20's ground-motion logic tree spells the BC Hydro distance
adjustment `theta_6_adjustment`. Engines up to at least 3.16 ignored the
unknown keyword, so ESRM20's fast and slow subduction attenuation branches
ran as the central one; OpenQuake 3.26.2 rejects the file. The ESHM20
hazard model's own logic tree, and every engine release, spell it
`theta6_adjustment`, and the runner writes that spelling into its copy.
Nothing else in the model is changed: the engine is the lab's existing
OpenQuake 3.26.2, and every input file is pinned by sha256 at ESRM20
commit `b2368bee`.

## Worked numbers

The lane's fixtures (default class, $10,000,000 a place, stored runs under
model version `openquake-3.26.2-esrm20-r1`), AEP:

| Case | AAL | Per mille | 1 in 100 | 1 in 250 | 1 in 475 | 1 in 1,000 |
|---|---|---|---|---|---|---|
| Istanbul, 2 places (`lab-oq-esrm:2a0b5a659b153055`) | 55,960 | 2.80 | 718,862 | 4,185,914 | 8,356,273 | 14,004,033 |
| Naples (`lab-oq-esrm:60f452cc0baecdc3`) | 4,540 | 0.45 | 3,235 | 135,561 | 518,235 | 1,278,499 |
| Athens (`lab-oq-esrm:407115e8900cea7c`) | 13,218 | 1.32 | 65,318 | 567,662 | 1,563,442 | 5,158,786 |
| Lisbon (`lab-oq-esrm:7a35342b01106677`) | 1,130 | 0.11 | 0 | 6,746 | 63,481 | 165,236 |

In Istanbul the largest events are magnitude 7.25 to 8.05 ruptures of the
North Anatolian fault under the Sea of Marmara (ESHM20 source `TRCF045`),
each costing both places nearly all their value; 72% of the average comes
from years rarer than 1 in 250, and the run's own standard error on the
average is 29%.

The site cell matters. The ground-motion model for shallow crust (Kotha et
al. 2020) amplifies by the cell's slope and geology, so a place on young
sediments shakes harder than one on old rock nearby: the Athens place above
sits on a Pleistocene cell, and a point 400 m away on a Cretaceous cell
had an AAL 1.3 to 2.1 times lower under the same three event sets.
`per_point` reports the Vs30, slope and geology each place took. Places
far apart do not disturb each other: run together, the five places give
Naples, Athens and Lisbon the same AAL to the dollar as their own runs.

A run takes about 90 to 110 seconds for a few places and under 300 seconds
for 500 places spread over the most active parts of the model, on the
lab's eight-core model machine.

## Replaying a result

The run id is a content address over the spec, the model version and the
two input pins. The same places and class are the same id, answered from
the store. The engine's worker count never changes a byte of the result.
