Learn R Programming

OpVaR (version 1.2)

fitSplicedBestFit: Fitting a spliced distribution over a given data set

Description

A spliced distribution is fitted based on given loss data and required distributions for the body and the tail using a best-fit method. The function returns a sevdist object with type "spliced".

Usage

fitSplicedBestFit(cell, body, tail, thresh0 = 0.7, thresh.max = 0.98)

Arguments

cell

List containing the loss data in cell$Loss.

body

Character string giving the name of the distribution in the body. Can be chosen between "gamma", "lnorm", "weibull" or "erlang".

tail

Character string giving the name of the distribution in the tail. Can be chosen between "gpd", "gamma", "lnorm", "weibull" or "gh".

thresh0

Initial value for the quantile of the threshold between body and tail

thresh.max

Terminal value for the quantile of the threshold between body and tail

Details

Starting with a spliced distribution with threshold given by the quantile thresh0, the respective parameters of the given body and tail distribution are fitted, as well as the weights of both parts. A list of possible thresholds is given by all loss values between all quantiles between thresh0 and thresh.max. For each of these thresholds a spliced distribution will be fitted and then the best fitting threshold with the corresponding parameters will be chosen with a Kolmogorow-Smirnov test and the result is returned in a sevdist object with type "spliced".

See Also

fitSplicedPar, fitThreshold, fitSpliced

Examples

Run this code
# NOT RUN {
    data(lossdat)
    
# }
# NOT RUN {
    param<-fitSplicedBestFit(lossdat[[1]], "lnorm", "gpd")
    param[[1]] ## Parameters of the body distribution
    param[[2]] ## Parameters of the tail distribution
    
# }
# NOT RUN {
  
# }

Run the code above in your browser using DataLab