R Under development (unstable) (2026-07-21 r90286) -- "Unsuffered Consequences" Copyright (C) 2026 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu 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. > library(PTT) > > # These deterministic reference values guard the core marginal and conditional > # calculations against numerical drift while allowing platform-level > # floating-point noise. > tolerance <- 1e-9 > > x <- c(seq(0.05, 0.45, length.out = 24), seq(0.6, 0.95, length.out = 16)) > grid <- c(0.1, 0.3, 0.5, 0.7, 0.9) > > apt.fit <- apt( + x, Xpred = grid, max.resol = 4, rho0 = 0.2, + n.grid = 3, n.s = 3 + ) > apt.expected <- c( + -1.22884277881542, -0.380595133618687, + 1.04073167934391, 1.04446417461813, 0.946856014560911, + 0.960353263602841, 0.965065744499516 + ) > stopifnot( + isTRUE(all.equal( + unname(c(apt.fit$logrho, apt.fit$logphi, apt.fit$predictive_densities)), + apt.expected, + tolerance = tolerance + )), + identical(unname(apt.fit$part_points_hmap), matrix(c(0, 15, 0, Inf), nrow = 1L)) + ) > > opt.fit <- opt(x, Xpred = grid, max.resol = 4, rho0 = 0.5) > opt.expected <- c( + -0.0778733915972794, -0.615273788962671, + 1.01464670747005, 1.01474115491321, 0.983823971413429, + 0.98542445662195, 0.986027934553703 + ) > stopifnot( + isTRUE(all.equal( + unname(c(opt.fit$logrho, opt.fit$logphi, opt.fit$predictive_densities)), + opt.expected, + tolerance = tolerance + )), + identical(unname(opt.fit$part_points_hmap), matrix(c(0, 15, 0, Inf), nrow = 1L)) + ) > > conditional.x <- seq(0.02, 0.98, length.out = 40) > conditional.y <- pmin( + 0.98, + pmax(0.02, 0.15 + 0.7 * conditional.x + 0.08 * sin(8 * pi * conditional.x)) + ) > conditional.fit <- cond.opt( + conditional.x, conditional.y, + Xpred = c(0.2, 0.5, 0.8), Ypred = c(0.25, 0.5, 0.75), + max.resX = 3, max.resY = 4 + ) cgbt.cpp:256:41: runtime error: shift exponent -65533 is negative #0 0x7b757580d9fc in CondGBT::find_hmap_part() /data/localhost/ripley/R/packages/tests-gcc-SAN/PTT/src/cgbt.cpp:256 #1 0x7b757589c481 in fitCondPTTcpp(arma::Mat, arma::Mat, arma::Mat, arma::Mat, arma::Mat, arma::Mat, int, int, double, int, double, int, int, double, double, int, int, double, int) /data/localhost/ripley/R/packages/tests-gcc-SAN/PTT/src/main.cpp:247 #2 0x7b75758385c7 in _PTT_fitCondPTTcpp /data/localhost/ripley/R/packages/tests-gcc-SAN/PTT/src/RcppExports.cpp:62 #3 0x00000075bc45 in R_doDotCall /data/localhost/ripley/R/svn/R-devel/src/main/dotcode.c:853 #4 0x000000761eea in do_dotcall /data/localhost/ripley/R/svn/R-devel/src/main/dotcode.c:1437 #5 0x0000008eb97b in bcEval_loop /data/localhost/ripley/R/svn/R-devel/src/main/eval.c:8150 #6 0x0000008d687b in bcEval /data/localhost/ripley/R/svn/R-devel/src/main/eval.c:7533 #7 0x000000877eba in Rf_eval /data/localhost/ripley/R/svn/R-devel/src/main/eval.c:1167 #8 0x00000088e6ca in R_execClosure /data/localhost/ripley/R/svn/R-devel/src/main/eval.c:2398 #9 0x00000089235d in applyClosure_core /data/localhost/ripley/R/svn/R-devel/src/main/eval.c:2314 #10 0x000000878568 in Rf_applyClosure /data/localhost/ripley/R/svn/R-devel/src/main/eval.c:2333 #11 0x000000878568 in Rf_eval /data/localhost/ripley/R/svn/R-devel/src/main/eval.c:1278 #12 0x0000008a689e in do_set /data/localhost/ripley/R/svn/R-devel/src/main/eval.c:3585 #13 0x000000878996 in Rf_eval /data/localhost/ripley/R/svn/R-devel/src/main/eval.c:1230 #14 0x000000a1ee48 in Rf_ReplIteration /data/localhost/ripley/R/svn/R-devel/src/main/main.c:264 #15 0x000000a1ee48 in R_ReplConsole /data/localhost/ripley/R/svn/R-devel/src/main/main.c:317 #16 0x000000a3cada in run_Rmainloop /data/localhost/ripley/R/svn/R-devel/src/main/main.c:1237 #17 0x000000a3cb72 in Rf_mainloop /data/localhost/ripley/R/svn/R-devel/src/main/main.c:1244 #18 0x000000411f5f in main /data/localhost/ripley/R/svn/R-devel/src/main/Rmain.c:29 #19 0x7f758160a680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: 17f2e1fd905f485786f6fd6e3bede4ad737137e7) #20 0x7f758160a797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: 17f2e1fd905f485786f6fd6e3bede4ad737137e7) #21 0x000000412924 in _start (/data/localhost/ripley/R/gcc-SAN3/bin/exec/R+0x412924) (BuildId: 7bd069e7b1c3f2758f94ae347cb95ae3bb7314b6) > conditional.expected <- c( + -28.8015601776622, 30.7668680880074, + 4.21400432146923, 4.44293777151951, 7.18750082136846 + ) > conditional.hmap.expected <- matrix( + c( + 0, 0, 0, 2, 4, 4, 6, + 7, 3, 1, 3, 7, 5, 7, + 0, 1, 2, 2, 1, 2, 2, + 1, 1, Inf, Inf, 1, Inf, Inf, + 3.10199679410356e-13, 0.0718176406024455, + 0.985628998307472, 0.976837618064303, + 0.0718176406024452, 0.976837618064303, 0.985628998307472 + ), + nrow = 7L + ) > stopifnot( + isTRUE(all.equal( + unname(c( + conditional.fit$logrho, + conditional.fit$logphi, + conditional.fit$predictive_densities + )), + conditional.expected, + tolerance = tolerance + )), + isTRUE(all.equal( + unname(conditional.fit$part_points_hmap), + conditional.hmap.expected, + tolerance = tolerance + )) + ) > > proc.time() user system elapsed 1.036 0.138 1.156