oasislmf.computation.data.dummy_model.generate¶
Classes¶
Generate random data for Vulnerability dummy model file. |
|
Generate random data for Events dummy model file. |
|
Generate data for Loss Factors dummy model file. |
|
Generate data for Footprint index dummy model file. |
|
Generate data for Footprint binary dummy model file. |
|
Generate data for Damage Bin Dictionary dummy model file. |
|
Generate data for Occurrence dummy model file. |
|
Generate data for Random Numbers dummy model file. |
|
Generate data for Coverages dummy model Oasis file. |
|
Generate data for Items dummy model Oasis file. |
|
Generate data for Amplifications dummy model Oasis file. |
|
Generate data for Financial Model Programme dummy model Oasis file. |
|
Generate data for Financial Model Policy dummy model Oasis file. |
|
Generate data for Financial Model Profile dummy model Oasis file. |
|
Generate data for Financial Model Cross Reference dummy model Oasis file. |
|
Generate data for Ground Up Losses Summary Cross Reference dummy model Oasis |
|
Generate data for Financial Model Summary Cross Reference dummy model Oasis |
Module Contents¶
- class oasislmf.computation.data.dummy_model.generate.VulnerabilityFile(num_vulnerabilities, num_intensity_bins, num_damage_bins, vulnerability_sparseness, random_seed, directory)[source]¶
Bases:
ModelFile
Generate random data for Vulnerability dummy model file.
This file shows the conditional distributions of damage for each intensity bin and for each vulnerability ID.
- Attributes:
generate_data: Generate Vulnerability dummy model file data.
- class oasislmf.computation.data.dummy_model.generate.EventsFile(num_events, directory)[source]¶
Bases:
ModelFile
Generate random data for Events dummy model file.
This file lists event IDs to be run.
- Attributes:
generate_data: Generate Events dummy model file data.
- class oasislmf.computation.data.dummy_model.generate.LossFactorsFile(num_events, num_amplifications, min_pla_factor, max_pla_factor, random_seed, directory)[source]¶
Bases:
ModelFile
Generate data for Loss Factors dummy model file.
This file maps post loss amplification/reduction loss factors to event ID-amplification ID pairs.
- Attributes:
generate_data: Geenrate Loss Factors dummy model file data. write_file: Write data to Loss Factors dummy model file in binary
format.
- class oasislmf.computation.data.dummy_model.generate.FootprintIdxFile(directory)[source]¶
Bases:
ModelFile
Generate data for Footprint index dummy model file.
The binary footprint file footprint.bin requires the index file footprint.idx.
- Attributes:
write_file: Write data to Footprint index file in binary format.
- write_file(event_id, offset, event_size)[source]¶
Write data to output Footprint index file in binary format.
Overrides method in base class. Converts data to arguments to binary and writes to file. Called by FootprintBinFile.generate_data().
- Args:
event_id (int): event ID. offset (long long): position of data for event ID in generated
Footprint binary file relative to beginning of that file.
- size (long long): size of data corresponding to event ID in
generated Footprint binary file, long long.
- class oasislmf.computation.data.dummy_model.generate.FootprintBinFile(num_events, num_areaperils, areaperils_per_event, num_intensity_bins, intensity_sparseness, no_intensity_uncertainty, random_seed, directory)[source]¶
Bases:
ModelFile
Generate data for Footprint binary dummy model file.
This file shows the intensity of a given event-areaperil combination. The binary footprint file footprint.bin requires the index file footprint.idx.
- Attributes:
generate_data: Generate Footprint binary dummy model file data.
- class oasislmf.computation.data.dummy_model.generate.DamageBinDictFile(num_damage_bins, directory)[source]¶
Bases:
ModelFile
Generate data for Damage Bin Dictionary dummy model file.
This file shows the discretisation of the effective damageability cumulative distribution function.
- Attributes:
generate_data: Generate Damage Bin Dictionary dummy model file data.
- generate_data()[source]¶
Generate Damage Bin Dictionary dummy model file data.
First bin always runs from 0 to 0, i.e. has a midpoint (interpolation) of 0. Last bin always runs from 0 to 0, i.e. has a midpoint (interpolation) of 1.
- Yields:
bin_id (int): damage bin ID. bin_from (float): damage bin lower limit. bin_to (float): damage bin upper limit. interpolation (float): damage bin midpoint. interval_type (int): interval_type (deprecated).
- class oasislmf.computation.data.dummy_model.generate.OccurrenceFile(num_events, num_periods, random_seed, directory, mean, stddev)[source]¶
Bases:
ModelFile
Generate data for Occurrence dummy model file.
This file maps events to periods, which can represent any length of time.
- Attributes:
- get_num_periods_from_truncated_normal_cdf: Get number of periods on
event-by-event basis.
- get_num_periods_from_truncated_normal_cdf: Get number of periods from
truncated normal cumulative distribution function.
set_occ_date_id: Set date of occurrence in ktools format. generate_data: Generate Occurrence dummy model file data.
- get_num_periods_from_truncated_normal_cdf()[source]¶
Get number of periods from truncated normal cumulative distribution function.
Events can occur mupltiple times over multiple periods in the occurrence file. The number of periods per event is modelled by sampling from a truncated normal distribution with mean self.mean and standard deviation self.stddev. The lower tail of the distribution is truncated at 0.5 and the cumulative distribution function is given by:
F(x) = [Phi(g(x)) - Phi(g(a))] / [Phi(g(b)) - Phi(g(a))] g(y) = (y - mean) / standard_deviation Phi(g(y)) = 1/2 * (1 + erf(g(y) / sqrt(2))) a = lower boundary = 0.5, b = upper boundary = infinity
therefore g(b) -> infinity ===> Phi(g(b)) -> 1
- Returns:
- bound_a (int): lower boundary, when converted to an integer gives
number of periods for this event.
- get_num_periods_per_event()[source]¶
Get number of periods on event-by-event basis.
Determines whether sampling of truncated normal cumulative distribution function is required to obtain number of periods for this event.
- Returns:
mean|bound_a (int): Number of periods for this event.
- class oasislmf.computation.data.dummy_model.generate.RandomFile(num_randoms, random_seed, directory)[source]¶
Bases:
ModelFile
Generate data for Random Numbers dummy model file.
This optional file contains random numbers for ground up loss sampling.
- Attributes:
generate_data: Generate Random Numbers dummy model file data.
- class oasislmf.computation.data.dummy_model.generate.CoveragesFile(num_locations, coverages_per_location, random_seed, directory)[source]¶
Bases:
ModelFile
Generate data for Coverages dummy model Oasis file.
This file maps coverage IDs to Total Insured Values.
- Attributes:
generate_data: Generate Coverages dummy model Oasis file data.
- class oasislmf.computation.data.dummy_model.generate.ItemsFile(num_locations, coverages_per_location, num_areaperils, num_vulnerabilities, random_seed, directory)[source]¶
Bases:
ModelFile
Generate data for Items dummy model Oasis file.
This file lists the exposure items for which ground up loss will be sampled.
- Attributes:
generate_data: Generate Items dummy model Oasis file data.
- generate_data()[source]¶
Generate Items dummy model file data.
- Yields:
item (int): item ID. item (int): coverage ID = item ID (1-1 mapping). areaperils[coverage] (int): areaperil ID corresponding to
coverage ID.
- vulnerabilities[coverage] (int): vulnerability ID corresponding to
coverage ID.
location (int): group ID mapped to location ID.
- class oasislmf.computation.data.dummy_model.generate.AmplificationsFile(num_locations, coverages_per_location, num_amplifications, random_seed, directory)[source]¶
Bases:
ModelFile
Generate data for Amplifications dummy model Oasis file.
This file maps exposure items to amplification IDs.
- Attributes:
generate_data: Generate Amplifications dummy model Oasis file data. write_file: Write data to Amplifications dummy model Oasis file in
binary format.
- class oasislmf.computation.data.dummy_model.generate.FMProgrammeFile(num_locations, coverages_per_location, directory)[source]¶
Bases:
FMFile
Generate data for Financial Model Programme dummy model Oasis file.
This file shows the level hierarchy.
- Attributes:
- generate_data: Generate Financial Model Programme dummy model Oasis file
data.
- class oasislmf.computation.data.dummy_model.generate.FMPolicyTCFile(num_locations, coverages_per_location, num_layers, directory)[source]¶
Bases:
FMFile
Generate data for Financial Model Policy dummy model Oasis file.
This file shows the calculation rule (from the Financial Model Policy file) that should be applied to aggregations of loss at a particular level.
- Attributes:
- generate_data: Generate Financial Model Policy dummy model Oasis file
data.
- class oasislmf.computation.data.dummy_model.generate.FMProfileFile(num_layers, directory)[source]¶
Bases:
ModelFile
Generate data for Financial Model Profile dummy model Oasis file.
This file contains the list of calculation rules with profile values used to generate insurance losses.
- Attributes:
- generate_data: Generate Financial Model Profile dummy model Oasis file
data.
- generate_data()[source]¶
Generate Financial Model Profile dummy model file data.
- Yields:
profile_id (int): profile ID. calculation rule ID (int): calculation rule ID (2 or 100). first deductible (float): first deductible (fixed at 0.0). second deductible (float): second deductible (fixed at 0.0). third deductible (float): third deductible (fixed at 0.0). attachment1 (float): attachment point/excess. limit1 (float): limit. first proportional share (float): first proportional
share (0.0 or 0.3).
- second proportional share (float): second proportional
share (fixed at 0.0).
- third proportional share (float): third proportional
share (fixed at 0.0).
- class oasislmf.computation.data.dummy_model.generate.FMXrefFile(num_locations, coverages_per_location, num_layers, directory)[source]¶
Bases:
FMFile
Generate data for Financial Model Cross Reference dummy model Oasis file.
This file shows the mapping between the financial model output ID, and aggregate and layer IDs.
- Attributes:
- generate_data: Generate Financial Model Cross Reference dummy model
Oasis file data.
- class oasislmf.computation.data.dummy_model.generate.GULSummaryXrefFile(num_locations, coverages_per_location, directory)[source]¶
Bases:
FMFile
Generate data for Ground Up Losses Summary Cross Reference dummy model Oasis file.
This file shows how item ground up losses are summed together at various summary levels in summarycalc.
- Attributes:
- generate_data: Generate Ground Up Losses Summary Cross Reference dummy
model Oasis file data.
- class oasislmf.computation.data.dummy_model.generate.FMSummaryXrefFile(num_locations, coverages_per_location, num_layers, directory)[source]¶
Bases:
FMFile
Generate data for Financial Model Summary Cross Reference dummy model Oasis file.
This file shows how insurance losses are summed together at various levels by summarycalc.
- Attributes:
- generate_data: Generate Financial Model Summary Cross Reference dummy
model Oasis file data.