CRAN Package Check Results for Package BayesSummaryStatLM

Last updated on 2020-08-14 16:48:00 CEST.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.0-1 3.61 33.16 36.77 ERROR
r-devel-linux-x86_64-debian-gcc 1.0-1 3.32 26.08 29.40 ERROR
r-devel-linux-x86_64-fedora-clang 1.0-1 53.51 ERROR
r-devel-linux-x86_64-fedora-gcc 1.0-1 43.52 ERROR
r-devel-windows-ix86+x86_64 1.0-1 12.00 65.00 77.00 ERROR
r-patched-linux-x86_64 1.0-1 4.29 32.90 37.19 ERROR
r-patched-solaris-x86 1.0-1 71.10 ERROR
r-release-linux-x86_64 1.0-1 4.34 33.26 37.60 ERROR
r-release-macos-x86_64 1.0-1 NOTE
r-release-windows-ix86+x86_64 1.0-1 11.00 46.00 57.00 ERROR
r-oldrel-macos-x86_64 1.0-1 NOTE
r-oldrel-windows-ix86+x86_64 1.0-1 7.00 40.00 47.00 ERROR

Check Details

Version: 1.0-1
Check: R code for possible problems
Result: NOTE
    bayes.regress: no visible binding for global variable 'var'
    bayesregressB1S1: no visible global function definition for 'rgamma'
    bayesregressB1S2: no visible global function definition for 'rgamma'
    bayesregressB2S1: no visible global function definition for 'rgamma'
    bayesregressB2S2: no visible global function definition for 'rgamma'
    bayesregressB3S1: no visible global function definition for 'rWishart'
    bayesregressB3S1: no visible global function definition for 'rgamma'
    bayesregressB3S2: no visible global function definition for 'rWishart'
    bayesregressB3S2: no visible global function definition for 'rgamma'
    read.regress.data.ff: no visible global function definition for
     'chunk.ffdf'
    Undefined global functions or variables:
     chunk.ffdf rWishart rgamma var
    Consider adding
     importFrom("stats", "rWishart", "rgamma", "var")
    to your NAMESPACE file.
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-ix86+x86_64, r-patched-linux-x86_64, r-patched-solaris-x86, r-release-linux-x86_64, r-release-windows-ix86+x86_64, r-oldrel-windows-ix86+x86_64

