R Under development (unstable) (2024-08-15 r87022 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 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. > #### doRUnit.R --- Run RUnit tests > ####------------------------------------------------------------------------ > > ### Origianlly follows Gregor Gojanc's example in CRAN package 'gdata' > ### and the corresponding section in the R Wiki: > ### http://wiki.r-project.org/rwiki/doku.php?id=developers:runit > > ### MM: Vastly changed: This should also be "runnable" for *installed* > ## package which has no ./tests/ > ## ----> put the bulk of the code e.g. in ../inst/unitTests/runTests.R : > > if(require("RUnit", quietly=TRUE)) { + + ## --- Setup --- + + wd <- getwd() + pkg <- sub("\\.Rcheck$", '', basename(dirname(wd))) + + library(package=pkg, character.only=TRUE) + + path <- system.file("unitTests", package = pkg) + + stopifnot(file.exists(path), file.info(path.expand(path))$isdir) + + ## MM: Setting RNG states *outside* testing functions, + ## so we can run them, testing new situations each time + oRK <- RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") + set.seed(4711) + + source(file.path(path, "runTests.R"), echo = TRUE) + + ## reset RNG: + RNGkind(oRK[1]) + } > pkg <- "stabledist" > if (require("RUnit", quietly = TRUE)) { + library(package = pkg, character.only = TRUE) + if (!(exists("path") && file.exists(path))) + .... [TRUNCATED] Loading required package: fBasics Loading required package: stabledist Loading required package: tools Executing test function test.stableS0 ... Distribution Check for: stable Call: distCheck(fun = "stable", n = n, alpha = 1.8, beta = 0.3) 1. Normalization Check: NORM 1 with absolute error < 2.2e-05 2. [p-pfun(qfun(p))]^2 Check: [,1] [,2] [,3] [,4] [,5] [,6] [,7] p 0.001 0.01 0.1 0.5 0.9 0.99 0.999 P 0.001 0.01 0.1 0.5 0.9 0.99 0.999 RMSE 8.974884e-07 3. r(64) Check: MEAN VAR SAMPLE 0.144 1.95 X 0.09747408 with absolute error < 6.3e-05 X^2 failed with message 'the integral is probably divergent' MEAN VAR EXACT 0.0975 0.000174 normCheck rmseCheck meanvarCheck TRUE TRUE FALSE Distribution Check for: stable Call: distCheck(fun = "stable", n = n, alpha = 1.2, beta = -0.3) 1. Normalization Check: NORM 0.9999999 with absolute error < 3.4e-07 2. [p-pfun(qfun(p))]^2 Check: [,1] [,2] [,3] [,4] [,5] [,6] [,7] p 0.001 0.01 0.1 0.5 0.9 0.99 0.999 P 0.001 0.01 0.1 0.5 0.9 0.99 0.999 RMSE 7.480794e-08 3. r(64) Check: MEAN VAR SAMPLE 0.135 3.88 X -0.9233029 with absolute error < 0.00011 X^2 failed with message 'the integral is probably divergent' MEAN VAR EXACT -0.923 0.000807 normCheck rmseCheck meanvarCheck TRUE TRUE FALSE done successfully. Executing test function test.stableS1 ... Distribution Check for: stable Call: distCheck(fun = "stable", n = n, alpha = 1.2, beta = -0.3, pm = 1) 1. Normalization Check: NORM 0.9999999 with absolute error < 1.5e-05 2. [p-pfun(qfun(p))]^2 Check: [,1] [,2] [,3] [,4] [,5] [,6] [,7] p 0.001 0.01 0.1 0.5 0.9 0.99 0.999 P 0.001 0.01 0.1 0.5 0.9 0.99 0.999 RMSE 7.480794e-08 3. r(64) Check: MEAN VAR SAMPLE -0.0964 10.3 X failed with message 'the integral is probably divergent' X^2 failed with message 'roundoff error is detected in the extrapolation table' MEAN VAR EXACT 5.18e-06 3.3e+07 normCheck rmseCheck meanvarCheck TRUE TRUE FALSE done successfully. RUNIT TEST PROTOCOL -- Fri Aug 16 19:25:35 2024 *********************************************** Number of test functions: 2 Number of errors: 0 Number of failures: 0 1 Test Suite : stabledist unit testing - 2 test functions, 0 errors, 0 failures Warning messages: 1: In RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") : RNGkind: Marsaglia-Multicarry has poor statistical properties 2: In RNGkind(kind = testSuite$rngKind, normal.kind = testSuite$rngNormalKind) : RNGkind: Marsaglia-Multicarry has poor statistical properties 3: In RNGkind(kind = testSuite$rngKind, normal.kind = testSuite$rngNormalKind) : RNGkind: severe deviations from normality for Kinderman-Ramage + Marsaglia-Multicarry 4: In .integrate2(g1, lower = a, upper = b, subdivisions = subdivisions, : roundoff error is detected in the extrapolation table 5: In .integrate2(g1, lower = a, upper = b, subdivisions = subdivisions, : roundoff error is detected in the extrapolation table 6: In .integrate2(g1, lower = a, upper = b, subdivisions = subdivisions, : roundoff error is detected in the extrapolation table 7: In RNGkind(kind = rngDefault[1], normal.kind = rngDefault[2]) : RNGkind: Marsaglia-Multicarry has poor statistical properties > > warnings()## as we see them Warning messages: 1: In RNGkind(kind = "Marsaglia-Multicarry", normal.kind = "Inversion") : RNGkind: Marsaglia-Multicarry has poor statistical properties 2: In RNGkind(kind = testSuite$rngKind, normal.kind = testSuite$rngNormalKind) : RNGkind: Marsaglia-Multicarry has poor statistical properties 3: In RNGkind(kind = testSuite$rngKind, normal.kind = testSuite$rngNormalKind) : RNGkind: severe deviations from normality for Kinderman-Ramage + Marsaglia-Multicarry 4: In .integrate2(g1, lower = a, upper = b, subdivisions = subdivisions, ... : roundoff error is detected in the extrapolation table 5: In .integrate2(g1, lower = a, upper = b, subdivisions = subdivisions, ... : roundoff error is detected in the extrapolation table 6: In .integrate2(g1, lower = a, upper = b, subdivisions = subdivisions, ... : roundoff error is detected in the extrapolation table 7: In RNGkind(kind = rngDefault[1], normal.kind = rngDefault[2]) : RNGkind: Marsaglia-Multicarry has poor statistical properties > > cat('Time elapsed: ', proc.time(),'\n') # "stats" Time elapsed: 9.21 0.21 9.37 NA NA > > proc.time() user system elapsed 9.21 0.21 9.37