gig: Create a function to generate generalised inverse gaussian...

Description Usage Arguments Details Value Examples

View source: R/dist_gig.R

Description

A function to create "family" objects is returned. The "family" object is to be used in the family argument in ruin_prob_ls. It contains all essential information to calculate the ruin probability, e.g. calculation of Θ_{f,k} for various functions f.

Usage

1
gig(M2 = 45, M3 = 32)

Arguments

M2

Numerical of length 1.

M3

Numerical of length 1.

Details

Appendix A3 in article "Finite-time ruin probabilities using bivariate Laguerre series" is used. The sum to infinity terms in (A18), (A19) are truncated at M2 and M3 (M2>M3).

Ideally, large M2 and M3 should be used. However, due to limit in numerical precision in R (long double in C, i.e. 64bit) calculation of Θ_{f,k} for large k is unstable. As a result, M2 and M3 has to be moderate.

Computer programs with high precision arithmetic built-in (e.g. Mathematica or Matlab) should be used for reliable results.

Value

A function to create a family object with parameters:

See https://en.wikipedia.org/wiki/Generalized_inverse_Gaussian_distribution. alpha is p in the page.

Examples

1
2
3
4
5
6
7
8
9
library(pruin)

a <- 5
b <- 0.02
alpha <- 2.5

family <- gig()(a=a,b=b,alpha=alpha) # a list object

family[c("name","par","mean")] # extract some information

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