* using log directory ‘/Users/ripley/R/packages/tests-Accelerate/nor1mix.Rcheck’ * using R Under development (unstable) (2023-09-17 r85158) * using platform: aarch64-apple-darwin22.6.0 * R was compiled by Apple clang version 15.0.0 (clang-1500.0.40.1) GNU Fortran (GCC) 12.2.0 * running under: macOS Ventura 13.5.2 * using session charset: UTF-8 * using option ‘--no-stop-on-test-error’ * checking for file ‘nor1mix/DESCRIPTION’ ... OK * this is package ‘nor1mix’ version ‘1.3-0’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘nor1mix’ can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking examples ... OK * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... Running ‘MW.R’ Running ‘par.R’ Running ‘qnorMix-ex.R’ Running ‘randNM.R’ ERROR Running the tests in ‘tests/qnorMix-ex.R’ failed. Complete output: > ## Marron Wand examples are defined as norMix() calls in ../R/zMarrWand-dens.R > library("nor1mix") > > ii <- c(32, 39, 40, 40, 48, 48, 49, 56, 57, 58, 65) > pp <- 0.486 + ii / 100000 # very constrained set > > e <- norMix(mu = c(-0.825,0.275), sigma = sqrt(0.773), w = c(1, 3)/4) > > qnorMix(pp, e, trace = TRUE) 1: relE =2.995e-14 [1] -0.007781385 -0.007605111 -0.007579910 -0.007579910 -0.007378307 [6] -0.007378307 -0.007353107 -0.007176708 -0.007151508 -0.007126309 [11] -0.006949786 > ## failed for version <= 1.0-5 > > q.pp <- -c(7.78151762922529, 7.60511100150266, 7.57991031275271, 7.57991031275271, + 7.37830712226037, 7.37830712226037, 7.35310701314534, 7.17670804948685, + 7.15150845450588, 7.12630892371882, 6.94991400429199) / 1000 > > for (m in eval(formals(qnorMix)$method)) { + cat("method ", m,":") + stopifnot(all.equal(q.pp, qnorMix(pp, e, method = m, tol = 1e-14), + tol = 1e-13),# 1.022e-14 (32-bit) + abs(qnorMix(rep(1/2, 8), MW.nm10, method = m)) < 1e-14 + ) + cat("\n") + } method interpQspline : method interpspline : method eachRoot : method root2 : > > ### a "nasty" example (for the newton steps): > ip <- c(0, 1e-11, 3.33e-09, 7.705488e-05, 0.0001670041, 0.00125378934, + 0.00141169953, 0.00357409109, 0.00644073795, 0.00853238955, 0.01361442421, + 0.01672761627, 0.02067755849, 0.02124092026, 0.03327537558, 0.03527226553, + 0.05365983941, 0.05482289811, 0.05669602608, 0.05982167629) > qv <- qnorMix(1-ip, MW.nm12, trace=1) ,,1: relE =0.003125 2: relE =0.0005494 3: relE =7.656e-05 > ## now ok > > ### --- lower.tail=FALSE did not work correctly at some point > qv. <- qnorMix(ip, MW.nm12, lower.tail=FALSE, trace=1)#2, maxiter=50) ,,1: relE =0.003125 2: relE =0.0005494 3: relE =7.656e-05 > stopifnot(all.equal(qv, qv., tol = 1e-5)) > > ## qnorMix(*, log.p=TRUE) currently warns about missing Newton step implementation > qnorMixLog <- function(p, obj, lower.tail = TRUE, ...) + suppressWarnings(qnorMix(p, obj, lower.tail=lower.tail, log.p=TRUE, ...)) > ## > n2 <- 8 > set.seed(11) > for(i in 1:50) { + cat(i, "", if(i %% 20 == 0)"\n") + u0 <- c(0,sort(runif(n2)),1) + q0 <- qnorMix(u0, MW.nm2, trace=0, tol=4e-16) + qL <- qnorMix(1-u0, MW.nm2, lower.tail=FALSE, trace=0, tol=4e-16) + stopifnot(all.equal(pnorMix(q0, MW.nm2), u0, tol=1e-15), + all.equal(q0, qL, tol=1e-14)) + i. <- 2:(n2+1); u0. <- u0[i.] + ## --- log.p= TRUE [no Newton steps] + q0. <- qnorMixLog(log ( u0.), MW.nm2, tol=4e-16) + qL. <- qnorMixLog(log1p(-u0.), MW.nm2, lower.tail=FALSE, tol=4e-16) + stopifnot(all.equal(pnorMix(q0, MW.nm2), u0, tol=1e-15), + all.equal(q0, qL, tol=1e-14), + all.equal(q0., qL., tol=1e-10), + all.equal(q0[i.], q0., tol = 6e-6)# no Newton => less accuracy + ) + }; cat("\n") 1 Error: q0 and qL are not equal: Mean relative difference: 1.037164e-14 Execution halted * checking PDF version of manual ... OK * checking HTML version of manual ... OK * checking for detritus in the temp directory ... OK * DONE Status: 1 ERROR See ‘/Users/ripley/R/packages/tests-Accelerate/nor1mix.Rcheck/00check.log’ for details. 12.38 real 9.02 user 2.63 sys