* using log directory ‘/data/localhost/ripley/R/packages/tests-MKL/dacc.Rcheck’ * using R Under development (unstable) (2026-11-08 r90859) * using platform: x86_64-pc-linux-gnu * R was compiled by gcc (GCC) 16.2.1 20261029 (Red Hat 16.2.1-3) GNU Fortran (GCC) 16.2.1 20261029 (Red Hat 16.2.1-3) * running under: Fedora Linux 44 (Server Edition) * using session charset: UTF-8 * current time: 2026-11-09 05:34:39 UTC * using option ‘--no-stop-on-test-error’ * checking for file ‘dacc/DESCRIPTION’ ... OK * this is package ‘dacc’ version ‘0.1.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 ‘dacc’ can be installed ... [6s/15s] 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 ... 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 ... [12s/32s] 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 contents of ‘data’ directory ... OK * checking data for non-ASCII characters ... OK * checking data for ASCII and uncompressed saves ... OK * checking examples ... OK * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... Running ‘dispatch.R’ Running ‘factor-selection.R’ Running ‘inflation-arguments.R’ Running ‘latent.R’ Running ‘poly.R’ [9s/22s] ERROR Running the tests in ‘tests/dispatch.R’ failed. Complete output: > if (file.exists(file.path("R", "fingerprint.R"))) { + for (file in list.files("R", pattern = "[.]R$", full.names = TRUE)) { + source(file) + } + } else { + library(dacc) + } > > # Test routing independently of the numerical implementations. > routing <- new.env(parent = environment(fingerprint)) > routing$fingerprintPoly <- function(...) list(backend = "poly", arguments = list(...)) > routing$fingerprintLatent <- function(...) list(backend = "latent", arguments = list(...)) > routing$fingerprintLegacy <- function(...) list(backend = "legacy", arguments = list(...)) > route <- fingerprint > environment(route) <- routing > X <- matrix(seq_len(20), 10, 2) > Y <- seq_len(10) > Z <- matrix(0, 30, 10) > > fit <- route(X, Y, c(3, 4), Z, degree = 3, estimate.inflation = FALSE) > stopifnot(fit$backend == "poly", fit$arguments$degree == 3) > fit <- route(X, Y, c(3, 4), Z, method = "latent", n.factors = 2) > stopifnot(fit$backend == "latent", fit$arguments$n.factors == 2) > for (method in c("EE", "PBC", "TS", "TS.TempSt")) { + fit <- route(X, Y, c(3, 4), Z, method = method, S = 2, T = 5) + stopifnot( + fit$backend == "legacy", fit$arguments$method == method, + identical(fit$arguments$ctlruns.sigma, Z), + identical(fit$arguments$ctlruns.bhvar, Z) + ) + } > stopifnot( + identical(eval(formals(fingerprint)$method), + c("poly", "linear", "latent", "EE", "PBC", "TS", "TS.TempSt")), + !"legacy.method" %in% names(formals(fingerprint)), + inherits(try(route(X, Y, c(3, 4), Z, method = "legacy"), + silent = TRUE), "try-error") + ) > > # The explicit linear method fixes degree one without fixing inflation coefficients. > for (estimate in c(TRUE, FALSE)) { + fit <- route(X, Y, c(3, 4), Z, method = "linear", + estimate.inflation = estimate) + stopifnot(fit$backend == "poly", fit$arguments$degree == 1L, + identical(fit$arguments$estimate.inflation, estimate)) + } > for (degree in list(3, 0, NA_real_, NULL, "1", c(1, 3))) { + fit <- route(X, Y, c(3, 4), Z, method = "linear", degree = degree) + stopifnot(fit$backend == "poly", identical(fit$arguments$degree, 1L)) + } > fit <- route(X, Y, c(3, 4), Z, method = "linear", degree = 1) > stopifnot(fit$arguments$degree == 1L) > > # Renaming the polynomial backend must not change its estimates. > set.seed(89) > X <- cbind(3 * sin(seq_len(40) / 4), 3 * cos(seq_len(40) / 5)) > Y <- as.vector(X %*% c(1, 0.5) + rnorm(40)) > Z <- matrix(rnorm(120 * 40), 120) > a <- fingerprint(X, Y, c(30, 30), Z, degree = 1, estimate.inflation = FALSE) > b <- fingerprintPoly(X, Y, c(30, 30), Z, degree = 1, estimate.inflation = FALSE) > stopifnot( + inherits(a, "fingerprintPoly"), inherits(a, "fingerprint"), + identical(a$beta, b$beta), identical(a$var, b$var), identical(a$ci, b$ci) + ) > > linear <- fingerprint(X, Y, c(30, 30), Z, + method = "linear", degree = 3, estimate.inflation = FALSE) > stopifnot(identical(linear$beta, b$beta), identical(linear$var, b$var), + identical(linear$ci, b$ci)) > > # Original estimator and bootstrap intervals remain unchanged by dispatch. > Y <- matrix(Y, ncol = 1) > set.seed(55) > a <- fingerprint( + X, Y, c(30, 30), Z, method = "TS", + S = 4, T = 10, B = 5, cov.method = "l2" + ) > set.seed(55) > b <- fingerprintLegacy( + X, Y, c(30, 30), Z, Z, 4, 10, + B = 5, method = "TS", cov.method = "l2" + ) > stopifnot(identical(a, b)) Error: identical(a, b) is not TRUE Execution halted Running the tests in ‘tests/latent.R’ failed. Complete output: > if (file.exists(file.path("R", "fingerprintLatent.R"))) { + for (file in list.files("R", pattern = "[.]R$", full.names = TRUE)) source(file) + } else { + library(dacc) + for (name in c(".lf_spikes", ".lf_spike_roots", ".lf_traces")) { + assign(name, getFromNamespace(name, "dacc")) + } + } > > # Trace formulas (10)--(13) against direct matrices with known alignments. > set.seed(15) > N <- 30L > basis <- qr.Q(qr(matrix(rnorm(N * 4), N))) > true.U <- basis[, 1:2] > z <- c(0.8, 0.6) > empirical.U <- sweep(true.U, 2, sqrt(z), "*") + + sweep(basis[, 3:4], 2, sqrt(1 - z), "*") > pi <- c(7, 4) > noise <- 1.3 > theta <- c(-1, 0.4) > C <- noise * diag(N) + true.U %*% diag(pi) %*% t(true.U) > W <- diag(N) + empirical.U %*% diag(theta) %*% t(empirical.U) > Wt <- empirical.U %*% diag(pi / z * (z * theta + 1)^2) %*% + t(empirical.U) + noise * W %*% W > tr <- .lf_traces(theta, pi, noise, z, N) > stopifnot( + abs(tr$delta - sum(diag(W %*% C)) / N) < 1e-12, + abs(tr$phi - sum(diag(W %*% C %*% W %*% C)) / N) < 1e-12, + abs(tr$psi - sum(diag(Wt %*% C)) / N) < 1e-12 + ) > > # Algorithm 1, including the noise bias adjustment. > known.pi <- c(15, 8) > gamma <- 0.5 > noise0 <- 2 > leading <- noise0 + known.pi + gamma * noise0 * (known.pi + noise0) / known.pi > stopifnot(max(abs(.lf_spike_roots(leading, noise0, gamma) - known.pi)) < 1e-12) > corrected <- .lf_spikes(c(leading, rep(noise0, 38)), 2, 80) > expected.noise <- noise0 * (1 + gamma * (2 + sum(noise0 / known.pi)) / 38) > stopifnot(abs(corrected$noise - expected.noise) < 1e-12) > > # Detectable factors, unequal ensemble sizes, and variance heterogeneity. > set.seed(95) > N <- 120L > m <- 180L > K <- 2L > sizes <- c(25L, 35L) > U <- qr.Q(qr(matrix(rnorm(N * K), N))) > Sigma <- diag(N) + U %*% diag(c(18, 12)) %*% t(U) > L <- chol(Sigma) > truth <- cbind(3 * sin(seq_len(N) / 8), 4 * cos(seq_len(N) / 11)) > Z <- matrix(rnorm(m * N), m) %*% L * sqrt(1.5) > ensembles <- lapply(seq_len(2), function(i) { + sweep(matrix(rnorm(sizes[i] * N), sizes[i]) %*% L * sqrt(1.8), + 2, truth[, i], "+") + }) > X <- vapply(ensembles, colMeans, numeric(N)) > Y <- as.vector(truth %*% c(1, 0.7)) + as.vector(rnorm(N) %*% L) > fixed <- fingerprintLatent( + X, Y, sizes, Z, n.factors = K, + estimate.inflation = FALSE, theta = c(-0.7, -1) + ) > stopifnot( + inherits(fixed, "fingerprint"), inherits(fixed, "fingerprintLatent"), + fixed$sigma.x2 == 1, fixed$sigma.z2 == 1, + !any(c("Q", "V", "history", "settings", "diagnostic") %in% names(fixed)), + all(is.finite(fixed$ci)) + ) > > # Independent precision-weighted SVD solution, including a removed direction. > e <- eigen(fixed$weight, symmetric = TRUE) > A <- sweep(crossprod(e$vectors, cbind(sweep(X, 2, sqrt(sizes), "*"), Y)), + 1, sqrt(pmax(e$values, 0)), "*") > v <- svd(A)$v[, 3] > reference <- -sqrt(sizes) * v[1:2] / v[3] > stopifnot(max(abs(reference - fixed$beta)) < 1e-8) > > # Theorem 4 against a direct matrix calculation, including D in Omega. > S <- crossprod(Z) / m > e <- eigen(S, symmetric = TRUE) > sp <- .lf_spikes(pmax(e$values, 0), K, m) > Ut <- e$vectors[, seq_len(K), drop = FALSE] > t <- fixed$theta > tr <- .lf_traces(t, sp$spikes, sp$noise, sp$alignment, N) > D <- diag(1 / sizes) > G <- crossprod(X, fixed$weight %*% X) / N - tr$delta * D > Wt <- Ut %*% diag(sp$spikes / sp$alignment * (sp$alignment * t + 1)^2) %*% + t(Ut) + sp$noise * fixed$weight %*% fixed$weight > Omega <- crossprod(X, Wt %*% X) / N - tr$psi * D > scale <- 1 + sum(fixed$beta^2 / sizes) > Xi <- scale * solve(G) %*% ( + Omega + tr$phi * solve(diag(sizes) + tcrossprod(fixed$beta)) + ) %*% solve(G) > stopifnot(max(abs(fixed$var - Xi / N)) < 1e-10) > Q <- as.numeric(crossprod(fixed$residuals, fixed$weight %*% fixed$residuals)) / N - + scale * tr$delta > V <- 2 / N * scale^2 * tr$phi > stopifnot( + abs(fixed$diagnostic.stat - Q / sqrt(V)) < 1e-10, + max(abs(fixed$standardized.residuals - fixed$residuals / sqrt(diag(S)))) < 1e-12 + ) > > # Factor estimation and weight selection; exact matching degenerates the test. > fit <- fingerprintLatent(X, Y, sizes, Z, K, ensembles = ensembles) > within <- sum(vapply(seq_len(2), function(i) { + sum(sweep(ensembles[[i]], 2, X[, i])^2) + }, numeric(1))) / (N * (sum(sizes) - 2)) > stopifnot( + fit$sigma.x2 > 0, fit$sigma.z2 > 0, + all(is.finite(fit$ci)), all(fit$theta >= -1), + abs(fit$p.value - 0.5) < 1e-6, + abs(fit$sigma.x2 / fit$sigma.z2 - within / mean(diag(S))) < 1e-10 + ) > dispatched <- fingerprint(X, Y, sizes, Z, method = "latent", n.factors = K, + ensembles = ensembles) > stopifnot(identical(fit$beta, dispatched$beta), identical(fit$var, dispatched$var)) Error: identical(fit$beta, dispatched$beta) 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/dacc.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 2:23.76, 52.05 + 6.69