* using log directory ‘/data/localhost/ripley/R/packages/tests-MKL/IsingSampler.Rcheck’ * using R Under development (unstable) (2026-10-28 r90786) * using platform: x86_64-pc-linux-gnu * R was compiled by gcc (GCC) 16.2.1 20260819 (Red Hat 16.2.1-2) GNU Fortran (GCC) 16.2.1 20260819 (Red Hat 16.2.1-2) * running under: Fedora Linux 44 (Server Edition) * using session charset: UTF-8 * current time: 2026-10-29 13:53:45 UTC * using option ‘--no-stop-on-test-error’ * checking for file ‘IsingSampler/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘IsingSampler’ version ‘0.5.0’ * 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 ‘IsingSampler’ can be installed ... [16s/31s] OK * used C++ compiler: ‘g++ (GCC) 16.2.1 20260819 (Red Hat 16.2.1-2)’ * 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 ... 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 line widths ... 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 line endings in C/C++/Fortran sources/headers ... OK * checking pragmas in C/C++ headers and code ... OK * checking compilation flags used ... OK * checking compiled code ... OK * checking examples ... OK * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... Running ‘test-constrain.R’ Running ‘test-distribution.R’ Running ‘test-entropy.R’ Running ‘test-estimators.R’ Running ‘test-minsum.R’ Running ‘test-pseudolikelihood.R’ Running ‘test-return-types.R’ Running ‘test-validation.R’ [14s/18s] ERROR Running the tests in ‘tests/test-estimators.R’ failed. Complete output: > # Tests for the non-regularized estimators (EstimateIsing*): > # (a) the 'beta' argument must actually be used. Convention: the Ising > # measure depends on the parameters only through beta * graph and > # beta * thresholds, so all estimators return the beta = 1 estimates > # divided by beta (for 'pl' this is achieved by optimizing the > # pseudo-likelihood at the supplied beta, which yields the same scaling); > # (b) supplying 'responses' explicitly must give the same result as the > # default (missing) call on matching data; > # (c) EstimateIsingPL() must warn when a supplied 'responses' coding does > # not match the values present in the data. > # Plain stopifnot tests, no package dependencies beyond IsingSampler itself. > > library("IsingSampler") > > ## Small seeded 3-node test model --------------------------------------------- > set.seed(123) > N <- 3 > graph <- matrix(0, N, N) > graph[upper.tri(graph)] <- c(0.4, -0.2, 0.6) > graph <- graph + t(graph) > thresholds <- c(-0.1, 0.1, 0) > data <- as.matrix(IsingSampler(500, graph, thresholds, responses = c(0L, 1L))) > > ## (a) beta rescaling ---------------------------------------------------------- > > # Pseudo-likelihood: fitting at beta = 2 optimizes the same objective as a > # function of 2 * par, so the estimates must (up to nlm convergence noise) > # equal the beta = 1 estimates divided by 2. Generous tolerance for nlm: > pl1 <- EstimateIsingPL(data, beta = 1) > pl2 <- EstimateIsingPL(data, beta = 2) > stopifnot(max(abs(pl2$graph - pl1$graph / 2)) < 1e-3) > stopifnot(max(abs(pl2$thresholds - pl1$thresholds / 2)) < 1e-3) > > # Univariate logistic regressions: rescaling is exact (deterministic glm): > uni1 <- EstimateIsingUni(data, beta = 1) > uni2 <- EstimateIsingUni(data, beta = 2) > stopifnot(isTRUE(all.equal(uni2$graph, uni1$graph / 2))) > stopifnot(isTRUE(all.equal(uni2$thresholds, uni1$thresholds / 2))) > > # Loglinear model: rescaling is exact (deterministic loglin/IPF): > ll1 <- EstimateIsingLL(data, beta = 1) 3 iterations: deviation 0.08676137 > ll2 <- EstimateIsingLL(data, beta = 2) 3 iterations: deviation 0.08676137 > stopifnot(isTRUE(all.equal(ll2$graph, ll1$graph / 2))) > stopifnot(isTRUE(all.equal(ll2$thresholds, ll1$thresholds / 2))) > > # Bivariate (multinomial) regressions can be numerically unstable, so only > # the beta rescaling arithmetic is exercised here: identical RNG seeds make > # the two multinom fits start identically, so the estimates must satisfy the > # same divide-by-beta relation (generous tolerance for the optimizer): > set.seed(1) > bi1 <- EstimateIsingBi(data, beta = 1, trace = FALSE) > set.seed(1) > bi2 <- EstimateIsingBi(data, beta = 2, trace = FALSE) > stopifnot(all(is.finite(bi2$graph)), all(is.finite(bi2$thresholds))) > stopifnot(max(abs(bi2$graph - bi1$graph / 2)) < 1e-3) > stopifnot(max(abs(bi2$thresholds - bi1$thresholds / 2)) < 1e-3) > > # Cross-method sanity check of the convention: beta * estimates should be on > # the same (measure) scale regardless of beta, e.g. 2 * pl2 approx 1 * pl1: > stopifnot(max(abs(2 * pl2$graph - pl1$graph)) < 2e-3) > > ## (b) explicit responses equal the default on matching 0/1 data --------------- > plDef <- EstimateIsingPL(data) > plExp <- EstimateIsingPL(data, responses = c(0, 1)) > stopifnot(identical(plDef$graph, plExp$graph)) > stopifnot(identical(plDef$thresholds, plExp$thresholds)) > > uniDef <- EstimateIsingUni(data) > uniExp <- EstimateIsingUni(data, responses = c(0, 1)) > stopifnot(identical(uniDef$graph, uniExp$graph)) Error: identical(uniDef$graph, uniExp$graph) is not TRUE Execution halted Running the tests in ‘tests/test-minsum.R’ failed. Complete output: > # Tests for the minimum sum-score correction of EstimateIsingUni(): > # 'min_sum' refers to sum scores on the ORIGINAL response coding, but the > # row filter used to run after the data were recoded to 0/1, so for data > # coded e.g. c(1,2) it filtered the wrong rows (usually none). The filter > # now runs on the raw data: for node i a row is biased iff the rest score > # is compatible with the truncation when node i takes the high response > # but not when it takes the low response. Checks: > # (a) on 0/1 data the new raw-scale filter retains exactly the rows the > # old binarized-scale filter (rest != min_sum - 1) retained, per node; > # (b) on c(1,2)-coded data (same data recoded, min_sum shifted accordingly) > # the estimator drops the corresponding rows and the estimates agree > # with the 0/1 fit after LinTransform; > # (c) the default min_sum = -Inf drops no rows. > # Plain stopifnot tests, no package dependencies beyond IsingSampler itself. > > library("IsingSampler") > > ## Small seeded 4-node test model --------------------------------------------- > set.seed(42) > N <- 4 > graph <- matrix(0, N, N) > graph[upper.tri(graph)] <- c(0.4, -0.2, 0.6, 0.2, -0.3, 0.5) > graph <- graph + t(graph) > thresholds <- c(-0.2, 0.1, 0, -0.1) > full <- as.matrix(IsingSampler(1000, graph, thresholds, responses = c(0L, 1L))) > > # Mimic sum-score truncated data: keep only rows with sum score >= min_sum: > min_sum <- 2 > data01 <- full[rowSums(full) >= min_sum, , drop = FALSE] > > # Number of retained rows per fitted node model: > nRows <- function(fit) sapply(fit$results, function(m) length(residuals(m))) > > ## (a) new raw-scale filter == old filter on 0/1 data -------------------------- > # On 0/1 data the binarized data equal the raw data, so the old filter > # (rest != min_sum - 1 on the binarized data) must be reproduced exactly by > # the new condition (rest + 1 >= min_sum & rest + 0 < min_sum on raw data): > uni01 <- EstimateIsingUni(data01, min_sum = min_sum) > for (i in seq_len(N)){ + rest <- rowSums(data01[, -i, drop = FALSE]) + keepOld <- which(rest != min_sum - 1) + keepNew <- which(!(rest + 1 >= min_sum & rest + 0 < min_sum)) + stopifnot(identical(keepOld, keepNew)) + # The estimator must have fitted node i on exactly these rows: + stopifnot(nRows(uni01)[i] == length(keepNew)) + # Make the test non-trivial: some rows must actually be dropped: + stopifnot(length(keepNew) < nrow(data01)) + } > > ## (b) c(1,2)-coded data: same rows dropped, estimates agree ------------------- > # Recode the same data to responses c(1,2); each row's sum score shifts by > # the number of nodes, so the equivalent truncation threshold shifts too: > data12 <- data01 + 1 > min_sum12 <- min_sum + N > uni12 <- EstimateIsingUni(data12, min_sum = min_sum12) > > # Corresponding rows are dropped per node (the old binarized-scale filter > # would have dropped none here, since rest scores of 0/1-binarized data > # never equal min_sum12 - 1 = 5 with only 3 remaining nodes): > stopifnot(identical(nRows(uni12), nRows(uni01))) > > # The glm fits run on identical binarized data and identical retained rows, > # so mapping the 0/1 estimates to the (1,2) coding via LinTransform must > # reproduce the (1,2) fit essentially exactly: > trans <- LinTransform(uni01$graph, uni01$thresholds, from = c(0, 1), to = c(1, 2)) > stopifnot(isTRUE(all.equal(trans$graph, uni12$graph, tolerance = 1e-6))) > stopifnot(isTRUE(all.equal(trans$thresholds, uni12$thresholds, tolerance = 1e-6))) > > ## (c) default min_sum = -Inf drops no rows ------------------------------------ > uniDef <- EstimateIsingUni(full) > uniInf <- EstimateIsingUni(full, min_sum = -Inf) > stopifnot(all(nRows(uniInf) == nrow(full))) > stopifnot(identical(uniDef$graph, uniInf$graph)) Error: identical(uniDef$graph, uniInf$graph) is not TRUE Execution halted * checking PDF version of manual ... OK * checking HTML version of manual ... OK * checking for non-standard things in the check directory ... OK * checking for detritus in the temp directory ... OK * DONE Status: 1 ERROR See ‘/data/localhost/ripley/R/packages/tests-MKL/IsingSampler.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 1:52.87, 56.65 + 7.37