-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHistoricalDamages.Rmd
46 lines (40 loc) · 1.5 KB
/
HistoricalDamages.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
---
title: "Historical hurricane damage data from ICAT"
output: html_document
editor_options:
chunk_output_type: console
---
Data from https://www.icatdamageestimator.com/faq#4q
Could update with https://www.reinsurancene.ws/insurance-industry-losses-events-data/
Read in the data only through 2017
```{r}
PerLandfall.df <- readr::read_csv(here::here("data", "stormData.csv")) |>
dplyr::rename(Name = `STORM NAME`,
LandfallDate = `LANDFALL DATE`,
DamageRank = `DAMAGE RANK`,
CurrentDamage2022 = `CURRENT DAMAGE ($ 2022)`,
BaseDamageDollars = `BASE DAMAGE ($)`,
LandfallState = `LANDFALL STATE`,
Category = `CATEGORY`,
WindsAtLandfall_mph = `WINDS(MPH)`)
PerLandfall.df <- PerLandfall.df |>
dplyr::mutate(Date = lubridate::parse_date_time(LandfallDate,
orders = 'mdy'),
Year = lubridate::year(Date),
YearName = paste0(Year, Name)) |>
dplyr::filter(Year >= 1987)
```
Insured damages (losses) are .5 of the total economic damages.
```{r}
PerStorm.df <- PerLandfall.df |>
dplyr::mutate(InsuredLosses2022 = .5 * CurrentDamage2022) |>
dplyr::group_by(YearName) |>
dplyr::summarise(Year = dplyr::last(Year),
Name = dplyr::last(Name),
PerStormInsuredLosses2022 = sum(InsuredLosses2022))
```
Tranches
```{r}
Z <- PerStorm.df$PerStormInsuredLosses2022
quantile(Z, probs = seq(0, 1, 1/7))
```