Errors in running code in vignettes:
when running code in 'MfUSampler.Rnw'

> options(prompt = "R> ", continue = "+  ", width = 70, 
+     useFancyQuotes = FALSE)

> library("MfUSampler")
MfUSampler 1.0.4
Convenience Functions for Multivariate MCMC Using Univariate Samplers
For citations, please use:
Alireza S. Mahani, Mansour T. A. Sharabiani (2017). Multivariate-From-Univariate MCMC Sampler: The R Package MfUSampler. Journal of Statistical Software, Code Snippets, 78(1), 1-22. doi:10.18637/jss.v078.c01

> my.seed <- 0

> nsmp <- 10

> z <- c(1, 4, 7, 10, 13, 16, 19, 24)

> m1.prior <- c(17, 26, 39, 27, 35, 37, 26, 23)

> m2.prior <- c(215, 218, 137, 62, 36, 16, 13, 15)

> m1.current <- c(46, 52, 44, 54, 38, 39, 23, 52)

> m2.current <- c(290, 211, 134, 91, 53, 42, 23, 32)

> X <- cbind(1, z, z^2)

> loglike <- function(beta, X, m1, m2) {
+     beta <- as.numeric(beta)
+     Xbeta <- X %*% beta
+     return(-sum((m1 + m2) * log(1 + exp(-Xbeta)) + .... [TRUNCATED] 

> logprior <- function(beta, beta0, W) {
+     return(-0.5 * t(beta - beta0) %*% solve(W) %*% (beta - beta0))
+ }

> logpost <- function(beta, X, m1, m2, beta0 = rep(0, 
+     0, 3), W = diag(1e+06, nrow = 3)) {
+     return(logprior(beta, beta0, W) + loglike(beta, .... [TRUNCATED] 

> m1.total <- m1.prior + m1.current

> m2.total <- m2.prior + m2.current

> load("summ.slice")

> print(summ.slice)

Iterations = 501:1000
Thinning interval = 1 
Number of chains = 1 
Sample size per chain = 500 

1. Empirical mean and standard deviation for each variable,
   plus standard error of the mean:

          Mean       SD  Naive SE Time-series SE
[1,] -2.452413 0.134392 6.010e-03      0.0409431
[2,]  0.225965 0.025717 1.150e-03      0.0089625
[3,] -0.004234 0.001026 4.589e-05      0.0003032

2. Quantiles for each variable:

          2.5%       50%     97.5%
var1 -2.686285 -2.457768 -2.196446
var2  0.172842  0.228813  0.273421
var3 -0.006002 -0.004349 -0.002109

time for all samples ( 1000 ): 2.253 sec
time assigned to selected samples ( 500 ): 1.1265 sec
Effective sample size / independent samples per sec:
          ess      iss
var1 8.120590 7.208691
var2 4.647671 4.125762
var3 6.068079 5.386666

> print(summ.slice$covar)
              [,1]          [,2]          [,3]
[1,]  0.0266989860 -4.950835e-03  1.786601e-04
[2,] -0.0049508350  1.103237e-03 -4.252586e-05
[3,]  0.0001786601 -4.252586e-05  1.739642e-06

> logpost.fg <- function(beta, X, m1, m2, beta0 = rep(0, 
+     3), W = diag(1000, nrow = 3), grad = FALSE) {
+     Xbeta <- X %*% beta
+     if (grad .... [TRUNCATED] 

> set.seed(my.seed)

> beta.ini <- c(0, 0, 0)

> beta.smp <- MfU.Sample.Run(beta.ini, logpost.fg, nsmp = nsmp, 
+     uni.sampler = "ars", control = MfU.Control(3, ars.x = list(c(-10, 
+         0, .... [TRUNCATED] 

> summ.ars <- summary(beta.smp)

> load("summ.ars")

> print(summ.ars)

Iterations = 501:1000
Thinning interval = 1 
Number of chains = 1 
Sample size per chain = 500 

1. Empirical mean and standard deviation for each variable,
   plus standard error of the mean:

          Mean       SD  Naive SE Time-series SE
[1,] -2.396224 0.175992 7.871e-03      0.0536249
[2,]  0.213187 0.032584 1.457e-03      0.0096411
[3,] -0.003726 0.001247 5.579e-05      0.0003498

2. Quantiles for each variable:

          2.5%       50%      97.5%
var1 -2.691251 -2.412357 -2.0376872
var2  0.138264  0.216288  0.2671999
var3 -0.005851 -0.003813 -0.0007741

time for all samples ( 1000 ): 3.768 sec
time assigned to selected samples ( 500 ): 1.884 sec
Effective sample size / independent samples per sec:
          ess       iss
var1 40.69967 21.602799
var2 16.90188  8.971272
var3 17.39752  9.234350

> predfunc.mean <- function(beta, X) {
+     return(1/(1 + exp(-X %*% beta)))
+ }

> pred.mean <- predict(beta.smp, predfunc.mean, X)

> predmean.summ <- summary(pred.mean)

> print(predmean.summ, n = 8)
prediction sample statistics:
	(nominal sample size: 5)
       mean        sd       ess      2.5%       50%  97.5%
1 0.1233438 0.0059951 5.0000000 0.1170295 0.1222361 0.1305
2 0.1742073 0.0062654 5.0000000 0.1678182 0.1725081 0.1815
3 0.2377181 0.0057428 5.0000000 0.2319015 0.2361125 0.2443
4 0.3124788 0.0042671 5.0000000 0.3078534 0.3121914 0.3173
5 0.3950574 0.0025847 5.0000000 0.3920084 0.3954314 0.3976
6 0.4805277 0.0041450 5.0000000 0.4765281 0.4799419 0.4867
7 0.5636210 0.0078931 5.0000000 0.5546627 0.5633435 0.5746
8 0.6856569 0.0139778 5.0000000 0.6689487 0.6864122 0.7042

> predfunc.binary <- function(beta, X) {
+     return(1 * (runif(nrow(X)) < 1/(1 + exp(-X %*% beta))))
+ }

> pred.binary <- predict(beta.smp, predfunc.binary, 
+     X)

> predbinary.summ <- summary(pred.binary)

> print(predbinary.summ, n = 8)
prediction sample statistics:
	(nominal sample size: 5)
      mean       sd      ess     2.5%      50% 97.5%
1  0.00000  0.00000  0.00000  0.00000  0.00000   0.0
2  0.20000  0.44721  5.00000  0.00000  0.00000   0.9
3  0.40000  0.54772  5.00000  0.00000  0.00000   1.0
4  0.40000  0.54772  5.00000  0.00000  0.00000   1.0
5  0.40000  0.54772 33.75000  0.00000  0.00000   1.0
6  0.40000  0.54772  5.00000  0.00000  0.00000   1.0
7  0.60000  0.54772 33.75000  0.00000  1.00000   1.0
8  0.60000  0.54772  5.00000  0.00000  1.00000   1.0

> library("mvtnorm")

> set.seed(my.seed)

> nrep <- 50

> m.current <- m1.current + m2.current

> nz.exp <- nrep * sum(m.current)

> jitter <- 1

> z.exp <- sample(z, size = nz.exp, replace = T, prob = m.current) + 
+     (2 * runif(nz.exp) - 1) * jitter

> X.exp <- cbind(1, z.exp, z.exp^2)

> beta0.prior <- c(-3.17, 0.33, -0.007)

> W.prior <- 1e-04 * matrix(c(638, -111, 3.9, -111, 
+     24.1, -0.9, 3.9, -0.9, 0.04), ncol = 3)

> ngrp <- 50

> beta.mat <- t(rmvnorm(ngrp, mean = beta0.prior, sigma = W.prior))

> y.mat.exp <- 1 * matrix(runif(ngrp * nz.exp) < 1/(1 + 
+     exp(-X.exp %*% beta.mat)), ncol = ngrp)

> hb.logprior <- function(beta.flat, beta0, W) {
+     beta.mat <- matrix(beta.flat, nrow = 3)
+     return(sum(apply(beta.mat, 2, logprior, beta0, W) .... [TRUNCATED] 

> hb.loglike <- function(beta.flat, X, y) {
+     beta.mat <- matrix(beta.flat, nrow = 3)
+     ngrp <- ncol(beta.mat)
+     return(sum(sapply(1:ngrp, .... [TRUNCATED] 

> hb.logpost <- function(beta.flat, X, y, beta0, W) {
+     return(hb.logprior(beta.flat, beta0, W) + hb.loglike(beta.flat, 
+         X, y))
+ }

> load("t.naive")

> cat("hb sampling time - naive method:", t.naive, "sec\n")
hb sampling time - naive method: 53.545 sec

> hb.loglike.grp <- function(beta, X, y) {
+     beta <- as.numeric(beta)
+     xbeta <- X %*% beta
+     return(-sum((1 - y) * xbeta + log(1 + exp(-x .... [TRUNCATED] 

> hb.logprior.grp <- logprior

> hb.logpost.grp <- function(beta, X, y, beta0 = rep(0, 
+     0, 3), W = diag(1e+06, nrow = 3)) {
+     return(hb.logprior.grp(beta, beta0, W) + hb.l .... [TRUNCATED] 

> t.revised <- 10.7

> load("t.revised")

> cat("hb sampling time - revised method:", t.revised, 
+     "sec\n")
hb sampling time - revised method: 9.885 sec

> load("t.parallel")

> cat("hb sampling time - revised & parallel method:", 
+     t.parallel, "sec\n")
hb sampling time - revised & parallel method: 7.759 sec

> library("RcppArmadillo")

> library("inline")

> code <- "\n  arma::vec beta_cpp = Rcpp::as<arma::vec>(beta);\n  arma::mat X_cpp = Rcpp::as<arma::mat>(X);\n  arma::vec y_cpp = Rcpp::as<arma::vec>(y ..." ... [TRUNCATED] 

> hb.loglike.grp.rcpp <- cxxfunction(signature(beta = "numeric", 
+     X = "numeric", y = "numeric"), code, plugin = "RcppArmadillo")

ERROR(s) during compilation: source code errors or compiler configuration errors!
make cmd is
  make -f "C:/msys64/home/tomas/ucrt3/svn/ucrt3/R_PACK~1/rinst/etc/x64/Makeconf" -f "C:/msys64/home/tomas/ucrt3/svn/ucrt3/R_PACK~1/rinst/share/make/winshlib.mk" CXX='$(CXX11) $(CXX11STD)' CXXFLAGS='$(CXX11FLAGS)' CXXPICFLAGS='$(CXX11PICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX11LDFLAGS)' SHLIB_LD='$(SHLIB_CXX11LD)' SHLIB="file1786453703a40.dll" WIN=64 TCLBIN= OBJECTS="file1786453703a40.o"

make would use
Warning message:
In system(paste(cmd, "-n")) : 'make' not found

Program source:
  1: 
  2: // includes from the plugin
  3: #include <RcppArmadillo.h>
  4: #include <Rcpp.h>
  5: 
  6: 
  7: #ifndef BEGIN_RCPP
  8: #define BEGIN_RCPP
  9: #endif
 10: 
 11: #ifndef END_RCPP
 12: #define END_RCPP
 13: #endif
 14: 
 15: using namespace Rcpp;
 16: 
 17: // user includes
 18: 
 19: 
 20: // declarations
 21: extern "C" {
 22: SEXP file1786453703a40( SEXP beta, SEXP X, SEXP y) ;
 23: }
 24: 
 25: // definition
 26: SEXP file1786453703a40(SEXP beta, SEXP X, SEXP y) {
 27: BEGIN_RCPP
 28: 
 29:   arma::vec beta_cpp = Rcpp::as<arma::vec>(beta);
 30:   arma::mat X_cpp = Rcpp::as<arma::mat>(X);
 31:   arma::vec y_cpp = Rcpp::as<arma::vec>(y);
 32:   arma::vec xbeta = X_cpp * beta_cpp;
 33:   int n = X_cpp.n_rows;
 34:   double logp = 0.0;
 35:   for (int i=0; i<n; i++) {
 36:     // (1-y[, n]) * xbeta + log(1 + exp(-xbeta))
 37:     logp -= (1.0 - y_cpp[i]) * xbeta[i] + log(1.0 + exp(-xbeta[i]));
 38:   }
 39:   return Rcpp::wrap(logp);
 40: 
 41: END_RCPP
 42: }

Compilation ERROR, function(s)/method(s) not created!

  When sourcing 'MfUSampler.R':
Error: Warning message:In system(cmd) : 'make' not found
Execution halted

  'MfUSampler.Rnw' using 'latin1'... failed