OasisLMF / ktools

In-memory simulation kernel for loss modelling.
BSD 3-Clause "New" or "Revised" License
29 stars 18 forks source link

Introduce components for Post Loss Amplification #351

Closed hchagani-oasislmf closed 1 year ago

hchagani-oasislmf commented 1 year ago

Introduce components for Post Loss Amplification

Major events can give rise to inflated costs as a result of the shortage of labour, materials, and other factors. Conversely, in some cases the costs incurred may be lower as the main expenses may be shared amongst the sites that are hit in the same area. To account for this, the ground up losses from gulpy/gulcalc are multiplied by post loss amplification factors by a new component placalc.

Five components are introduced:

The file static/lossfactors.bin maps event ID-amplification ID pairs with post loss amplification factors, and is supplied by the model provider. The components amplificationstobin and amplificationstocsv convert this file between csv and binary formats. The binary format for this file is defined as follows:

This is then followed by all the amplification ID-loss factor pairs associated with the event ID. Then the next event ID is given.

The file input/amplifications.bin maps item IDs to amplification IDs. Keys with amplification IDs are generated by the OasisLMF (MDK) key server according to the strategy given by the model provider. These are used to generate the amplifications file. The components amplificationstobin and amplificationstocsv convert this file between csv and binary formats. The binary format for this file is defined as follows:

The component placalc uses the files static/lossfactors.bin and input/amplifications.bin to assign loss factors to event ID-item ID pairs from gulpy/gulcalc. Losses are then multiplied by their relevant factors. The output format is identical to that of gulpy/gulcalc: event ID; item ID; sample ID (sidx); and loss.