# NOT RUN {
# Pareto random sample
X <- rpareto(1000, shape = 2)
# Splice ME and Pareto
splicefit <- SpliceFitPareto(X, 0.6)
x <- seq(0, 20, 0.01)
# Plot of spliced CDF
plot(x, pSplice(x, splicefit), type="l", xlab="x", ylab="F(x)")
# Plot of spliced PDF
plot(x, dSplice(x, splicefit), type="l", xlab="x", ylab="f(x)")
p <- seq(0, 1, 0.01)
# Plot of splicing quantiles
plot(p, qSplice(p, splicefit), type="l", xlab="p", ylab="Q(p)")
# Plot of VaR
plot(p, VaR(p, splicefit), type="l", xlab="p", ylab=bquote(VaR[p]))
# Random sample from spliced distribution
x <- rSplice(1000, splicefit)
# }
Run the code above in your browser using DataLab