* using log directory ‘/data/gannet/ripley/R/packages/tests-MKL/MOSAlloc.Rcheck’ * using R Under development (unstable) (2026-01-27 r89337) * using platform: x86_64-pc-linux-gnu * R was compiled by gcc (GCC) 15.1.1 20250521 (Red Hat 15.1.1-2) GNU Fortran (GCC) 15.1.1 20250521 (Red Hat 15.1.1-2) * running under: Fedora Linux 42 (Workstation Edition) * using session charset: UTF-8 * using option ‘--no-stop-on-test-error’ * checking for file ‘MOSAlloc/DESCRIPTION’ ... OK * this is package ‘MOSAlloc’ version ‘1.2.3’ * 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 ‘MOSAlloc’ can be installed ... [7s/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 ... [16s/47s] 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 examples ... [5s/11s] ERROR Running examples in ‘MOSAlloc-Ex.R’ failed The error most likely occurred in: > ### Name: mosallocSTRS > ### Title: (Single-stage) stratified random sampling interface for > ### functions 'mosalloc()' and 'mosallocStepwiseFirst()' > ### Aliases: mosallocSTRS > > ### ** Examples > > # Artificial population of 50 568 business establishments and 5 business > # sectors (data from Valliant, R., Dever, J. A., & Kreuter, F. (2013). > # Practical tools for designing and weighting survey samples. Springer. > # https://doi.org/10.1007/978-1-4614-6449-5, Example 5.2 pages 133-9) > > # See also https://umd.app.box.com/s/9yvvibu4nz4q6rlw98ac/file/297813512360 > # file: Code 5.3 constrOptim.example.R > > Nh <- c(6221, 11738, 4333, 22809, 5467) # stratum sizes > ch <- c(120, 80, 80, 90, 150) # stratum-specific cost of surveying > > # Revenues > mh.rev <- c(85, 11, 23, 17, 126) # mean revenue > Sh.rev <- c(170.0, 8.8, 23.0, 25.5, 315.0) # standard deviation revenue > > # Employees > mh.emp <- c(511, 21, 70, 32, 157) # mean number of employees > Sh.emp <- c(255.50, 5.25, 35.00, 32.00, 471.00) # std. dev. employees > > # Proportion of estabs claiming research credit > ph.rsch <- c(0.8, 0.2, 0.5, 0.3, 0.9) > > # Proportion of estabs with offshore affiliates > ph.offsh <- c(0.06, 0.03, 0.03, 0.21, 0.77) > > budget <- 300000 # overall available budget > n.min <- 100 # minimum stratum-specific sample size > > # Matrix containing stratum-specific variance components > X_var <- cbind(Sh.rev**2, + Sh.emp**2, + ph.rsch * (1 - ph.rsch) * Nh/(Nh - 1), + ph.offsh * (1 - ph.offsh) * Nh/(Nh - 1)) > colnames(X_var) <- c("rev", "emp", "rsch", "offsh") > > # Matrix containing stratum-specific totals > X_tot <- cbind(mh.rev, mh.emp, ph.rsch, ph.offsh) * Nh > colnames(X_tot) <- c("rev", "emp", "rsch", "offsh") > > # Examples > #---------------------------------------------------------------------------- > # Example 1: Univariate minimization of the variation of estimates for > # revenue subject to cost restrictions and precision restrictions to the > # relative standard error of estimates for the proportion of businesses with > # offshore affiliates. Additionally, there is one overall cost constraint and > # at least half of the provided budget must be spend to strata 1 to 3. > > # Specify objectives via listD > listD <- list(list(stratum_id = 1:5, variate = "rev", measure = "relVAR", + name = "pop")) > > # Specify precision constraints via listA > listA <- list(list(stratum_id = 1:5, variate = "offsh", measure = "RSE", + bound = 0.05, name = "pop")) > > # Specify cost constraints via listC > listC <- list(list(stratum_id = 1:5, c_coef = ch, c_lower = NULL, + c_upper = budget, name = "Overall"), + list(stratum_id = 1:3, c_coef = ch[1:3], + c_lower = 0.5 * budget, c_upper = NULL, name = "1to3")) > > # Specify stratum-specific box constraints > l <- rep(n.min, 5) # minimum sample size per stratum > u <- Nh # maximum sample size per stratum > > # Specify parameter for mosalloc (method = "WSS") > opts <- list(sense = "max_precision", + f = NULL, df = NULL, Hf = NULL, + method = "WSS", init_w = 1, + mc_cores = 1L, pm_tol = 1e-05, + max_iters = 100L, print_pm = FALSE) > > # Run mosallocSTRS with weighted sum scalarization (WSS) > resWSS <- mosallocSTRS(X_var, X_tot, Nh, listD, listA, listC, + fpc = TRUE, l, u, opts) ---------------------------------------------------------- mosalloc running... TotalTime InnerTime ECOS_runtime ECOS_tsetup ECOS_tsolve 0.031 0.022 0.000455262 7.7955e-05 0.000377307 -> ECOSolveR statement: Optimal solution found! ---------------------------------------------------------- > > summary(resWSS) -------------------------------------------------------------------------- Summary of a mosaSTRS object -------------------------------------------------------------------------- Sense of optimization: max_precision Method used : WSS (Weighted Sum Scalarization) To see the problem matrices and vectors, type: resWSS$problem_components Objectives and preference weighting: value measure sensitivity init_w_WCM init_w_WSS RSE rev_pop 0.001551752 relVAR 1 1 1 0.03939228 Precision constraints: value bound measure sensitivity offsh_pop 0.05 0.05 RSE 0.06188029 Cost constraints: opt_cost bound sensitivity Overall_upper 300000 300000 1.035354e-08 1to3_lower 150000 150000 -7.840068e-09 The corresponding optimal sample sizes are: [1] 1052.0869 168.7578 128.1120 408.5784 754.8530 -------------------------------------------------------------------------- > > # Specify parameter for mosalloc (method = "WCM") > opts = list(sense = "max_precision", + f = NULL, df = NULL, Hf = NULL, + method = "WCM", init_w = 1, + mc_cores = 1L, pm_tol = 1e-05, + max_iters = 100L, print_pm = FALSE) > > # Run mosallocSTRS with weighted Chebyshec minimization (WCM) > resWCM <- mosallocSTRS(X_var, X_tot, Nh, listD, listA, listC, + fpc = TRUE, l, u, opts) ---------------------------------------------------------- mosalloc running... TotalTime InnerTime ECOS_runtime ECOS_tsetup ECOS_tsolve 0.016 0.007 0.004504897 6.9684e-05 0.004435213 -> ECOSolveR statement: Optimal solution found! ---------------------------------------------------------- > > summary(resWCM) -------------------------------------------------------------------------- Summary of a mosaSTRS object -------------------------------------------------------------------------- Sense of optimization: max_precision Method used : WCM (Weighted Chebyshev Minimization) To see the problem matrices and vectors, type: resWCM$problem_components Objectives and preference weighting: value measure sensitivity init_w RSE rev_pop 0.001551752 relVAR 1 1 0.03939228 Precision constraints: value bound measure sensitivity offsh_pop 0.05 0.05 RSE 0.06188029 Cost constraints: opt_cost bound sensitivity Overall_upper 300000 300000 1.035354e-08 1to3_lower 150000 150000 -7.840068e-09 The corresponding optimal sample sizes are: [1] 1052.0869 168.7578 128.1120 408.5784 754.8530 -------------------------------------------------------------------------- > > # The optimal sample sizes vector can also be obtained by > summary(resWCM)$n_opt [1] 1052.0869 168.7578 128.1120 408.5784 754.8530 > > # Hint: For univariate allocation problems 'WSS' and 'WCM' are equivalent! > > #---------------------------------------------------------------------------- > # Example 2: Minimization of the maximum relative variation of estimates for > # the total revenue, the number of employee, the number of businesses claimed > # research credit and the number of businesses with offshore affiliates > # subject to one overall cost constraint and at least half of the provided > # budget must be spend to strata 1 to 3. > > # Specify objectives via listD > listD <- list(list(stratum_id = 1:5, variate = "rev", measure = "relVAR", + name = "pop"), + list(stratum_id = 1:5, variate = "emp", measure = "relVAR", + name = "pop"), + list(stratum_id = 1:5, variate = "rsch", measure = "relVAR", + name = "pop"), + list(stratum_id = 1:5, variate = "offsh", measure = "relVAR", + name = "pop")) > > # Specify cost constraints via listC > listC <- list(list(stratum_id = 1:5, c_coef = ch, c_lower = NULL, + c_upper = budget, name = "Overall"), + list(stratum_id = 1:3, c_coef = ch[1:3], + c_lower = 0.5 * budget, c_upper = NULL, name = "1to3")) > > # Specify stratum-specific box constraints > l <- rep(n.min, 5) # minimum sample size per stratum > u <- Nh # maximum sample size per stratum > > # Specify parameter for mosalloc (method = "WSS") > opts = list(sense = "max_precision", + f = NULL, df = NULL, Hf = NULL, + method = "WSS", init_w = 1, + mc_cores = 1L, pm_tol = 1e-05, + max_iters = 100L, print_pm = FALSE) > > # Run mosallocSTRS with weighted sum scalarization (WSS) > resWSS <- mosallocSTRS(X_var, X_tot, Nh, listD, NULL, listC, + fpc = TRUE, l, u, opts) ---------------------------------------------------------- mosalloc running... Error in mosalloc(WSS_weight %*% Dc$D, as.vector(WSS_weight %*% Dc$d), : d is not an utopian vector! d is too large. Calls: mosallocSTRS -> mosalloc Execution halted * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... Running ‘testthat.R’ [5s/14s] [6s/15s] OK * checking PDF version of manual ... [8s/17s] OK * checking HTML version of manual ... [4s/11s] 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/gannet/ripley/R/packages/tests-MKL/MOSAlloc.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 2:46.00, 60.38 + 7.08