* using log directory ‘/data/blackswan/ripley/R/packages/tests-devel/PMA2.Rcheck’ * using R Under development (unstable) (2023-03-18 r84003) * using platform: x86_64-pc-linux-gnu (64-bit) * R was compiled by gcc (GCC) 11.3.1 20220421 (Red Hat 11.3.1-2) GNU Fortran (GCC) 11.3.1 20220421 (Red Hat 11.3.1-2) * running under: Fedora 34 (Workstation Edition) * using session charset: UTF-8 * checking for file ‘PMA2/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘PMA2’ version ‘2.1’ * 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 ‘PMA2’ can be installed ... [25s/18s] OK * used C compiler: ‘gcc (GCC) 11.3.1 20220421 (Red Hat 11.3.1-2)’ * used C++ compiler: ‘g++ (GCC) 11.3.1 20220421 (Red Hat 11.3.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 R 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 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 ... [15s/15s] 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 compilation flags used ... OK * checking compiled code ... OK * checking examples ... OK * checking examples with --run-donttest ... ERROR Running examples in ‘PMA2-Ex.R’ failed The error most likely occurred in: > ### Name: PMD > ### Title: Get a penalized matrix decomposition for a data matrix. > ### Aliases: PMD > > ### ** Examples > > > ## No test: > # Try PMD with L1 penalty on rows and columns: type="standard" > # A simple simulated example > set.seed(1) > # Our data is a rank-one matrix, plus noise. The underlying components > # contain 50 and 75 non-zero elements, respectively. > u <- matrix(c(rnorm(50), rep(0,150)), + ncol=1) > v <- matrix(c(rnorm(75),rep(0,225)), ncol=1) > x <- u%*%t(v)+ + matrix(rnorm(200*300),ncol=300) > # We can use cross-validation to try to find optimal value of sumabs > cv.out <- PMD.cv(x, type="standard", sumabss=seq(0.1, 0.6, len=20)) Fold 1 out of 5 Fold 2 out of 5 Fold 3 out of 5 Fold 4 out of 5 Fold 5 out of 5 > print(cv.out) Call: PMD.cv(x = x, type = "standard", sumabss = seq(0.1, 0.6, len = 20)) Cross-validation errors: Sumabss CV Error CV S.E. # non-zero u's # non-zero v's 1 0.100 12511.99 65.980 3.2 6.2 2 0.126 12507.11 65.421 5.6 10.0 3 0.153 12482.25 61.530 8.4 14.4 4 0.179 12444.72 60.707 11.4 18.4 5 0.205 12402.67 62.207 15.4 23.0 6 0.232 12365.26 63.255 20.4 29.0 7 0.258 12320.78 63.460 26.8 36.2 8 0.284 12274.95 62.664 30.8 41.4 9 0.311 12236.14 61.586 37.0 55.0 10 0.337 12211.25 60.179 45.8 71.8 11 0.363 12197.69 58.599 60.4 93.0 12 0.389 12191.04 57.163 77.2 113.6 13 0.416 12188.82 56.201 95.0 139.6 14 0.442 12189.90 55.139 111.8 158.6 15 0.468 12193.14 53.963 129.8 183.0 16 0.495 12197.60 52.890 149.6 204.4 17 0.521 12202.96 52.005 164.2 224.4 18 0.547 12209.56 51.190 176.8 247.2 19 0.574 12216.98 50.351 192.8 266.4 20 0.600 12223.26 49.441 200.0 285.6 Best sumabs value (lowest CV error): 0.4157895 > plot(cv.out) > # The optimal value of sumabs is 0.4157, but we can get within one > # standard error of that CV error using sumabs=0.337, which corresponds to > # an average of 45.8 and 71.8 non-zero elements in each component - pretty > # close to the true model. > # We can fit the model corresponding to the lowest cross-validation error: > out <- PMD(x, type="standard", sumabs=cv.out$bestsumabs, K=1, v=cv.out$v.init) 1234567891011 > print(out) Call: PMD(x = x, type = "standard", sumabs = cv.out$bestsumabs, K = 1, v = cv.out$v.init) Num non-zero u's: 95 Num non-zero v's: 134 Sumabsu used: 5.880151 Sumabsv used: 7.201685 Subtracted out mean of x: -0.003487992 > oldpar <- par(mfrow = c(1,1)) > par(mfrow=c(2,2)) > par(mar=c(2,2,2,2)) > plot(out$u[,1], main="Est. u") > plot(out$v[,1], main="Est. v") > plot(u, main="True u") > plot(v, main="True v") > # And if we want to control sumabsu and sumabsv separately, we can do > # that too. Let's get 2 components while we're at it: > out2 <- PMD(x, type="standard", K=2, sumabsu=6, sumabsv=8, v=out$v.init, + cnames=paste("v", sep=" ", 1:ncol(x)), rnames=paste("u", sep=" ", 1:nrow(x))) 123456789101112 1234567891011121314151617181920 > print(out2) Call: PMD(x = x, type = "standard", sumabsu = 6, sumabsv = 8, K = 2, v = out$v.init, rnames = paste("u", sep = " ", 1:nrow(x)), cnames = paste("v", sep = " ", 1:ncol(x))) Num non-zero u's: 101 70 Num non-zero v's: 175 120 Sumabsu used: 6 Sumabsv used: 8 Subtracted out mean of x: -0.003487992 > > # Now check out PMD with L1 penalty on rows and fused lasso penalty on > # columns: type="ordered". We'll use the Chin et al (2006) Cancer Cell > # data set; try "?breastdata" for more info. > > data(breastdata) Warning in data(breastdata) : data set ‘breastdata’ not found > attach(breastdata) Error: object 'breastdata' not found Execution halted * checking PDF version of manual ... OK * checking for non-standard things in the check directory ... OK * checking for detritus in the temp directory ... OK * checking for new files in some other directories ... OK * DONE Status: 1 ERROR See ‘/data/blackswan/ripley/R/packages/tests-devel/PMA2.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 1:07.41, 64.87 + 8.62