* using log directory ‘/srv/hornik/tmp/CRAN_pretest/scalablebayesm.Rcheck’ * using R Under development (unstable) (2025-02-14 r87718) * using platform: x86_64-pc-linux-gnu * R was compiled by Debian clang version 19.1.6 (1+b1) Debian flang-new version 19.1.6 (1+b1) * running under: Debian GNU/Linux trixie/sid * using session charset: UTF-8 * checking for file ‘scalablebayesm/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘scalablebayesm’ version ‘0.2’ * package encoding: UTF-8 * checking CRAN incoming feasibility ... [3s/3s] NOTE Maintainer: ‘Federico Bumbaca ’ New submission Possibly misspelled words in DESCRIPTION: Bumbaca (19:104) Misra (19:124) Rossi (19:137) Scalable (19:185) The Description field contains Misra, S., & Rossi, P. E. (2020) doi:10.1177/002224372095241 Scalable Please write DOIs as . * 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 serialization versions ... OK * checking whether package ‘scalablebayesm’ can be installed ... [57s/57s] OK * used C++ compiler: ‘Debian clang version 19.1.7 (1+b1)’ * checking package directory ... OK * checking for future file timestamps ... 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 ... [0s/0s] OK * checking whether the package can be loaded with stated dependencies ... [0s/0s] OK * checking whether the package can be unloaded cleanly ... [0s/0s] OK * checking whether the namespace can be loaded with stated dependencies ... [0s/0s] OK * checking whether the namespace can be unloaded cleanly ... [0s/0s] OK * checking loading without being on the library search path ... [0s/0s] 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 ... [4s/4s] OK * checking Rd files ... [0s/0s] 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 line endings in Makefiles ... OK * checking compilation flags in Makevars ... OK * checking for GNU extensions in Makefiles ... OK * checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK * checking use of PKG_*FLAGS in Makefiles ... OK * checking use of SHLIB_OPENMP_*FLAGS in Makefiles ... OK * checking pragmas in C/C++ headers and code ... OK * checking compilation flags used ... OK * checking compiled code ... OK * checking examples ... [6s/3s] ERROR Running examples in ‘scalablebayesm-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: drawMixture > ### Title: Gibbs Sampler Inference for a Mixture of Multivariate Normals > ### Aliases: drawMixture > > ### ** Examples > > > # Linear DP > ## Generate single component linear data with Z > R = 1000 > nreg = 1000 > nobs = 5 #number of observations > nvar = 3 #columns > nz = 2 > > Z=matrix(runif(nreg*nz),ncol=nz) > Z=t(t(Z)-apply(Z,2,mean)) > Delta=matrix(c(1,0,1,0,1,2),ncol=nz) > tau0=1 > iota=c(rep(1,nobs)) > > ## create arguments for rmixture > tcomps=NULL > a = diag(1, nrow=3) > tcomps[[1]] = list(mu=c(1,-2,0),rooti=a) > tpvec = 1 > ncomp=length(tcomps) > > regdata=NULL > betas=matrix(double(nreg*nvar),ncol=nvar) > tind=double(nreg) > > for (reg in 1:nreg) { + tempout=bayesm::rmixture(1,tpvec,tcomps) + if (is.null(Z)){ + betas[reg,]= as.vector(tempout$x) + }else{ + betas[reg,]=Delta%*%Z[reg,]+as.vector(tempout$x)} + tind[reg]=tempout$z + X=cbind(iota,matrix(runif(nobs*(nvar-1)),ncol=(nvar-1))) + tau=tau0*runif(1,min=0.5,max=1) + y=X%*%betas[reg,]+sqrt(tau)*rnorm(nobs) + regdata[[reg]]=list(y=y,X=X,beta=betas[reg,],tau=tau) + } > > Prior1=list(ncomp=ncomp) > keep=1 > Mcmc1=list(R=R,keep=keep) > Data1=list(list(regdata=regdata,Z=Z)) > > #subsample data > N = length(Data1[[1]]$regdata) > > s=2 > > #Partition data into s shards > Data2 = partition_data(Data = Data1, s = s) > > #Run distributed first stage > timing_result1 = system.time({ + out_distributed = parallel::mclapply(Data2, FUN = rhierLinearDPParallel, + Prior = Prior1, Mcmc = Mcmc1, mc.cores = s, mc.set.seed = FALSE) + }) Starting MCMC Inference for Hierarchical Logit: Dirichlet Process Prior for 500 cross-sectional units Prior Parms: G0 ~ N(mubar,Sigma (x) Amu^-1) mubar = 0 Sigma ~ IW(nu,nu*v*I) Amu ~ uniform[ 0.01 , 10 ] nu ~ uniform on log grid [ 3.01005 , 22.08554 ] v ~ uniform[ 0.1 , 4 ] alpha ~ (1-(alpha-alphamin)/(alphamax-alphamin))^power Istarmin = 1 Istarmax = 50 alphamin = 0.08266697 alphamax = 7.288299 power = 0.8 Starting MCMC Inference for Hierarchical Logit: Dirichlet Process Prior for 500 cross-sectional units Prior Parms: G0 ~ N(mubar,Sigma (x) Amu^-1) mubar = 0 Sigma ~ IW(nu,nu*v*I) Amu ~ uniform[ 0.01 , 10 ] nu ~ uniform on log grid [ 3.01005 , 22.08554 ] v ~ uniform[ 0.1 , 4 ] alpha ~ (1-(alpha-alphamin)/(alphamax-alphamin))^power Istarmin = 1 Istarmax = 50 alphamin = 0.08266697 alphamax = 7.288299 power = 0.8 MCMC Iteration (est time to end - min) MCMC Iteration (est time to end - min) MCMC Iteration (est time to end - min) MCMC Iteration (est time to end - min) 100 (0.0) 100 (0.0) 200 (0.0) 200 (0.0) 300 (0.0) 300 (0.0) 400 (0.0) 400 (0.0) 500 (0.0) 500 (0.0) 600 (0.0) 600 (0.0) 700 (0.0) 700 (0.0) 800 (0.0) 800 (0.0) 900 (0.0) 1000 (0.0) Total Time Elapsed: 0.00 900 (0.0) 1000 (0.0) Total Time Elapsed: 0.00 > > Z = matrix(unlist(Z), ncol = nz, byrow = TRUE) > > # Conduct inference on first-stage draws > draws = parallel::mclapply(out_distributed, FUN = drawMixture, + Prior=NULL, Mcmc=Mcmc1, N=N, Z = Z, + mc.cores = s, mc.set.seed = FALSE) requires number of mix comps -- Prior$ncomp Starting Gibbs Sampler for Mixture of Normals 1000 observations on 3 dimensional data Using 1 mixture components Prior Parameters: mu_j ~ N(mubar, Sigma (x) A^-1) mubar = [,1] [,2] [,3] [1,]requires number of mix comps -- Prior$ncomp 0 0 0 Precision parameter for prior variance of mu vectors (A) = 0.01 Starting Gibbs Sampler for Mixture of Normals Sigma_j ~ IW(nu, V) nu = 6 V = [,1] [,2] [,3] [1,] 6 0 0 [2,] 0 6 0 [3,] 0 0 6 1000 observations on 3 dimensional data Dirichlet parameters [1] 5 Using 1 mixture components deltabar [1] 0 0 0 0 0 0 Prior Parameters: Ad [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.01 0.00 0.00 0.00 0.00 0.00 [2,] 0.00 0.01 0.00 0.00 0.00 0.00 [3,] 0.00 0.00 0.01 0.00 0.00 0.00 [4,] 0.00 0.00 0.00 0.01 0.00 0.00 [5,] 0.00 0.00 0.00 0.00 0.01 0.00 [6,] 0.00 0.00 0.00 0.00 0.00 0.01 mu_j ~ N(mubar, Sigma (x) A^-1) mubar = MCMC Parameters: R = 1000 keep = 1 nprint = 100 LogLike = FALSE TRUE [,1] [,2] [,3] [1,]starting value for indTRUE 0 0 0 Precision parameter for prior variance of mu vectors (A) = 0.01 Sigma_j ~ IW(nu, V) nu = 6 V = [,1] [,2] [,3] [1,] 6 0 0 [2,] 0 6 0 [3,] 0 0 6 Dirichlet parameters [1] 5 deltabar [1] 0 0 0 0 0 0 Ad [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.01 0.00 0.00 0.00 0.00 0.00 [2,] 0.00 0.01 0.00 0.00 0.00 0.00 [3,] 0.00 0.00 0.01 0.00 0.00 0.00 [4,] 0.00 0.00 0.00 0.01 0.00 0.00 [5,] 0.00 0.00 0.00 0.00 0.01 0.00 [6,] 0.00 0.00 0.00 0.00 0.00 0.01 MCMC Parameters: R = 1000 keep = 1 nprint = 100 LogLike = FALSE TRUE starting value for indTRUE 1000 TRUE 1000 TRUE MCMC Iteration (est time to end - min) MCMC Iteration (est time to end - min) 100 (0.0) 100 (0.0) 200 (0.0) 200 (0.0) 300 (0.0) 300 (0.0) 400 (0.0) 400 (0.0) 500 (0.0) 500 (0.0) 600 (0.0) 600 (0.0) 700 (0.0) 700 (0.0) 800 (0.0) 800 (0.0) 900 (0.0) 900 (0.0) 1000 (0.0) Total Time Elapsed: 0.02 1000 (0.0) Total Time Elapsed: 0.02 > > #Generate single component multinomial data with Z > ##parameters > R = 1000 > p = 3 # number of choice alternatives > ncoef = 3 > nlgt=1000 > nz = 2 > > # Define Z matrix > Z = matrix(runif(nz*nlgt),ncol=nz) > Z = t(t(Z)-apply(Z,2,mean)) # demean Z > Delta=matrix(c(1,0,1,0,1,2),ncol=2) > > tcomps=NULL > a = diag(1, nrow=3) > tcomps[[1]] = list(mu=c(-1,2,4),rooti=a) > tpvec = 1 > ncomp=length(tcomps) > > simmnlwX= function(n,X,beta){ + k=length(beta) + Xbeta=X %*% beta + j=nrow(Xbeta)/n + Xbeta=matrix(Xbeta,byrow=TRUE,ncol=j) + Prob=exp(Xbeta) + iota=c(rep(1,j)) + denom=Prob %*% iota + Prob=Prob/as.vector(denom) + y=vector("double",n) + ind=1:j + for (i in 1:n) { + yvec = rmultinom(1, 1, Prob[i,]) + y[i] = ind%*%yvec + } + return(list(y=y,X=X,beta=beta,prob=Prob)) + } > > ## simulate data > simlgtdata=NULL > ni=rep(5,nlgt) > for (i in 1:nlgt) + { + if (is.null(Z)) + { + betai=as.vector(rmixture(1,tpvec,tcomps)$x) + } else { + betai=Delta %*% Z[i,]+as.vector(rmixture(1,tpvec,tcomps)$x) + } + Xa=matrix(runif(ni[i]*p,min=-1.5,max=0),ncol=p) + X=createX(p,na=1,nd=NULL,Xa=Xa,Xd=NULL,base=1) + outa=simmnlwX(ni[i],X,betai) + simlgtdata[[i]]=list(y=outa$y,X=X,beta=betai) + } Error in rmixture(1, tpvec, tcomps) : could not find function "rmixture" Calls: as.vector Execution halted * checking PDF version of manual ... [3s/3s] OK * checking HTML version of manual ... [1s/1s] OK * checking for non-standard things in the check directory ... OK * checking for detritus in the temp directory ... OK * DONE Status: 1 ERROR, 1 NOTE