ruin_prob_exp_gs: Calculate the finite ruin probability of Poisson-Exponential...

Description Usage Arguments Details Value Examples

View source: R/main_ILT_exp.R

Description

Note Gaver-Stehfest algorithm is theoretically convergent but practically high precision arithmetic is required. This is not achieved in R as R4.0+ uses "long-double" in C, which is 64bit floating point. As a result, using high n would yield results divergent to infinity. Therefore, small n should be used. Using default arguments, values for different n would be printed along with a plot which assists in determining an appropriate n.

Usage

1
ruin_prob_exp_gs(u, t, c, lambda, beta, ...)

Arguments

u

Numerical. Initial surplus.

t

Numerical. Terminal time.

c

Numerical. Premium rate.

lambda

Numerical. Claim arrival rate ("lambda" parameter of the Poisson process).

beta

Numerical. Rate of the exponential distribution for the severity (mean of the distribution is 1/beta).

...

Optional argument to be passed to fn_gs.

Details

All arguments must be of length 1. For vectorized arguments, either use a loop or apply family, or purrr package.

Net profit condition is assumed, i.e. c-lambda/beta > 0.

Value

Numeric. Vector of length n if try_n is TRUE (Default). Otherwise, length is 1.

Examples

1
2
3
4
5
6
7
library(pruin)

c <- 1
lambda <- 1
beta <- 1.2

ruin_prob_exp_gs(1,1,c,lambda,beta)

haydo1117/pruin documentation built on Feb. 12, 2022, 11:08 a.m.