Determine probability of reporting under a Poisson arrival Process
Source:R/prob_report.R
prob_report.RdDetermines the probability that claims occuring under a Poisson process with
arrival intensity expo and reporting delay distribution dist during the
time between t_min and t_max are reported between tau_min and
tau_max.
Usage
prob_report(
dist,
intervals,
expo = NULL,
with_params = list(),
.tolerance = .Machine$double.eps^0.5,
.max_iter = 100L,
.try_compile = TRUE
)Arguments
- dist
A reporting delay Distribution, or a compiled interval probability function.
- intervals
A data frame with columns
xmin,xmax,tmin,tmax. Claims occur within[xmin, xmax]and be reported within[tmin, tmax].- expo
Poisson intensity. If given, must be a vectorised function that yields the intensity of the claim arrival process at a specified time.
expo = NULLis equivalent to a constant intensity function.expois only relevant up to a multiplicative constant.- with_params
Parameters of
distto use. Can be a parameter set with different values for each interval. Ifdistis a compiled interval probability function,with_paramscan be a matrix instead.- .tolerance
Absolute element-wise tolerance.
- .max_iter
Maximum number of iterations. The number of integration intervals will be at most
length(lower) * .max_iter. Therefor the maximum number of function evaluations per integration interval will be15 * .max_iter.- .try_compile
Try compiling the distributions probability function to speed up integration?
Details
The reporting probability is given by
P(x + d in [tmin, tmax] | x in [xmin, xmax]) = E(P(x + d in [tmin, tmax] | x) | x in [xmin, xmax]) / P(x in [xmin, xmax]) = int_[xmin, xmax] expo(x) P(x + d in [tmin, tmax]) dx = int_[xmin, xmax] expo(x) P(d in [tmin - x, tmax - x]) dx / int_[xmin, xmax] expo(x) dx
prob_report uses integrate_gk() to compute the two integrals.
Examples
dist <- dist_exponential()
ints <- data.frame(
xmin = 0,
xmax = 1,
tmin = seq_len(10) - 1.0,
tmax = seq_len(10)
)
params <- list(rate = rep(c(1, 0.5), each = 5))
prob_report(dist, ints, with_params = params)
#> [1] 0.367879441 0.399576401 0.146995943 0.054076785 0.019893738 0.041904709
#> [7] 0.025416491 0.015415881 0.009350204 0.005671186