set.seed(0) x = rnorm(1000) # Assume bulk model parameterisation by default fit = fnormgpd(x) xx = seq(-5, 5, 0.01) hist(x, breaks = 100, freq = FALSE) lines(xx, dnormgpd(xx, fit\$nmean, fit\$nsd, fit\$u, fit\$sigma, fit\$xi), col="blue",lwd=2) abline(v = fit\$u, col="blue") # Change to parameterised approach fit2 = fnormgpd(x, phiu=FALSE) lines(xx, dnormgpd(xx, fit2\$nmean, fit2\$nsd, fit2\$u, fit2\$sigma, fit2\$xi, fit2\$phiu), col="red",lwd=2) abline(v = fit2\$u, col="red") # Add continuity constraint fit3 = fnormgpdcon(x) lines(xx, dnormgpdcon(xx, fit3\$nmean, fit3\$nsd, fit3\$u, fit3\$xi, fit3\$phiu), col="green",lwd=2) abline(v = fit3\$u, col="green") help(evmix) # Nonparametric bulk fit fit4 = fkdengpd(x) lines(xx, dkdengpd(xx, x, fit4\$lambda, fit4\$u, fit4\$sigmau, fit4\$xi, fit4\$phiu), col="purple",lwd=2) abline(v = fit4\$u, col="purple") # Hybrid Pareto fit5 = fhpd(x) lines(xx, dhpd(xx, fit5\$nmean, fit5\$nsd, fit5\$xi), col="orange",lwd=2) abline(v = fit5\$u, col="orange") # Usual model diagnostics default to focus on upper tail evmix.diag(fit) # Can see entire fit evmix.diag(fit,upperfocus=FALSE) # Usual MRL and threshold stability plots, with some extra features par(mfrow=c(1,1)) mrlplot(x, try.thresh=c(0.5,1,1.5)) data(FtCoPrec,package="extRemes") mrlplot(FtCoPrec[,5], try.thresh=c(0.395, 0.8, 1.2))