Comments (4)
There is also a reason for having two methods. One is just an ordering of the values with a linear interpolation between these values Impact.calc_freq_curve
. The other is a fit of a curve due to the potentially very small number of values Impact.local_exceedance_imp
. Thus, I think that there remains a good reason to have two methods. I would make maybe one single method as a util
function that can either interpolate or fit. Then, as @peanutfun suggested, one can use it in the classes and flip the axes if needed.
from climada_python.
We can adapt the Impact.calc_freq_curve
to become a "kernel" for exceedance frequency curves that can be applied to Impact.at_event
, an impact time series of a specific exposure point, or a hazard intensity time series of a specific centroid. This function can then be applied to the appropriate data in suitable wrapper functions. It can even be adapted to "flip" the axes, and return the return period for specific values of the time series (i.e., the inverse problem that it currently solves)
from climada_python.
I personally find the return period calculations rather obscure to the user, so I would welcome improvements.
Personally, in addition to the above points, I would consider three options and leave it to the user to specify which one (with a good default of course):
- The interpolated case, albeit with a clear definition in which space (e.g. log-log) it is performed (or the space being an additional optional argument).
- The non-interpolated case.
- The fitting of an extreme value distribution.
In my view the default should probably be (1) or (3).
In addition, I would suggest the following:
- If the user asks for a return period beyond the maximum one available in cases 1 and 2 above, a warning is raised and np.nan is returned, rather than returning the maximum value silently. Perhaps also in case (3) if the return period is way beyond the max available empirically, although extreme value distributions are designed for extrapolation...
- The uncertainty of the estimate should ideally be optionally provided.
- In case of multiple identical values, these should be grouped and their frequencies summed first.
Some of these points we've implemented on our end already, so if you undertake a PR, happy to contribute.
from climada_python.
(Just to be clear: when I write three options I mean as an input parameter to the function(s) rather than separate functions at the top-level code API - which doesn't prevent the options to be split into individual private functions)
from climada_python.
Related Issues (20)
- No module named 'shapely.io' in CLIMADA app HOT 3
- AttributeError: Stamen, while importing the ImpactCalc method HOT 2
- Ensure proper handling of `event_name` attribute in `Hazard` and `Impact` HOT 1
- Switch back to (Ana)Conda HOT 9
- Trouble running LitPop.from_shape_and_countries HOT 2
- Rewrite `TestRPmatrix::test_local_exceedance_imp_pass` to not rely on loading data HOT 3
- Tropical Cyclone Image Artifact Removal/Smoothing HOT 6
- URL to IBTRACKs official documentation is no longer valid HOT 1
- Loading TCTracks with `from_ibtracs_netcdf` does not properly close the filestream HOT 1
- Python module docs are missing members of `HazardIO` and `HazardPlot` HOT 2
- Applying a measure throws an error if impact function id is not of type int HOT 2
- Fiona error . The EPSG code is unknown no such table: metadata HOT 2
- LitPop.from_population() fails to download the nighlight nasa files
- Perform Risk Screening without impact function HOT 2
- installing 4.0.1 HOT 2
- possible bug or problem on climada.hazard.tc_tracks_synth. calc_perturbed_trajectories when parallel processing is active HOT 4
- Possible bug in impact calculation HOT 17
- Investigate warnings raised by TCTracks.equal_timestep() for some IBTraCS tracks HOT 3
- Hazard.intensity in CSR format and not CSC format HOT 1
- Cannot read hdf5 dataset HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from climada_python.