Running 'betaint-tests.R'
  Running 'dpqr-tests.R'
Running the tests in 'tests/dpqr-tests.R' failed.
Complete output:
  > ### actuar: Actuarial Functions and Heavy Tailed Distributions
  > ###
  > ### Tests of functions for continuous and discrete probability
  > ### distributions.
  > ###
  > ### Despite the name of the file, the tests are for [dpqrm,lev]<dist>
  > ### functions (for continuous distributions):
  > ###
  > ###   d<dist>: density or probability mass
  > ###   p<dist>: cumulative distribution
  > ###   q<dist>: quantile
  > ###   r<dist>: random number generation
  > ###   m<dist>: moment
  > ###   lev<dist>: limited moment
  > ###
  > ### Distributions are classified and sorted as in appendix A and
  > ### appendix B of the 'distributions' package vignette.
  > ###
  > ### Inspired by (and some parts taken from) `tests/d-p-q-r-tests.R` in
  > ### R sources.
  > ###
  > ### AUTHOR: Vincent Goulet <vincent.goulet@act.ulaval.ca> with
  > ###         indirect help from the R Core Team
  > 
  > ## Load the package
  > library(actuar)
  
  Attaching package: 'actuar'
  
  The following objects are masked from 'package:stats':
  
      sd, var
  
  The following object is masked from 'package:grDevices':
  
      cm
  
  > library(expint)                         # for gammainc
  > 
  > ## Define a "local" version of the otherwise non-exported function
  > ## 'betaint'.
  > betaint <- actuar:::betaint
  > 
  > ## No warnings, unless explicitly asserted via tools::assertWarning.
  > options(warn = 2)
  > assertWarning <- tools::assertWarning
  > 
  > ## Special values and utilities. Taken from `tests/d-p-q-r-tests.R`.
  > Meps <- .Machine$double.eps
  > xMax <- .Machine$double.xmax
  > xMin <- .Machine$double.xmin
  > All.eq <- function(x, y)
  + {
  +     all.equal.numeric(x, y, tolerance = 64 * .Machine$double.eps,
  +                       scale = max(0, mean(abs(x), na.rm = TRUE)))
  + }
  > 
  > if(!interactive())
  +     set.seed(123)
  > 
  > ###
  > ### CONTINUOUS DISTRIBUTIONS
  > ###
  > 
  > ##
  > ## FELLER-PARETO AND PARETO II, III, IV DISTRIBUTIONS
  > ##
  > 
  > ## When reasonable, we also test consistency with the special cases
  > ## min = 0:
  > ##
  > ##   Feller-Pareto -> Transformated beta
  > ##   Pareto IV     -> Burr
  > ##   Pareto III    -> Loglogistic
  > ##   Pareto II     -> Pareto
  > 
  > ## Density: first check that functions return 0 when scale = Inf, and
  > ## when x = scale = Inf.
  > stopifnot(exprs = {
  +     dfpareto(c(42, Inf), min = 1, shape1 = 2, shape2 = 3, shape3 = 4, scale = Inf) == c(0, 0)
  +     dpareto4(c(42, Inf), min = 1, shape1 = 2, shape2 = 3, scale = Inf) == c(0, 0)
  +     dpareto3(c(42, Inf), min = 1, shape  = 3, scale = Inf) == c(0, 0)
  +     dpareto2(c(42, Inf), min = 1, shape  = 2, scale = Inf) == c(0, 0)
  + })
  > 
  > ## Next test density functions for an array of standard values.
  > nshpar <- 3                     # (maximum) number of shape parameters
  > min <- round(rnorm(30, 2), 2)
  > shpar <- replicate(30, rlnorm(nshpar, 2), simplify = FALSE)
  > scpar <- rlnorm(30, 2)          # scale parameters
  > for (i in seq_along(min))
  + {
  +     m <- min[i]
  +     a <- shpar[[c(i, 1)]]; g <- shpar[[c(i, 2)]]; t <- shpar[[c(i, 3)]]
  +     Be <- beta(a, t)
  +     for (s in scpar)
  +     {
  +         x <- rfpareto(100, min = m, shape1 = a, shape2 = g, shape3 = t, scale = s)
  +         y <- (x - m)/s
  +         u <- 1/(1 + y^(-g))
  +         stopifnot(exprs = {
  +             all.equal(d1 <- dfpareto(x, min = m,
  +                                      shape1 = a, shape2 = g, shape3 = t,
  +                                      scale = s),
  +                       d2 <- dfpareto(y, min = 0,
  +                                      shape1 = a, shape2 = g, shape3 = t,
  +                                      scale = 1)/s,
  +                       tolerance = 1e-10)
  +             all.equal(d2,
  +                       dtrbeta(y,
  +                               shape1 = a, shape2 = g, shape3 = t,
  +                               scale = 1)/s,
  +                       tolerance = 1e-10)
  +             all.equal(d1,
  +                       g * y^(g*t - 1)/(s * Be * (1 + y^g)^(a + t)),
  +                       tolerance = 1e-10)
  +             all.equal(d1,
  +                       g * u^t * (1 - u)^a/((x - m) * Be),
  +                       tolerance = 1e-10)
  +         })
  +         x <- rpareto4(100, min = m, shape1 = a, shape2 = g, scale = s)
  +         y <- (x - m)/s
  +         u <- 1/(1 + y^g)
  +         stopifnot(exprs = {
  +             all.equal(d1 <- dpareto4(x, min = m,
  +                                      shape1 = a, shape2 = g,
  +                                      scale = s),
  +                       d2 <- dpareto4(y, min = 0,
  +                                      shape1 = a, shape2 = g,
  +                                      scale = 1)/s,
  +                       tolerance = 1e-10)
  +             all.equal(d2,
  +                       dburr(y,
  +                             shape1 = a, shape2 = g,
  +                             scale = 1)/s,
  +                       tolerance = 1e-10)
  +             all.equal(d1,
  +                       a * g * y^(g - 1)/(s * (1 + y^g)^(a + 1)),
  +                       tolerance = 1e-10)
  +             all.equal(d1,
  +                       a * g * u^a * (1 - u)/(x - m),
  +                       tolerance = 1e-10)
  +         })
  +         x <- rpareto3(100, min = m, shape = g, scale = s)
  +         y <- (x - m)/s
  +         u <- 1/(1 + y^(-g))
  +         stopifnot(exprs = {
  +             all.equal(d1 <- dpareto3(x, min = m,
  +                                      shape = g,
  +                                      scale = s),
  +                       d2 <- dpareto3(y, min = 0,
  +                                      shape = g,
  +                                      scale = 1)/s,
  +                       tolerance = 1e-10)
  +             all.equal(d2,
  +                       dllogis(y,
  +                               shape = g,
  +                               scale = 1)/s,
  +                       tolerance = 1e-10)
  +             all.equal(d1,
  +                       g * y^(g - 1)/(s * (1 + y^g)^2),
  +                       tolerance = 1e-10)
  +             all.equal(d1,
  +                       g * u * (1 - u)/(x - m),
  +                       tolerance = 1e-10)
  +         })
  +         x <- rpareto2(100, min = m, shape = a, scale = s)
  +         y <- (x - m)/s
  +         u <- 1/(1 + y)
  +         stopifnot(exprs = {
  +             all.equal(d1 <- dpareto2(x, min = m,
  +                                      shape = a,
  +                                      scale = s),
  +                       d2 <- dpareto2(y, min = 0,
  +                                      shape = a,
  +                                      scale = 1)/s,
  +                       tolerance = 1e-10)
  +             all.equal(d2,
  +                       dpareto(y,
  +                               shape = a,
  +                               scale = 1)/s,
  +                       tolerance = 1e-10)
  +             all.equal(d1,
  +                       a/(s * (1 + y)^(a + 1)),
  +                       tolerance = 1e-10)
  +             all.equal(d1,
  +                       a * u^a * (1 - u)/(x - m),
  +                       tolerance = 1e-10)
  +         })
  +     }
  + }
  > 
  > ## Tests on the cumulative distribution function.
  > ##
  > ## Note: when shape1 = shape3 = 1, the underlying beta distribution is
  > ## a uniform. Therefore, pfpareto(x, min, 1, shape2, 1, scale) should
  > ## return the value of u = v/(1 + v), v = ((x - min)/scale)^shape2.
  > ##
  > ## x = 2/Meps = 2^53 (with min = 0, shape2 = scale = 1) is the value
  > ## where the cdf would jump to 1 if we weren't using the trick to
  > ## compute the cdf with pbeta(1 - u, ..., lower = FALSE).
  > scLrg <- 1e300 * c(0.5, 1, 2)
  > m <- rnorm(1)
  > stopifnot(exprs = {
  +     pfpareto(Inf,         min = 10,   1, 2, 3, scale = xMax) == 1
  +     pfpareto(2^53,        min = 0,    1, 1, 1, scale = 1) != 1
  +     pfpareto(2^53 + xMax, min = xMax, 1, 1, 1, scale = 1) != 1
  +     all.equal(pfpareto(xMin + m, min = m, 1, 1, 1, scale = 1), xMin)
  +     all.equal(pfpareto(1e300 + m, min = m,
  +                        shape1 = 3, shape2 = rep(c(1, 2), each = length(scLrg)),
  +                        shape3 = 1,
  +                        scale = scLrg, log = TRUE),
  +               ptrbeta (1e300,
  +                        shape1 = 3, shape2 = rep(c(1, 2), each = length(scLrg)),
  +                        shape3 = 1,
  +                        scale = scLrg, log = TRUE),
  +               c(pbeta(c(2/3, 1/2), 1, 3, lower.tail = TRUE,  log = TRUE),
  +                 pbeta(2/3, 3, 1, lower.tail = FALSE, log = TRUE),
  +                 pbeta(c(4/5, 1/2), 1, 3, lower.tail = TRUE,  log = TRUE),
  +                 pbeta(4/5, 3, 1, lower.tail = FALSE, log = TRUE)))
  + })
  Error in all.equal.numeric(pfpareto(1e+300 + m, min = m, shape1 = 3, shape2 = rep(c(1,  : 
    length(tolerance) == 1L is not TRUE
  Calls: stopifnot ... stopifnot -> all.equal -> all.equal.numeric -> stopifnot
  Execution halted