MyNixOS website logo
Description

Utilise Catastrophe Model Event Loss Table Outputs.

Provides a tool to run Monte Carlo simulation of catastrophe model event loss tables, using a Poisson frequency and Beta severity distribution.

eltr

Lifecycle:experimental R buildstatus Codecov testcoverage

The goal of eltr is to help analysis of catastrophe model outputs.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("RandhirBilkhu/eltr")

Example

This is a basic example which shows you how to solve a common problem:

library(eltr)
## load a rawelt file

raw_elt <- eltr::example_elt

raw_elt
#>     id rate  mean sdevi sdevc     exp
#>  1:  1 0.10   500   500   200  100000
#>  2:  2 0.10   200   400   100    5000
#>  3:  3 0.20   300   200   400   40000
#>  4:  4 0.10   100   300   500    4000
#>  5:  5 0.20   500   100   200    2000
#>  6:  6 0.25   200   200   500   50000
#>  7:  7 0.01  1000   500   600  100000
#>  8:  8 0.12   250   300   100    5000
#>  9:  9 0.14  1000   500   200    6000
#> 10: 10 0.00 10000  1000   500 1000000

## paramterise elt

elt <- create_elt(raw_elt, ann_rate="rate", mu="mean", sdev_i = "sdevi" , sdev_c = "sdevc", expval = "exp")

## generate a YLT 

ylt <- create_ylt(elt, sims=10 ,ann_rate = "rate" , event_id = "id", expval = "exp" , mu ="mean")

ylt
#>     Year         Loss Event
#>  1:    1 0.000000e+00  None
#>  2:    2 2.963659e+02     5
#>  3:    3 4.353146e-09     6
#>  4:    4 3.086963e+02     8
#>  5:    4 3.337206e+02     3
#>  6:    4 1.429257e-03     2
#>  7:    5 0.000000e+00  None
#>  8:    6 5.525234e+00     3
#>  9:    6 4.838321e+00     8
#> 10:    6 8.642469e+02     7
#> 11:    7 4.338468e+02     3
#> 12:    7 1.357392e+03     2
#> 13:    7 1.317510e+02     1
#> 14:    8 1.204985e+03     5
#> 15:    8 4.033199e+02     8
#> 16:    9 6.361959e-02     6
#> 17:   10 0.000000e+00  None

### calculate AAL and OEP

ann <-ylt[ ,Loss :=sum(Loss) , by=Year]

ep <- create_oep_curve(ann , y= "Year", z="Loss")

Hurricane icon icon by Icons8

Metadata

Version

0.1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows