- using R version 4.6.1 (2026-06-24)
- using platform: aarch64-apple-darwin23
- R was compiled by
Apple clang version 17.0.0 (clang-1700.3.19.1)
GNU Fortran (GCC) 14.2.0
- running under: macOS Sequoia 15.7.1
- using session charset: UTF-8
* current time: 2026-11-16 02:41:28 UTC
- checking for file ‘Rita/DESCRIPTION’ ... OK
- checking extension type ... Package
- this is package ‘Rita’ version ‘2.0.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 ‘Rita’ can be installed ... [1s/1s] OK
See the install log for details.
- 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 code files for non-ASCII characters ... OK
- checking R files for syntax errors ... OK
- checking whether the package can be loaded ... [0s/0s] OK
- checking whether the package can be loaded with stated dependencies ... [0s/0s] OK
- checking whether the package can be unloaded cleanly ... [0s/0s] OK
- checking whether the namespace can be loaded with stated dependencies ... [0s/0s] OK
- checking whether the namespace can be unloaded cleanly ... [0s/0s] OK
- checking loading without being on the library search path ... [0s/0s] 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 ... [1s/1s] OK
- checking Rd files ... [0s/0s] 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 ... [1s/1s] OK
- checking for unstated dependencies in ‘tests’ ... OK
- checking tests ... [0s/0s] 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
- checking PDF version of manual ... [2s/2s] OK
- DONE
Status: 1 ERROR