Last updated on 2026-11-15 19:50:27 CET.
| Flavor | Version | Tinstall | Tcheck | Ttotal | Status | Flags |
|---|---|---|---|---|---|---|
| r-devel-linux-x86_64-debian-clang | 1.2.0 | 2.91 | 31.45 | 34.36 | OK | |
| r-devel-linux-x86_64-debian-gcc | 2.0.0 | 2.78 | 47.16 | 49.94 | OK | |
| r-devel-linux-x86_64-fedora-clang | 2.0.0 | 51.33 | OK | |||
| r-devel-linux-x86_64-fedora-gcc | 2.0.0 | 50.03 | OK | |||
| r-devel-windows-x86_64 | 2.0.0 | 7.00 | 88.00 | 95.00 | OK | |
| r-patched-linux-x86_64 | 1.2.0 | 3.20 | 29.09 | 32.29 | OK | |
| r-release-linux-x86_64 | 1.2.0 | 2.82 | 28.81 | 31.63 | OK | |
| r-release-macos-arm64 | 2.0.0 | 1.00 | 12.00 | 13.00 | ERROR | |
| r-release-macos-x86_64 | 2.0.0 | 3.00 | 166.00 | 169.00 | OK | |
| r-release-windows-x86_64 | 2.0.0 | 7.00 | 85.00 | 92.00 | OK | |
| r-oldrel-macos-arm64 | 2.0.0 | ERROR | ||||
| r-oldrel-macos-x86_64 | 2.0.0 | 3.00 | 177.00 | 180.00 | OK | |
| r-oldrel-windows-x86_64 | 2.0.0 | 8.00 | 107.00 | 115.00 | OK |
Version: 2.0.0
Check: tests
Result: ERROR
Running ‘ad-published.R’ [0s/0s]
Running the tests in ‘tests/ad-published.R’ failed.
Complete output:
> source("helpers/legacy-reporting.R", local=TRUE)
> library(Rita)
> checks <- 0L
> check <- function(ok,label) {
+ if (!isTRUE(ok)) stop(label,call.=FALSE)
+ checks <<- checks+1L
+ }
> close <- function(x,y,tol=1e-12) isTRUE(legacy_all_equal(unname(x),unname(y),tolerance=tol))
> probability <- get('.rita_ad_pvalue',asNamespace('Rita'))
>
> # Fixed Table 4.9 results independently evaluated with Python Decimal at
> # 50-digit precision. They exercise all four regions, not package snapshots.
> z <- c(.15,.25,.45,.8)
> p <- c(.9630771618746098041,.7446512446013424107,
+ .2760150184697347072,.03832717900008682781)
> for(i in seq_along(z)) check(close(probability(z[i]),p[i]),'Table 4.9 fixed value')
>
> # Table 4.7, Case 3: the published critical values and the approximation agree
> # to table/approximation precision, not exactly.
> check(abs(probability(.752)-.05)<.0004,'Table 4.7 five-percent critical value')
> check(abs(probability(1.035)-.01)<.0002,'Table 4.7 one-percent critical value')
>
> # Direct transcription of Table 4.9 as a coefficient table, with the explicit
> # equality convention documented for Rita. No registry/production helper oracle.
> table_probability <- function(z) {
+ coefficients <- rbind(c(-13.436,101.14,-223.73),c(-8.318,42.796,-59.938),
+ c(.9177,-4.279,-1.38),c(1.2937,-5.709,.0186))
+ region <- if(z<=.2) 1L else if(z<=.34) 2L else if(z<.6) 3L else 4L
+ exponent <- sum(coefficients[region,]*c(1,z,z^2))
+ if(region<=2) 1-exp(exponent) else exp(exponent)
+ }
> for(knot in c(.2,.34,.6)) for(offset in c(-1e-10,0,1e-10))
+ check(close(probability(knot+offset),table_probability(knot+offset)),
+ 'breakpoint side/equality matches documented table region')
>
> # Independently reindexed weighted sum (published reversed upper-tail form).
> reference_statistic <- function(x) {
+ n <- length(x); standardized <- (sort(x)-mean(x))/sd(x)
+ A <- -n-mean((2*seq_len(n)-1)*
+ (pnorm(standardized,log.p=TRUE)+rev(pnorm(-standardized,log.p=TRUE))))
+ A*(1+.75/n+2.25/n^2)
+ }
> regions <- integer()
> for(seed in c(1,2,4,9)) {
+ set.seed(seed); x<-rnorm(40); A<-reference_statistic(x)
+ regions<-c(regions,findInterval(A,c(.2,.34,.6))+1L)
+ expected_p<-table_probability(A)
+ actual<-ADTest(x)
+ check(legacy_identical(actual,list(c(AD=round(A,3)),c(`P-value`=round(expected_p,3)),
+ c(Sig.=expected_p<.05))), 'end-to-end published formula')
+ check(legacy_identical(MasterTest(3,x),actual) &&
+ legacy_identical(MasterTest('anderson-darling',x),actual),'independent AD dispatch contract')
+ }
> check(legacy_identical(sort(regions),1:4),'end-to-end fixtures cover every p-value region')
>
> # Stephens (1974) weights illustration: use the base statistic from that source
> # with Rita's intentionally retained 1986 modification/calibration.
> weights <- c(148,154,158,160,161,162,166,170,182,195,236)
> A <- reference_statistic(weights)
> check(abs(A-1.0289297700)<1e-10,'weights example with 1986 modification')
> check(abs(table_probability(A)-.0104540238)<1e-9,'weights later-form reference p')
> check(legacy_identical(ADTest(weights),list(c(AD=1.029),c(`P-value`=.010),c(Sig.=TRUE))),
+ 'weights public result names and rounding')
> # p rounds to .010 but the unrounded value is above .0102.
> check(legacy_identical(unname(ADTest(weights,alpha=.0102)[[3]]),FALSE),
+ 'decision uses unrounded p')
> check(legacy_identical(unname(ADTest(weights,alpha=.02,j=2)[[3]]),FALSE),
+ 'Bonferroni decision preserved')
> check(legacy_identical(ADTest(c(weights,NA,NaN)),ADTest(weights)), 'existing missing-value omission')
>
> # A standardized positive outlier makes pnorm round to one; direct log tails
> # must retain a finite statistic and reflection invariance.
> x <- c(rep(0,99),100)
> check(any(pnorm((x-mean(x))/sd(x))==1),'fixture reaches CDF rounding failure')
> A <- reference_statistic(x)
> check(is.finite(A) && abs(A-38.533)<.0005,'known outlier statistic')
> for(y in list(x,-x,10+3*x)) {
+ ans<-ADTest(y)
+ check(all(is.finite(unlist(ans))) && close(ans[[1]],round(A,3)),
+ 'finite log-tail statistic and affine/reflection invariance')
+ }
> check(legacy_identical(ADTest(x),ADTest(-x)),'outlier reflected result agrees')
>
> for(x in list(rep(1,12),rep(0,20),c(rep(3,12),NA,NaN),numeric(),1,
+ c(1:12,Inf))) {
+ warnings <- character()
+ result <- withCallingHandlers(tryCatch(ADTest(x),error=identity),warning=function(w) {
+ warnings <<- c(warnings,conditionMessage(w)); invokeRestart('muffleWarning')
+ })
+ check(inherits(result,'error') && grepl('finite, positive sample standard deviation',
+ conditionMessage(result),fixed=TRUE) && length(warnings)==0,
+ 'invalid variation terminates with informative error before arithmetic')
+ }
>
> # LEGACY EXTREME TAIL, pending maintainer policy: deliberately preserve the
> # last polynomial, even where it is not a valid probability. These assertions
> # guard the explicitly deferred scope; they are NOT calibration endorsements.
> for(A in c(10,40,200,400,1000))
+ check(close(probability(A),exp(1.2937-5.709*A+.0186*A^2)),
+ 'LEGACY TAIL no unapproved replacement or clamp')
> extreme <- rep(c(-1,1),1000); A<-reference_statistic(extreme)
> check(is.finite(A) && probability(A)>1 &&
+ close(ADTest(extreme)[[2]],round(probability(A),3)),
+ 'LEGACY TAIL public behavior retained pending policy')
Error: LEGACY TAIL public behavior retained pending policy
Execution halted
Flavors: r-release-macos-arm64, r-oldrel-macos-arm64