Fit spliced distribution of a mixed Erlang distribution and a Generalised Pareto Distribution (GPD). The parameters of the GPD are determined using the POT-MLE approach.
const: The probability of the quantile where the ME distribution will be spliced with the GPD distribution. Default is NULL meaning the input from tsplice is used.
tsplice: The point where the ME distribution will be spliced with the GPD distribution. Default is NULL meaning the input from const is used.
M: Initial number of Erlang mixtures, default is 3. This number can change when determining an optimal mixed Erlang fit using an information criterion.
s: Vector of spread factors for the EM algorithm, default is 1:10. We loop over these factors when determining an optimal mixed Erlang fit using an information criterion, see Verbelen et al. (2016).
trunclower: Lower truncation point. Default is 0.
ncores: Number of cores to use when determining an optimal mixed Erlang fit using an information criterion. When NULL (default), max(nc-1,1) cores are used where nc is the number of cores as determined by detectCores.
criterium: Information criterion used to select the number of components of the ME fit and s. One of "AIC" and "BIC" (default).
reduceM: Logical indicating if M should be reduced based on the information criterion, default is TRUE.
eps: Covergence threshold used in the EM algorithm (ME part). Default is 10^(-3).
beta_tol: Threshold for the mixing weights below which the corresponding shape parameter vector is considered neglectable (ME part). Default is 10^(-5).
maxiter: Maximum number of iterations in a single EM algorithm execution (ME part). Default is Inf meaning no maximum number of iterations.
Details
See Reynkens et al. (2017), Section 4.3.1 of Albrecher et al. (2017) and Verbelen et al. (2015) for details. The code follows the notation of the latter. Initial values follow from Verbelen et al. (2016).
Returns
A SpliceFit object.
References
Albrecher, H., Beirlant, J. and Teugels, J. (2017). Reinsurance: Actuarial and Statistical Aspects, Wiley, Chichester.
Reynkens, T., Verbelen, R., Beirlant, J. and Antonio, K. (2017). "Modelling Censored Losses Using Splicing: a Global Fit Strategy With Mixed Erlang and Extreme Value Distributions". Insurance: Mathematics and Economics, 77, 65--77.
Verbelen, R., Gong, L., Antonio, K., Badescu, A. and Lin, S. (2015). "Fitting Mixtures of Erlangs to Censored and Truncated Data Using the EM Algorithm." Astin Bulletin, 45, 729--758.
Verbelen, R., Antonio, K. and Claeskens, G. (2016). "Multivariate Mixtures of Erlangs for Density Estimation Under Censoring." Lifetime Data Analysis, 22, 429--455.
Author(s)
Tom Reynkens with R code from Roel Verbelen for fitting the mixed Erlang distribution.
## Not run:# GPD random sampleX <- rgpd(1000, gamma =0.5, sigma =2)# Splice ME and GPDsplicefit <- SpliceFitGPD(X,0.6)x <- seq(0,20,0.01)# Plot of spliced CDFplot(x, pSplice(x, splicefit), type="l", xlab="x", ylab="F(x)")# Plot of spliced PDFplot(x, dSplice(x, splicefit), type="l", xlab="x", ylab="f(x)")# Fitted survival function and empirical survival function SpliceECDF(x, X, splicefit)# Log-log plot with empirical survival function and fitted survival functionSpliceLL(x, X, splicefit)# PP-plot of empirical survival function and fitted survival functionSplicePP(X, splicefit)# PP-plot of empirical survival function and # fitted survival function with log-scalesSplicePP(X, splicefit, log=TRUE)# Splicing QQ-plotSpliceQQ(X, splicefit)## End(Not run)