# NOT RUN {
gep <- vec2par(c(2, 1.5, 3), type="gep")
lmrA <- lmomgep(gep, byqua=TRUE); print(lmrA)
lmrB <- lmomgep(gep, byqua=FALSE); print(lmrB)
# Because the L-moments of the Generalized Exponential Poisson are computed
# strictly from the expectations of the order statistic extrema, lets us evaluate
# by theoretical integration of the quantile function and simulation:
set.seed(10); gep <- vec2par(c(2, 1.5, 3), type="gep")
lmr <- lmomgep(gep, byqua=FALSE)
E33a <- (lmr$lambdas[3] + 3*lmr$lambdas[2] + 2*lmr$lambdas[1])/2 # 2.130797
E33b <- expect.max.ostat(3, para=gep, qua=quagep) # 2.137250
E33c <- mean(replicate(20000, max(quagep(runif(3), gep)))) # 2.140226
# See how the E[X_{3:3}] by the formula shown in this documentation results in
# a value that is about 0.007 too small. Now this might now seem large but it
# is a difference. Try gep <- list(para=c(2, 1.5, 13), type="gep") or
# gep <- list(para=c(2, .08, 21), type="gep"), which fails on byqua=TRUE
# }
Run the code above in your browser using DataLab