Learn R Programming

OpVaR (version 1.2)

buildSplicedSevdist: Building a sevdist object with a spliced distribution

Description

Building a sevdist object with a spliced distribution

Usage

buildSplicedSevdist(body.distr, body.param, tail.distr, tail.param, thresh, weight)

Arguments

body.distr

A string giving the name of the body distribution.

body.param

Vector of the parameters for the given body distribution.

tail.distr

A string giving the name of the tail distribution.

Distributions "lgamma", "weibull", "gpd", "gh" are recognised.

tail.param

Vector of the parameters for the given tail distribution.

thresh

Numeric value giving the threshold of the distribution, the severity follows a truncated 'body.distr' distribution below the threshold and a truncated 'tail.distr' distribution above the threshold.

weight

Numeric value in [0,1] giving the probability that the severity distribution takes values below the threshold.

Details

A sevdist object with type 'spliced' is generated, i.e. the severity has distribution 'body.distr' in the body with parameters given by 'body.param' and distribution 'tail.distr' in the tail with parameters given by 'tail.param'.

The density \(f(x)\) for a spliced distribution with threshold \(\tau\), weights \(w\), body distribution with density \(g\) and cumulative distribution function \(G\) and tail distribution with density \(h\) and cumulative distribution function \(H\) is given as below:

If \(x\le \tau\): \(f(x) = w* g(x)/G(\tau)\)

If \(x>\tau\): \(f(x) = (1-w)* h(x)/(1-H(\tau))\)

See Also

Other sevdist objects with type 'plain' and 'mixing' are built via buildPlainSevdist and buildMixingSevdist.

Examples

Run this code
# NOT RUN {
  # Spliced distributed severity with gamma distributed body with shape = 1.23, rate = 0.12 
  # and GPD distributed tail with shape = 716 and scale = 0.1 and threshold = 2000. 
  # The weight for the body is 0.8.
  
  sevdist1 = buildSplicedSevdist("gamma", c(2.5, 0.012), "gpd", c(2000, 716, 0.1), 2000, 0.8)
  plot(sevdist1)
# }

Run the code above in your browser using DataLab