Oasis Tech Pythonx Instructions Python

User Manual: Pdf

Open the PDF directly: View PDF PDF.
Page Count: 1

DownloadOasis Tech  - Pythonx Instructions Python
Open PDF In BrowserView PDF
Oasis technical test – Python
Your task is to build a Python command line utility for Linux that invokes a simple mathematical
model of hurricane losses and returns the expected annual economic loss. We are looking for a
clear, well-structured solution, with logging, testing, input checking and error handling as you deem
necessary. You should consider the performance of the model, and what techniques can be used to
speed up the calculations especially when the number of simulations is large (>> 10^6). The
solution should be delivered as a GitHub repository with instructions on how to build and run the
utility. You are free to use any development tools or frameworks.
In this test example, a model of the economic losses due to a hurricane landfall is assumed to be as
follows. (Note that the full models than run in Oasis are extremely complex, with very large input
data sets and strict requirements on run-time and reliability.)
1. Assign the annual rate at which hurricanes make landfall in Florida, assuming a Poisson
distribution.
2. Assign a lognormal distribution that describes the probability of economic loss of a
hurricane that makes landfall in Florida.
3. Assign the annual rate at which hurricanes make landfall in Gulf states, assuming a Poisson
distribution.
4. Assign a lognormal distribution that describes the economic loss of a hurricanes that makes
landfall in the Gulf states.
5. Use a Monte-Carlo simulation to estimate the mean loss per year using the following
algorithm:
Total loss = 0
For each simulation year
Simulation loss = 0
Sample number of Florida events
For each Florida event
Sample a Florida loss and add it to the simulation loss
Sample number of Gulf events
For each Gulf event
Sample a Gulf loss and add it to the simulation loss
Add the simulation loss to the total loss
Mean loss = total loss / number of simulation years
The following command structure should be implemented:
usage: gethurricaneloss [options] florida_landfall_rate florida_mean florida_stddev
gulf_landfall_rate gulf_mean gulf_stddev
Calculates the average annual hurricane loss in $Billions for a simple hurricane model. The model
is parameterized by:
florida_landfall_rate – The annual rate of landfalling hurricanes in Florida
florida_mean, florida_stddev – The LogNormal parameters that describe the economic loss
of a landfalling hurricane in Florida.
gulf_landfall_rate - The annual rate of landfalling hurricanes in the Gulf states
gulf_mean, gulf_stddev - The LogNormal parameters that describe the economic loss of a
options:
-n, --num_monte_carlo_samples
Number of samples (i.e. simulation years) to run



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.7
Linearized                      : No
Warning                         : Info object (31 0 obj) not found at 355428
EXIF Metadata provided by EXIF.tools

Navigation menu