Create a YLT from ELT via monte carlo simulation
create_ylt(dt, sims, ann_rate, event_id, expval, mu)
dt | a data.table with modified ELT |
---|---|
sims | number of years to simulate |
ann_rate | event frequency |
event_id | unique event identifier |
expval | total amount exposed |
mu | mean event loss |
a tidy data.table with Loss, Year and ID. Where a year simulated with zero events will show as "none"
create_ylt(create_elt(eltr::example_elt, ann_rate="rate", mu="mean", sdev_i = "sdevi" , sdev_c = "sdevc", expval="exp"), sims=10,ann_rate = "rate" ,event_id = "id",expval = "exp",mu ="mean")#> Warning: NAs produced#> Year Loss Event #> 1: 1 0.000000e+00 None #> 2: 2 1.000000e+02 4 #> 3: 2 2.410798e-04 6 #> 4: 3 4.194317e+01 6 #> 5: 4 0.000000e+00 None #> 6: 5 0.000000e+00 None #> 7: 6 7.145758e+02 5 #> 8: 7 2.946097e+01 3 #> 9: 8 0.000000e+00 None #> 10: 9 8.461838e-15 6 #> 11: 9 3.057681e+02 3 #> 12: 10 3.709884e-02 6 #> 13: 10 1.779130e+02 3