R Under development (unstable) (2023-08-28 r85029 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ## somewhat arbitray values > library(Renext) Loading required package: evd > set.seed(149) > > lambda1 <- 1.0 > lambda2 <- 1 + 10*rexp(1) > > alpha <- 0.3 > > test <- rep(NA, 100) > > for (i in 1:300) { + + ## Choose more values in the difficult zones + p.test <- c(0.1+0.8*sort(runif(50)), + 0.9+0.05*sort(runif(50)), + 0.95 + 0.05*sort(runif(50))) + + H.test <- - log(1-p.test) + + q.test <- qmixexp2(p.test, + prob1 = alpha, + rate1 = lambda1, + rate2 = lambda2) + + ## the result should be equal to p.test + + p2.test <- pmixexp2(q.test, + prob1 = alpha, + rate1 = lambda1, + rate2 = lambda2) + + test[i] <- max(abs(p2.test - p.test)) + + } > > stopifnot(max(abs(test)) < 1e-8) > > proc.time() user system elapsed 1.43 0.04 1.46