==1149018== Memcheck, a memory error detector ==1149018== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==1149018== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info ==1149018== Command: /data/blackswan/ripley/R/R-devel-vg/bin/exec/R --vanilla ==1149018== R Under development (unstable) (2021-03-19 r80100) -- "Unsuffered Consequences" Copyright (C) 2021 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > pkgname <- "icemelt" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('icemelt') > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("im") > ### * im > > flush(stderr()); flush(stdout()) > > ### Name: im > ### Title: Parameter Estimation in Linear Transformation Model with > ### Interval-censored Data and Covariate Measurement Error > ### Aliases: im > > ### ** Examples > > ## this function is used in generating epsilon from its CDF > rsep= function(u,r) + { + if(r==0) + return( log(-log(1-u)) ) + else + return( log((exp(-r*log(1-u))-1)/r) ) + } > > > n= 30 #200 # sample size; small number used for quick demonstration only > rfix= 1.0 > > m= 3 #10 # imputed datasets for failure time; small number used for quick demonstration only > > nrep= 2 # number of repeated measurement of error prone covariate > > gridlen= 0.1 > > result= NULL > ah=1 > > set.seed(ah) > > # z1= rnorm(n, mean= 0, sd=1) > z1= (rgamma(n,shape=2,scale=2)-4)/sqrt(8) > z2= rbinom(n,1,0.5) > > ugen= runif(n) > ep= rsep(ugen,rfix) > > truebeta= c(-1,1) > > logt= -truebeta[1]*z1 -truebeta[2]*z2 + ep + 3 > ttime= exp(logt) > > cen= runif(n,0,0.0001) > > ## creating tau matrix to locate the actual times in each rows and form the corresponding intervals > len= 0.15 > taumat= matrix(0,n,10) > taumat[,10]= 9000000000 # if you're changing this, change rcpos below > taumat[,2]= cen > for(i1 in 3:9) + taumat[,i1]= taumat[,2]+(i1-1)*len > > ## now forming the intervals > right1= rep(0,n) > left= rep(0,n) > for(i2 in 1:n) + { + lenleft= length(which(taumat[i2,2:9]ttime[i2])) + rightpot= rep(0,9) + rightpot[(9-lenright+1):9]= 1 + missvec2= c(rbinom(4,1,0.7),rbinom(4,1,0.5),1) + right1temp= rightpot*missvec2*taumat[i2,2:10] + right1[i2]= min(right1temp[right1temp!=0]) + } > > rcpos= which(right1==9000000000) > lrcpos= length(rcpos) > notrcpos= (1:n)[-rcpos] > > delta_temp= rep(1,n) # del=1 are uncensored observations > delta_temp[rcpos]= 0 > k= sum(delta_temp) # this is just the number of data points that are not right censored > > ## measurement error generation > umat= matrix((rgamma(n*nrep,shape=2,scale=2)-4)*0.5/sqrt(8),n,nrep) > > wmat= z1+umat > > > datamat= cbind(left,right1,delta_temp,z2) > ntimp= m > nximp= 5 #20 # number of x imputations; small number used for quick demonstration only > > library(icemelt) > out_im= im(datamat, wmat, rfix, gridlen, ntimp, nximp) ==1149018== Conditional jump or move depends on uninitialised value(s) ==1149018== at 0x1C7D8461: multinom_ (packages/tests-vg/icemelt/src/icemelt.f90:3427) ==1149018== by 0x1C7EF690: mh_parkcmp_ (packages/tests-vg/icemelt/src/icemelt.f90:3576) ==1149018== by 0x49F825: do_dotCode (svn/R-devel/src/main/dotcode.c:1899) ==1149018== by 0x4D3566: bcEval (svn/R-devel/src/main/eval.c:7115) ==1149018== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1149018== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1149018== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==1149018== by 0x4F0243: Rf_eval (svn/R-devel/src/main/eval.c:850) ==1149018== by 0x4F4299: do_set (svn/R-devel/src/main/eval.c:2969) ==1149018== by 0x4F04C4: Rf_eval (svn/R-devel/src/main/eval.c:802) ==1149018== by 0x52123C: Rf_ReplIteration (svn/R-devel/src/main/main.c:264) ==1149018== by 0x521587: R_ReplConsole (svn/R-devel/src/main/main.c:314) ==1149018== Uninitialised value was created by a heap allocation ==1149018== at 0x483A809: malloc (/builddir/build/BUILD/valgrind-3.16.1/coregrind/m_replacemalloc/vg_replace_malloc.c:307) ==1149018== by 0x1C7EE781: mh_parkcmp_ (packages/tests-vg/icemelt/src/icemelt.f90:3485) ==1149018== by 0x49F825: do_dotCode (svn/R-devel/src/main/dotcode.c:1899) ==1149018== by 0x4D3566: bcEval (svn/R-devel/src/main/eval.c:7115) ==1149018== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1149018== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1149018== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==1149018== by 0x4F0243: Rf_eval (svn/R-devel/src/main/eval.c:850) ==1149018== by 0x4F4299: do_set (svn/R-devel/src/main/eval.c:2969) ==1149018== by 0x4F04C4: Rf_eval (svn/R-devel/src/main/eval.c:802) ==1149018== by 0x52123C: Rf_ReplIteration (svn/R-devel/src/main/main.c:264) ==1149018== by 0x521587: R_ReplConsole (svn/R-devel/src/main/main.c:314) ==1149018== > out_im $beta1.est [1] -0.4860104 $beta2.est [1] -36.00129 $beta1.sd [1] 1.264149 $beta2.sd [1] 47266741 > > > > > cleanEx() > nameEx("imw1") > ### * imw1 > > flush(stderr()); flush(stdout()) > > ### Name: imw1 > ### Title: Parameter Estimation in Linear Transformation Model with > ### Interval-censored Data and Covariate Measurement Error > ### Aliases: imw1 > > ### ** Examples > > ## this function is used in generating epsilon from its CDF > rsep= function(u,r) + { + if(r==0) + return( log(-log(1-u)) ) + else + return( log((exp(-r*log(1-u))-1)/r) ) + } > > > n= 30 #200 # sample size; small number used for quick demonstration only > rfix= 1.0 > > > m= 3 #10 # imputed datasets for failure time; small number used for quick demonstration only > > nrep= 1 # number of repeated measurement of error prone covariate > > gridlen= 0.1 > sigma2u= 0.5 > > result= NULL > ah=1 > > set.seed(ah) > > # z1= rnorm(n, mean= 0, sd=1) > z1= (rgamma(n,shape=2,scale=2)-4)/sqrt(8) > z2= rbinom(n,1,0.5) > > ugen= runif(n) > ep= rsep(ugen,rfix) > > truebeta= c(-1,1) > > logt= -truebeta[1]*z1 -truebeta[2]*z2 + ep + 3 > ttime= exp(logt) > > cen= runif(n,0,0.0001) > > ## creating tau matrix to locate the actual times in each rows and form the corresponding intervals > len= 0.15 > taumat= matrix(0,n,10) > taumat[,10]= 9000000000 # if you're changing this, change rcpos below > taumat[,2]= cen > for(i1 in 3:9) + taumat[,i1]= taumat[,2]+(i1-1)*len > > ## now forming the intervals > right1= rep(0,n) > left= rep(0,n) > for(i2 in 1:n) + { + lenleft= length(which(taumat[i2,2:9]ttime[i2])) + rightpot= rep(0,9) + rightpot[(9-lenright+1):9]= 1 + missvec2= c(rbinom(4,1,0.7),rbinom(4,1,0.5),1) + right1temp= rightpot*missvec2*taumat[i2,2:10] + right1[i2]= min(right1temp[right1temp!=0]) + } > > rcpos= which(right1==9000000000) > lrcpos= length(rcpos) > notrcpos= (1:n)[-rcpos] > > delta_temp= rep(1,n) # del=1 are uncensored observations > delta_temp[rcpos]= 0 > k= sum(delta_temp) # number of data points that are not right censored > > ## measurement error generation > umat= matrix((rgamma(n*nrep,shape=2,scale=2)-4)*0.5/sqrt(8),n,nrep) > > wmat= z1+umat > > > datamat= cbind(left,right1,delta_temp,z2) > ntimp= m > nximp= 5 #20 # number of x imputations; small number used for quick demonstration only > > library(icemelt) > out_imw1= imw1(datamat, wmat, rfix, gridlen, ntimp, nximp, sigma2u) ==1149018== Conditional jump or move depends on uninitialised value(s) ==1149018== at 0x1C7D8461: multinom_ (packages/tests-vg/icemelt/src/icemelt.f90:3427) ==1149018== by 0x1C7F1A04: mh_parkcmpw1_ (packages/tests-vg/icemelt/src/icemelt.f90:3771) ==1149018== by 0x49F78D: do_dotCode (svn/R-devel/src/main/dotcode.c:1886) ==1149018== by 0x4D3566: bcEval (svn/R-devel/src/main/eval.c:7115) ==1149018== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1149018== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1149018== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==1149018== by 0x4F0243: Rf_eval (svn/R-devel/src/main/eval.c:850) ==1149018== by 0x4F4299: do_set (svn/R-devel/src/main/eval.c:2969) ==1149018== by 0x4F04C4: Rf_eval (svn/R-devel/src/main/eval.c:802) ==1149018== by 0x52123C: Rf_ReplIteration (svn/R-devel/src/main/main.c:264) ==1149018== by 0x521587: R_ReplConsole (svn/R-devel/src/main/main.c:314) ==1149018== Uninitialised value was created by a heap allocation ==1149018== at 0x483A809: malloc (/builddir/build/BUILD/valgrind-3.16.1/coregrind/m_replacemalloc/vg_replace_malloc.c:307) ==1149018== by 0x1C7F0B91: mh_parkcmpw1_ (packages/tests-vg/icemelt/src/icemelt.f90:3680) ==1149018== by 0x49F78D: do_dotCode (svn/R-devel/src/main/dotcode.c:1886) ==1149018== by 0x4D3566: bcEval (svn/R-devel/src/main/eval.c:7115) ==1149018== by 0x4F0077: Rf_eval (svn/R-devel/src/main/eval.c:727) ==1149018== by 0x4F1A8D: R_execClosure (svn/R-devel/src/main/eval.c:1897) ==1149018== by 0x4F2783: Rf_applyClosure (svn/R-devel/src/main/eval.c:1823) ==1149018== by 0x4F0243: Rf_eval (svn/R-devel/src/main/eval.c:850) ==1149018== by 0x4F4299: do_set (svn/R-devel/src/main/eval.c:2969) ==1149018== by 0x4F04C4: Rf_eval (svn/R-devel/src/main/eval.c:802) ==1149018== by 0x52123C: Rf_ReplIteration (svn/R-devel/src/main/main.c:264) ==1149018== by 0x521587: R_ReplConsole (svn/R-devel/src/main/main.c:314) ==1149018== > out_imw1 $beta1.est [1] 1.238398 $beta2.est [1] -37.88589 $beta1.sd [1] 2.713574 $beta2.sd [1] 59282157 > > > > > cleanEx() > nameEx("nv") > ### * nv > > flush(stderr()); flush(stdout()) > > ### Name: nv > ### Title: Parameter Estimation in Linear Transformation Model with > ### Interval-censored Data and Covariate Measurement Error > ### Aliases: nv > > ### ** Examples > > ## this function is used in generating epsilon from its CDF > rsep= function(u,r) + { + if(r==0) + return( log(-log(1-u)) ) + else + return( log((exp(-r*log(1-u))-1)/r) ) + } > > > n= 30 #200 # sample size; small number used for quick demonstration only > rfix= 1.0 > > > m= 3 #10 # imputed datasets for failure time; small number used for quick demonstration only > > nrep= 2 # number of repeated measurement of error prone covariate > > gridlen= 0.1 > > result= NULL > ah=1 > > set.seed(ah) > > # z1= rnorm(n, mean= 0, sd=1) > z1= (rgamma(n,shape=2,scale=2)-4)/sqrt(8) > z2= rbinom(n,1,0.5) > > ugen= runif(n) > ep= rsep(ugen,rfix) > > truebeta= c(-1,1) > > logt= -truebeta[1]*z1 -truebeta[2]*z2 + ep + 3 > ttime= exp(logt) > > cen= runif(n,0,0.0001) > > ## creating tau matrix to locate the actual times in each rows and form the corresponding intervals > len= 0.15 > taumat= matrix(0,n,10) > taumat[,10]= 9000000000 # if you're changing this, change rcpos below > taumat[,2]= cen > for(i1 in 3:9) + taumat[,i1]= taumat[,2]+(i1-1)*len > > ## now forming the intervals > right1= rep(0,n) > left= rep(0,n) > for(i2 in 1:n) + { + lenleft= length(which(taumat[i2,2:9]ttime[i2])) + rightpot= rep(0,9) + rightpot[(9-lenright+1):9]= 1 + missvec2= c(rbinom(4,1,0.7),rbinom(4,1,0.5),1) + right1temp= rightpot*missvec2*taumat[i2,2:10] + right1[i2]= min(right1temp[right1temp!=0]) + } > > rcpos= which(right1==9000000000) > lrcpos= length(rcpos) > notrcpos= (1:n)[-rcpos] > > delta_temp= rep(1,n) # del=1 are uncensored observations > delta_temp[rcpos]= 0 > k= sum(delta_temp) # this is just the number of data points that are not right censored > > ## measurement error generation > umat= matrix((rgamma(n*nrep,shape=2,scale=2)-4)*0.5/sqrt(8),n,nrep) > > wmat= z1+umat > > > datamat= cbind(left,right1,delta_temp,z2) > ntimp= m > > library(icemelt) > out_nv= nv(datamat, wmat, rfix, gridlen, ntimp) > out_nv $beta1.est [1] -0.1236619 $beta2.est [1] -35.98769 $beta1.sd [1] 1.054451 $beta2.sd [1] 40060307 > > > > > cleanEx() > nameEx("rc") > ### * rc > > flush(stderr()); flush(stdout()) > > ### Name: rc > ### Title: Parameter Estimation in LTM using Regression Calibration with > ### Interval-censored Data and Measurement Error > ### Aliases: rc > > ### ** Examples > > ## this function is used in generating epsilon from its CDF > rsep= function(u,r) + { + if(r==0) + return( log(-log(1-u)) ) + else + return( log((exp(-r*log(1-u))-1)/r) ) + } > > > n= 30 #200 # sample size; small number used for quick demonstration only > rfix= 1.0 > > > m= 3 #10 # imputed datasets for failure time; small number used for quick demonstration only > > nrep= 2 # number of repeated measurement of error prone covariate > > gridlen= 0.1 > > result= NULL > ah=1 > > set.seed(ah) > > # z1= rnorm(n, mean= 0, sd=1) > z1= (rgamma(n,shape=2,scale=2)-4)/sqrt(8) > z2= rbinom(n,1,0.5) > > ugen= runif(n) > ep= rsep(ugen,rfix) > > truebeta= c(-1,1) > > logt= -truebeta[1]*z1 -truebeta[2]*z2 + ep + 3 > ttime= exp(logt) > > cen= runif(n,0,0.0001) > > ## creating tau matrix to locate the actual times in each rows and form the corresponding intervals > len= 0.15 > taumat= matrix(0,n,10) > taumat[,10]= 9000000000 # if you're changing this, change rcpos below > taumat[,2]= cen > for(i1 in 3:9) + taumat[,i1]= taumat[,2]+(i1-1)*len > > ## now forming the intervals > right1= rep(0,n) > left= rep(0,n) > for(i2 in 1:n) + { + lenleft= length(which(taumat[i2,2:9]ttime[i2])) + rightpot= rep(0,9) + rightpot[(9-lenright+1):9]= 1 + missvec2= c(rbinom(4,1,0.7),rbinom(4,1,0.5),1) + right1temp= rightpot*missvec2*taumat[i2,2:10] + right1[i2]= min(right1temp[right1temp!=0]) + } > > rcpos= which(right1==9000000000) > lrcpos= length(rcpos) > notrcpos= (1:n)[-rcpos] > > delta_temp= rep(1,n) # del=1 are uncensored observations > delta_temp[rcpos]= 0 > k= sum(delta_temp) # this is just the number of data points that are not right censored > > ## measurement error generation > umat= matrix((rgamma(n*nrep,shape=2,scale=2)-4)*0.5/sqrt(8),n,nrep) > > wmat= z1+umat > > datamat= cbind(left,right1,delta_temp,z2) > ntimp= m > > library(icemelt) > out_rc= rc(datamat, wmat, rfix, gridlen, ntimp) > out_rc $beta1.est [1] -0.176385 $beta2.est [1] -36.18835 $beta1.sd [1] 1.419972 $beta2.sd [1] 1.419252e+13 > > > > > cleanEx() > nameEx("rcw1") > ### * rcw1 > > flush(stderr()); flush(stdout()) > > ### Name: rcw1 > ### Title: Parameter Estimation in LTM using Regression Calibration with > ### Interval-censored Data and Measurement Error > ### Aliases: rcw1 > > ### ** Examples > > ## this function is used in generating epsilon from its CDF > rsep= function(u,r) + { + if(r==0) + return( log(-log(1-u)) ) + else + return( log((exp(-r*log(1-u))-1)/r) ) + } > > > n= 30 #200 # sample size; small number used for quick demonstration only > rfix= 1.0 > sigma2u= 0.5 > > m= 3 #10 # imputed datasets for failure time; small number used for quick demonstration only > > nrep= 1 # number of repeated measurement of error prone covariate > > gridlen= 0.1 > > result= NULL > ah=1 > > set.seed(ah) > > # z1= rnorm(n, mean= 0, sd=1) > z1= (rgamma(n,shape=2,scale=2)-4)/sqrt(8) > z2= rbinom(n,1,0.5) > > ugen= runif(n) > ep= rsep(ugen,rfix) > > truebeta= c(-1,1) > > logt= -truebeta[1]*z1 -truebeta[2]*z2 + ep + 3 > ttime= exp(logt) > > cen= runif(n,0,0.0001) > > ## creating tau matrix to locate the actual times in each rows and form the corresponding intervals > len= 0.15 > taumat= matrix(0,n,10) > taumat[,10]= 9000000000 # if you're changing this, change rcpos below > taumat[,2]= cen > for(i1 in 3:9) + taumat[,i1]= taumat[,2]+(i1-1)*len > > ## now forming the intervals > right1= rep(0,n) > left= rep(0,n) > for(i2 in 1:n) + { + lenleft= length(which(taumat[i2,2:9]ttime[i2])) + rightpot= rep(0,9) + rightpot[(9-lenright+1):9]= 1 + missvec2= c(rbinom(4,1,0.7),rbinom(4,1,0.5),1) + right1temp= rightpot*missvec2*taumat[i2,2:10] + right1[i2]= min(right1temp[right1temp!=0]) + } > > rcpos= which(right1==9000000000) > lrcpos= length(rcpos) > notrcpos= (1:n)[-rcpos] > > delta_temp= rep(1,n) # del=1 are uncensored observations > delta_temp[rcpos]= 0 > k= sum(delta_temp) # this is just the number of data points that are not right censored > > ## measurement error generation > umat= matrix((rgamma(n*nrep,shape=2,scale=2)-4)*0.5/sqrt(8),n,nrep) > > wmat= z1+umat > > > datamat= cbind(left,right1,delta_temp,z2) > ntimp= m > > library(icemelt) > out_rcw1= rcw1(datamat, wmat, rfix, gridlen, ntimp, sigma2u) > out_rcw1 $beta1.est [1] -4.115157 $beta2.est [1] -33.34962 $beta1.sd [1] 7.138735 $beta2.sd [1] 3.000575e+14 > > > > > ### *