Version: 1.0-1
Check: examples
Result: ERROR
    Running examples in 'BayesSummaryStatLM-Ex.R' failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: bayes.regress
    > ### Title: MCMC posterior sampling of Bayesian linear regression model
    > ### parameters using only summary statistics
    > ### Aliases: bayes.regress
    > ### Keywords: combine consensus subposterior posterior parallel
    >
    > ### ** Examples
    >
    > ##################################################
    > ## Simulate data
    > ##################################################
    >
    > set.seed(284698)
    >
    > num.samp <- 100 # number of data values to simulate
    >
    > # The first value of the beta vector is the y-intercept:
    > beta <- c(-0.33, 0.78, -0.29, 0.47, -1.25)
    >
    > # Calculate the number of predictor variables:
    > num.pred <- length(beta)-1
    >
    > rho <- 0.0 # correlation between predictors
    > mean.vec <- rep(0,num.pred)
    > sigma.mat <- matrix(rho,num.pred,num.pred) + diag(1-rho,num.pred)
    > sigmasq.sim <- 0.05
    >
    > # Simulate predictor variables:
    > x.pre <- rmvn(num.samp, mu=mean.vec, sigma=sigma.mat)
    >
    > # Add leading column of 1's to x.pre for y-intercept:
    > x <- cbind(rep(1,num.samp),x.pre)
    >
    > epsilon <- rnorm(num.samp, mean=0, sd=sqrt(sigmasq.sim))
    >
    > y <- as.numeric( x %*% as.matrix(beta) + epsilon)
    >
    > ## Compute summary statistics (alternatively, the
    > # "read.regress.data.ff() function (in this package) can be
    > # used to calculate summary statistics; see example below).
    >
    > xtx <- t(x)%*%x
    > xty <- t(x)%*%y
    > yty <- t(y)%*%y
    >
    > data.values<-list(xtx=xtx, xty=xty, yty=yty,
    + numsamp.data = num.samp,
    + xtx.inv = chol2inv(chol(xtx)))
    >
    > ##########################################################
    > ## Bayesian linear regression analysis
    > ##########################################################
    >
    > Tsamp.out <- 100 # number of MCMC samples to produce
    >
    > ## Choose priors for beta and sigma-squared. Here,
    > # beta: Uniform prior; sigma-squared: Inverse Gamma prior.
    >
    > beta.prior <- list( type = "flat")
    > sigmasq.prior <- list(type = "inverse.gamma", inverse.gamma.a = 1.0,
    + inverse.gamma.b = 1.0, sigmasq.init = 1.0 )
    >
    > set.seed(284698)
    >
    > # Run the "bayes.regress" function using the data simulated above.
    >
    > MCMC.out <- bayes.regress(data.values,
    + beta.prior,
    + sigmasq.prior = sigmasq.prior,
    + Tsamp.out = Tsamp.out)
    >
    > # Next, print the posterior means of the unknown model parameters.
    > # Alternatively, the "coda" package can be used for analysis.
    >
    > print(c(colMeans(MCMC.out$beta), mean(MCMC.out$sigmasq)))
    [1] -0.31947013 0.83635812 -0.24389683 0.46429934 -1.22235687 0.07309549
    >
    > # Check that output is close to simulated values (although num.samp and
    > # Tsamp.out are small here); note that the output includes both beta and
    > # sigmasq:
    > # c(-0.33, 0.78, -0.29, 0.47, -1.25, 0.05)
    >
    > ## Run all 6 combinations of priors for 3 "beta.prior" choices and
    > # 2 "sigmasq.prior" choices:
    >
    > beta.priors <- list(
    + list( type = "flat"),
    +
    + list( type = "mvnorm.known",
    + mean.mu = rep(0.0, (num.pred+1)),
    + prec.Cinv = diag(1.0, (num.pred+1))),
    +
    + list( type = "mvnorm.unknown",
    + mu.hyper.mean.eta = rep(0.0,(num.pred+1)),
    + mu.hyper.prec.Dinv = diag(1.0, (num.pred+1)),
    + Cinv.hyper.df.lambda = (num.pred+1),
    + Cinv.hyper.invscale.Vinv = diag(1.0, (num.pred+1)),
    + mu.init = rep(1.0, (num.pred+1)),
    + Cinv.init = diag(1.0,(num.pred+1)))
    + )
    >
    > sigmasq.priors <- list(
    + list(type = "inverse.gamma",
    + inverse.gamma.a = 1.0,
    + inverse.gamma.b = 1.0,
    + sigmasq.init = 0.1 ),
    + list( type="sigmasq.inverse", sigmasq.init = 0.1)
    + )
    >
    > for (beta.prior in beta.priors)
    + {
    + for(sigmasq.prior in sigmasq.priors)
    + {
    + set.seed(284698)
    + MCMC.out <- bayes.regress(data.values,
    + beta.prior,
    + sigmasq.prior = sigmasq.prior,
    + Tsamp.out = Tsamp.out)
    + print(c(colMeans(MCMC.out$beta), mean(MCMC.out$sigmasq)))
    + }
    + }
    [1] -0.31983032 0.83600490 -0.24455739 0.46498638 -1.22276428 0.07281071
    [1] -0.32019753 0.83621751 -0.24526931 0.46502564 -1.22328984 0.05331027
    [1] -0.31935446 0.83537445 -0.24438076 0.46477280 -1.22204028 0.07281941
    [1] -0.31984715 0.83575331 -0.24513920 0.46486854 -1.22275688 0.05331623
    [1] -0.31703522 0.83822588 -0.24989106 0.46958822 -1.22709261 0.07244923
    [1] -0.31786752 0.83817854 -0.24982952 0.46895645 -1.22705289 0.05304441
    >
    > # Check that output is close to simulated values (although num.samp and
    > # Tsamp.out are small here); note that the output includes both beta and
    > # sigmasq:
    > # c(-0.33, 0.78, -0.29, 0.47, -1.25, 0.05):
    >
    >
    > #######################################################################
    > ## Read the data from a file, calculate the summary statistics and run
    > ## the Bayesian linear regression analysis
    > #######################################################################
    >
    > Tsamp.out <- 100
    >
    > ## Assume non-zero y-intercept data.
    >
    > # Read the files and compute summary statistics using the "read.regress.data.ff()"
    > # function (in this package).
    >
    >
    > filename <- system.file('data/regressiondata.nz.all.csv.gz', package='BayesSummaryStatLM')
    > data.values <- read.regress.data.ff(filename)
    Error in chunk.ffdf(data.ffdf) : could not find function "chunk.ffdf"
    Calls: read.regress.data.ff
    Execution halted
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-patched-linux-x86_64, r-release-linux-x86_64

Version: 1.0-1
Check: examples
Result: ERROR
    Running examples in ‘BayesSummaryStatLM-Ex.R’ failed
    The error most likely occurred in:
    
    > ### Name: bayes.regress
    > ### Title: MCMC posterior sampling of Bayesian linear regression model
    > ### parameters using only summary statistics
    > ### Aliases: bayes.regress
    > ### Keywords: combine consensus subposterior posterior parallel
    >
    > ### ** Examples
    >
    > ##################################################
    > ## Simulate data
    > ##################################################
    >
    > set.seed(284698)
    >
    > num.samp <- 100 # number of data values to simulate
    >
    > # The first value of the beta vector is the y-intercept:
    > beta <- c(-0.33, 0.78, -0.29, 0.47, -1.25)
    >
    > # Calculate the number of predictor variables:
    > num.pred <- length(beta)-1
    >
    > rho <- 0.0 # correlation between predictors
    > mean.vec <- rep(0,num.pred)
    > sigma.mat <- matrix(rho,num.pred,num.pred) + diag(1-rho,num.pred)
    > sigmasq.sim <- 0.05
    >
    > # Simulate predictor variables:
    > x.pre <- rmvn(num.samp, mu=mean.vec, sigma=sigma.mat)
    >
    > # Add leading column of 1's to x.pre for y-intercept:
    > x <- cbind(rep(1,num.samp),x.pre)
    >
    > epsilon <- rnorm(num.samp, mean=0, sd=sqrt(sigmasq.sim))
    >
    > y <- as.numeric( x %*% as.matrix(beta) + epsilon)
    >
    > ## Compute summary statistics (alternatively, the
    > # "read.regress.data.ff() function (in this package) can be
    > # used to calculate summary statistics; see example below).
    >
    > xtx <- t(x)%*%x
    > xty <- t(x)%*%y
    > yty <- t(y)%*%y
    >
    > data.values<-list(xtx=xtx, xty=xty, yty=yty,
    + numsamp.data = num.samp,
    + xtx.inv = chol2inv(chol(xtx)))
    >
    > ##########################################################
    > ## Bayesian linear regression analysis
    > ##########################################################
    >
    > Tsamp.out <- 100 # number of MCMC samples to produce
    >
    > ## Choose priors for beta and sigma-squared. Here,
    > # beta: Uniform prior; sigma-squared: Inverse Gamma prior.
    >
    > beta.prior <- list( type = "flat")
    > sigmasq.prior <- list(type = "inverse.gamma", inverse.gamma.a = 1.0,
    + inverse.gamma.b = 1.0, sigmasq.init = 1.0 )
    >
    > set.seed(284698)
    >
    > # Run the "bayes.regress" function using the data simulated above.
    >
    > MCMC.out <- bayes.regress(data.values,
    + beta.prior,
    + sigmasq.prior = sigmasq.prior,
    + Tsamp.out = Tsamp.out)
    >
    > # Next, print the posterior means of the unknown model parameters.
    > # Alternatively, the "coda" package can be used for analysis.
    >
    > print(c(colMeans(MCMC.out$beta), mean(MCMC.out$sigmasq)))
    [1] -0.31947013 0.83635812 -0.24389683 0.46429934 -1.22235687 0.07309549
    >
    > # Check that output is close to simulated values (although num.samp and
    > # Tsamp.out are small here); note that the output includes both beta and
    > # sigmasq:
    > # c(-0.33, 0.78, -0.29, 0.47, -1.25, 0.05)
    >
    > ## Run all 6 combinations of priors for 3 "beta.prior" choices and
    > # 2 "sigmasq.prior" choices:
    >
    > beta.priors <- list(
    + list( type = "flat"),
    +
    + list( type = "mvnorm.known",
    + mean.mu = rep(0.0, (num.pred+1)),
    + prec.Cinv = diag(1.0, (num.pred+1))),
    +
    + list( type = "mvnorm.unknown",
    + mu.hyper.mean.eta = rep(0.0,(num.pred+1)),
    + mu.hyper.prec.Dinv = diag(1.0, (num.pred+1)),
    + Cinv.hyper.df.lambda = (num.pred+1),
    + Cinv.hyper.invscale.Vinv = diag(1.0, (num.pred+1)),
    + mu.init = rep(1.0, (num.pred+1)),
    + Cinv.init = diag(1.0,(num.pred+1)))
    + )
    >
    > sigmasq.priors <- list(
    + list(type = "inverse.gamma",
    + inverse.gamma.a = 1.0,
    + inverse.gamma.b = 1.0,
    + sigmasq.init = 0.1 ),
    + list( type="sigmasq.inverse", sigmasq.init = 0.1)
    + )
    >
    > for (beta.prior in beta.priors)
    + {
    + for(sigmasq.prior in sigmasq.priors)
    + {
    + set.seed(284698)
    + MCMC.out <- bayes.regress(data.values,
    + beta.prior,
    + sigmasq.prior = sigmasq.prior,
    + Tsamp.out = Tsamp.out)
    + print(c(colMeans(MCMC.out$beta), mean(MCMC.out$sigmasq)))
    + }
    + }
    [1] -0.31983032 0.83600490 -0.24455739 0.46498638 -1.22276428 0.07281071
    [1] -0.32019753 0.83621751 -0.24526931 0.46502564 -1.22328984 0.05331027
    [1] -0.31935446 0.83537445 -0.24438076 0.46477280 -1.22204028 0.07281941
    [1] -0.31984715 0.83575331 -0.24513920 0.46486854 -1.22275688 0.05331623
    [1] -0.31703522 0.83822588 -0.24989106 0.46958822 -1.22709261 0.07244923
    [1] -0.31786752 0.83817854 -0.24982952 0.46895645 -1.22705289 0.05304441
    >
    > # Check that output is close to simulated values (although num.samp and
    > # Tsamp.out are small here); note that the output includes both beta and
    > # sigmasq:
    > # c(-0.33, 0.78, -0.29, 0.47, -1.25, 0.05):
    >
    >
    > #######################################################################
    > ## Read the data from a file, calculate the summary statistics and run
    > ## the Bayesian linear regression analysis
    > #######################################################################
    >
    > Tsamp.out <- 100
    >
    > ## Assume non-zero y-intercept data.
    >
    > # Read the files and compute summary statistics using the "read.regress.data.ff()"
    > # function (in this package).
    >
    >
    > filename <- system.file('data/regressiondata.nz.all.csv.gz', package='BayesSummaryStatLM')
    > data.values <- read.regress.data.ff(filename)
    Error in chunk.ffdf(data.ffdf) : could not find function "chunk.ffdf"
    Calls: read.regress.data.ff
    Execution halted
Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-ix86+x86_64, r-patched-solaris-x86, r-release-windows-ix86+x86_64, r-oldrel-windows-ix86+x86_64

Version: 1.0-1
Check: R code for possible problems
Result: NOTE
    bayes.regress: no visible binding for global variable ‘var’
    bayesregressB1S1: no visible global function definition for ‘rgamma’
    bayesregressB1S2: no visible global function definition for ‘rgamma’
    bayesregressB2S1: no visible global function definition for ‘rgamma’
    bayesregressB2S2: no visible global function definition for ‘rgamma’
    bayesregressB3S1: no visible global function definition for ‘rWishart’
    bayesregressB3S1: no visible global function definition for ‘rgamma’
    bayesregressB3S2: no visible global function definition for ‘rWishart’
    bayesregressB3S2: no visible global function definition for ‘rgamma’
    Undefined global functions or variables:
     rWishart rgamma var
    Consider adding
     importFrom("stats", "rWishart", "rgamma", "var")
    to your NAMESPACE file.
Flavors: r-release-macos-x86_64, r-oldrel-macos-x86_64