Errors in running code in vignettes:
when running code in 'BBvignetteJSS.Stex'

> options(prompt = "R> ", continue = "+  ")

> nsim <- 10

> nboot <- 50

> require("BB")
Loading required package: BB

> froth <- function(p) {
+     r <- rep(NA, length(p))
+     r[1] <- -13 + p[1] + (p[2] * (5 - p[2]) - 2) * p[2]
+     r[2] <- -29 + p[1] + (p[2] * (1 .... [TRUNCATED] 

> p0 <- rep(0, 2)

> dfsane(par = p0, fn = froth, control = list(trace = FALSE))
Warning in dfsane(par = p0, fn = froth, control = list(trace = FALSE)) :
  Unsuccessful convergence.
$par
[1] -4.990589 -1.448398

$residual
[1] 10.42073

$fn.reduction
[1] 17.04337

$feval
[1] 131

$iter
[1] 106

$convergence
[1] 5

$message
[1] "Lack of improvement in objective function"


> sane(par = p0, fn = froth, control = list(trace = FALSE))
Warning in sane(par = p0, fn = froth, control = list(trace = FALSE)) :
  Unsuccessful convergence.
$par
[1] -5.729871 -1.702569

$residual
[1] 9.592763

$fn.reduction
[1] 18.21428

$feval
[1] 417

$iter
[1] 127

$convergence
[1] 5

$message
[1] "Lack of improvement in objective function"


> BBsolve(par = p0, fn = froth)
  Successful convergence.
$par
[1] 5 4

$residual
[1] 2.012452e-09

$fn.reduction
[1] 6.998875

$feval
[1] 1109

$iter
[1] 233

$convergence
[1] 0

$message
[1] "Successful convergence"

$cpar
method      M     NM 
     1     50      1 


> require("setRNG")
Loading required package: setRNG

> test.rng <- list(kind = "Mersenne-Twister", normal.kind = "Inversion", 
+     seed = 1234)

> old.seed <- setRNG(test.rng)

> expo3 <- function(p) {
+     n <- length(p)
+     r <- rep(NA, n)
+     onm1 <- 1:(n - 1)
+     r[onm1] <- onm1/10 * (1 - p[onm1]^2 - exp(-p[onm1]^2 .... [TRUNCATED] 

> dfsane1.expo3 <- dfsane2.expo3 <- sane1.expo3 <- sane2.expo3 <- bbs.expo3 <- bbs.expo3 <- matrix(NA, 
+     nsim, 5, dimnames = list(NULL, c("value" .... [TRUNCATED] 

> old.seed <- setRNG(test.rng)

> cat("Simulation test 1: ")
Simulation test 1: 
> for (i in 1:nsim) {
+     cat(i, " ")
+     p0 <- rnorm(500)
+     t1 <- system.time(ans <- sane(par = p0, fn = expo3, method = 1, 
+         contro .... [TRUNCATED] 
1  Warning in sane(par = p0, fn = expo3, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
Warning in sane(par = p0, fn = expo3, method = 2, control = list(trace = FALSE)) :
  Unsuccessful convergence.
  Successful convergence.
2  Warning in sane(par = p0, fn = expo3, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
Warning in dfsane(par = p0, fn = expo3, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
  Successful convergence.
3  Warning in sane(par = p0, fn = expo3, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
Warning in dfsane(par = p0, fn = expo3, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
  Successful convergence.
4    Successful convergence.
5  Warning in sane(par = p0, fn = expo3, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
  Successful convergence.
6  Warning in sane(par = p0, fn = expo3, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
  Successful convergence.
7  Warning in sane(par = p0, fn = expo3, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
Warning in dfsane(par = p0, fn = expo3, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
  Successful convergence.
8  Warning in sane(par = p0, fn = expo3, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
  Successful convergence.
9  Warning in sane(par = p0, fn = expo3, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
  Successful convergence.
10    Successful convergence.

> cat("\n")


> table1.test1 <- rbind(c(apply(sane1.expo3, 2, summary)[c(4, 
+     2, 5), c(3, 2, 5)], sum(sane1.expo3[, 4] > 0)), c(apply(dfsane1.expo3, 
+     2,  .... [TRUNCATED] 

> dimnames(table1.test1) <- list(c("sane-1", "dfsane-1", 
+     "sane-2", "dfsane-2", "BBsolve"), NULL)

> table1.test1
          [,1]   [,2]   [,3]   [,4]   [,5]   [,6]  [,7]   [,8]  [,9] [,10]
sane-1   364.1  47.75 195.50 1720.6 174.75 729.00 0.240 0.0125 0.155     8
dfsane-1 207.7 123.00 240.50  433.2 274.00 518.00 0.060 0.0325 0.075     3
sane-2   117.2 104.25 127.25  254.5 237.75 266.00 0.030 0.0225 0.030     1
dfsane-2 233.1 185.75 271.00  253.6 203.00 293.00 0.041 0.0300 0.050     0
BBsolve  222.5 185.75 244.00  239.5 203.00 264.25 0.045 0.0325 0.050     0

> trigexp <- function(x) {
+     n <- length(x)
+     r <- rep(NA, n)
+     r[1] <- 3 * x[1]^2 + 2 * x[2] - 5 + sin(x[1] - x[2]) * sin(x[1] + 
+       .... [TRUNCATED] 

> old.seed <- setRNG(test.rng)

> dfsane1.trigexp <- dfsane2.trigexp <- sane1.trigexp <- sane2.trigexp <- matrix(NA, 
+     nsim, 5, dimnames = list(NULL, c("value", "feval", "iter", .... [TRUNCATED] 

> cat("Simulation  test 2: ")
Simulation  test 2: 
> for (i in 1:nsim) {
+     cat(i, " ")
+     p0 <- rnorm(500)
+     t1 <- system.time(ans <- sane(par = p0, fn = trigexp, method = 1, 
+         cont .... [TRUNCATED] 
1  2  3  4  5  6  7  8  9  10  
> cat("\n")


> table1.test2 <- rbind(c(apply(sane1.trigexp, 2, summary)[c(4, 
+     2, 5), c(3, 2, 5)], sum(sane1.trigexp[, 4] > 0)), c(apply(dfsane1.trigexp, 
+   .... [TRUNCATED] 

> dimnames(table1.test2) <- list(c("sane-1", "dfsane-1", 
+     "sane-2", "dfsane-2"), NULL)

> table1.test2
         [,1]  [,2]   [,3]  [,4]  [,5]   [,6]  [,7]   [,8]   [,9] [,10]
sane-1   27.6 26.25  27.75  56.6 53.50  57.50 0.025 0.0125 0.0200     0
dfsane-1 32.3 26.25  30.00  35.1 27.25  31.75 0.013 0.0025 0.0200     0
sane-2   72.3 27.00 113.00 145.7 55.00 227.25 0.048 0.0100 0.0775     0
dfsane-2 43.7 27.00  59.50  44.7 28.00  60.50 0.018 0.0100 0.0275     0

> broydt <- function(x, h = 2) {
+     n <- length(x)
+     r <- rep(NA, n)
+     r[1] <- ((3 - h * x[1]) * x[1]) - 2 * x[2] + 1
+     tnm1 <- 2:(n -  .... [TRUNCATED] 

> old.seed <- setRNG(test.rng)

> dfsane1.broydt <- dfsane2.broydt <- sane1.broydt <- sane2.broydt <- matrix(NA, 
+     nsim, 5, dimnames = list(NULL, c("value", "feval", "iter", 
+  .... [TRUNCATED] 

> cat("Simulation  test 3: ")
Simulation  test 3: 
> for (i in 1:nsim) {
+     cat(i, " ")
+     p0 <- -runif(500)
+     t1 <- system.time(ans <- sane(par = p0, fn = broydt, method = 1, 
+         cont .... [TRUNCATED] 
1  2  3  4  5  6  7  8  9  10  
> cat("\n")


> table1.test3 <- rbind(c(apply(sane1.broydt, 2, summary)[c(4, 
+     2, 5), c(3, 2, 5)], sum(sane1.broydt[, 4] > 0)), c(apply(dfsane1.broydt, 
+      .... [TRUNCATED] 

> dimnames(table1.test3) <- list(c("sane-1", "dfsane-1", 
+     "sane-2", "dfsane-2"), NULL)

> table1.test3
         [,1] [,2] [,3] [,4] [,5] [,6]  [,7] [,8]   [,9] [,10]
sane-1   19.1   19   19 39.2   39   39 0.011    0 0.0175     0
dfsane-1 19.1   19   19 20.1   20   20 0.003    0 0.0000     0
sane-2   20.1   20   20 41.2   41   41 0.008    0 0.0175     0
dfsane-2 20.1   20   20 21.1   21   21 0.001    0 0.0000     0

> extrosbk <- function(x) {
+     n <- length(x)
+     r <- rep(NA, n)
+     j <- 2 * (1:(n/2))
+     jm1 <- j - 1
+     r[jm1] <- 10 * (x[j] - x[jm1] .... [TRUNCATED] 

> old.seed <- setRNG(test.rng)

> dfsane1.extrosbk <- dfsane2.extrosbk <- sane1.extrosbk <- sane2.extrosbk <- bbs.extrosbk <- matrix(NA, 
+     nsim, 5, dimnames = list(NULL, c("valu ..." ... [TRUNCATED] 

> cat("Simulation  test 4: ")
Simulation  test 4: 
> for (i in 1:nsim) {
+     cat(i, " ")
+     p0 <- runif(500)
+     t1 <- system.time(ans <- sane(par = p0, fn = extrosbk, method = 1, 
+         con .... [TRUNCATED] 
1    Successful convergence.
2    Successful convergence.
3    Successful convergence.
4    Successful convergence.
5  Warning in sane(par = p0, fn = extrosbk, method = 2, control = list(M = 10,  :
  Unsuccessful convergence.
  Successful convergence.
6    Successful convergence.
7    Successful convergence.
8    Successful convergence.
9  Warning in sane(par = p0, fn = extrosbk, method = 2, control = list(M = 10,  :
  Unsuccessful convergence.
  Successful convergence.
10    Successful convergence.

> cat("\n")


> table1.test4 <- rbind(c(apply(sane1.extrosbk, 2, summary)[c(4, 
+     2, 5), c(3, 2, 5)], sum(sane1.extrosbk[, 4] > 0)), c(apply(dfsane1.extrosbk, 
 .... [TRUNCATED] 

> dimnames(table1.test4) <- list(c("sane-1", "dfsane-1", 
+     "sane-2", "dfsane-2", "BBsolve"), NULL)

> table1.test4
         [,1]  [,2]  [,3]  [,4]  [,5]  [,6]  [,7] [,8]   [,9] [,10]
sane-1   38.5 37.00 38.75  79.9 77.00 80.75 0.009    0 0.0175     0
dfsane-1 37.2 33.75 38.75  42.6 39.25 46.75 0.003    0 0.0000     0
sane-2   54.6 37.00 44.25 111.9 75.00 91.75 0.007    0 0.0100     2
dfsane-2 39.3 36.25 42.00  44.2 39.50 45.50 0.002    0 0.0000     0
BBsolve  39.3 37.00 41.50  41.3 39.00 43.50 0.002    0 0.0000     0

> troesch <- function(x) {
+     n <- length(x)
+     tnm1 <- 2:(n - 1)
+     r <- rep(NA, n)
+     h <- 1/(n + 1)
+     h2 <- 10 * h^2
+     r[1] <-  .... [TRUNCATED] 

> old.seed <- setRNG(test.rng)

> dfsane1.troesch <- dfsane2.troesch <- sane1.troesch <- sane2.troesch <- matrix(NA, 
+     nsim, 5, dimnames = list(NULL, c("value", "feval", "iter", .... [TRUNCATED] 

> cat("Simulation  test 5: ")
Simulation  test 5: 
> for (i in 1:nsim) {
+     cat(i, " ")
+     p0 <- sort(runif(500))
+     t1 <- system.time(ans <- sane(par = p0, fn = troesch, method = 1, 
+        .... [TRUNCATED] 
1  Warning in sane(par = p0, fn = troesch, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
Warning in dfsane(par = p0, fn = troesch, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
2  Warning in sane(par = p0, fn = troesch, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
Warning in dfsane(par = p0, fn = troesch, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
3  Warning in sane(par = p0, fn = troesch, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
Warning in dfsane(par = p0, fn = troesch, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
4  Warning in sane(par = p0, fn = troesch, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
Warning in dfsane(par = p0, fn = troesch, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
5  Warning in sane(par = p0, fn = troesch, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
Warning in dfsane(par = p0, fn = troesch, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
6  Warning in sane(par = p0, fn = troesch, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
Warning in dfsane(par = p0, fn = troesch, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
7  Warning in sane(par = p0, fn = troesch, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
Warning in dfsane(par = p0, fn = troesch, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
8  Warning in sane(par = p0, fn = troesch, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
Warning in dfsane(par = p0, fn = troesch, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
9  Warning in sane(par = p0, fn = troesch, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
Warning in dfsane(par = p0, fn = troesch, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
10  Warning in sane(par = p0, fn = troesch, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.
Warning in dfsane(par = p0, fn = troesch, method = 1, control = list(trace = FALSE)) :
  Unsuccessful convergence.

> cat("\n")


> table1.test5 <- rbind(c(apply(sane1.troesch, 2, summary)[c(4, 
+     2, 5), c(3, 2, 5)], sum(sane1.troesch[, 4] > 0)), c(apply(dfsane1.troesch, 
+   .... [TRUNCATED] 

> dimnames(table1.test5) <- list(c("sane-1", "dfsane-1", 
+     "sane-2", "dfsane-2"), NULL)

> table1.test5
         [,1]    [,2]   [,3]   [,4]    [,5]    [,6]  [,7]   [,8]   [,9] [,10]
sane-1   1501 1501.00 1501.0 6085.3 6053.75 6122.25 0.815 0.6700 0.9925    10
dfsane-1 1501 1501.00 1501.0 4018.2 3934.50 4074.00 0.582 0.4925 0.6750    10
sane-2    780  656.75  947.5 1996.3 1663.75 2446.75 0.280 0.1925 0.3125     0
dfsane-2 1051 1027.75 1146.5 1612.0 1627.00 1737.50 0.238 0.2000 0.2675     0

> chandraH <- function(x, c = 0.9) {
+     n <- length(x)
+     k <- 1:n
+     mu <- (k - 0.5)/n
+     dterm <- outer(mu, mu, function(x1, x2) x1/(x1  .... [TRUNCATED] 

> old.seed <- setRNG(test.rng)

> dfsane1.chandraH <- dfsane2.chandraH <- sane1.chandraH <- sane2.chandraH <- matrix(NA, 
+     nsim, 5, dimnames = list(NULL, c("value", "feval", "it ..." ... [TRUNCATED] 

> cat("Simulation  test 6: ")
Simulation  test 6: 
> for (i in 1:nsim) {
+     cat(i, " ")
+     p0 <- runif(500)
+     t1 <- system.time(ans <- sane(par = p0, fn = chandraH, method = 1, 
+         con .... [TRUNCATED] 
1  2  3  4  5  6  7  8  9  10  
> cat("\nSimulations for table 1 complete.\n")

Simulations for table 1 complete.

> table1.test6 <- rbind(c(apply(sane1.chandraH, 2, summary)[c(4, 
+     2, 5), c(3, 2, 5)], sum(sane1.chandraH[, 4] > 0)), c(apply(dfsane1.chandraH, 
 .... [TRUNCATED] 

> dimnames(table1.test6) <- list(c("sane-1", "dfsane-1", 
+     "sane-2", "dfsane-2"), NULL)

> table1.caption <- paste("Results of numerical experiments for 6 standard test problems.", 
+     nsim, "randomly generated starting values were used ..." ... [TRUNCATED] 

> table1 <- rbind(table1.test1, table1.test2, table1.test3, 
+     table1.test4, table1.test5, table1.test6)

> cgroups <- c("# Iters", "# Fevals", "CPU (sec)", "# Failures")

> rgroups <- c("\\emph{1. Exponential function 3}", 
+     "\\emph{2. Trigexp function}", "\\emph{3. Broyden's tridiagonal function}", 
+     "\\emph{ ..." ... [TRUNCATED] 

> require("Hmisc")
Loading required package: Hmisc
Loading required package: lattice
Loading required package: survival
Loading required package: Formula
Loading required package: ggplot2
Error: package or namespace load failed for 'Hmisc' in namespaceExport(ns, exports):
 undefined exports: %s!=%, %s!==%, %s+%, %s<%, %s<=%, %s==%, %s===%, %s>%, %s>=%, %stri!=%, %stri!==%, %stri+%, %stri<%, %stri<=%, %stri==%, %stri===%, %stri>%, %stri>=%, stri_datetime_add<-, stri_sub<-, stri_subset<-, stri_subset_charclass<-, stri_subset_coll<-, stri_subset_fixed<-, stri_subset_regex<-, stri_c, stri_c_list, stri_cmp, stri_cmp_eq, stri_cmp_equiv, stri_cmp_ge, stri_cmp_gt, stri_cmp_le, stri_cmp_lt, stri_cmp_neq, stri_cmp_nequiv, stri_compare, stri_conv, stri_count, stri_count_boundaries, stri_count_charclass, stri_count_coll, stri_count_fixed, stri_count_regex, stri_count_words, stri_datetime_add, stri_datetime_create, stri_datetime_fields, stri_datetime_format, stri_datetime_fstr, stri_datetime_now, stri_datetime_parse, stri_datetime_symbols, stri_detect, stri_detect_charclass, stri_detect_coll, stri_detect_fixed, stri_detect_regex, stri_dup, stri_duplicated, stri_duplicated_any, stri_enc_detect, stri_enc_detect2, stri_enc_fromutf32, stri_enc_get, stri_enc_info, stri_enc_isascii, stri_enc_isutf16be, stri_enc_isutf16le, stri_enc_isutf32be, stri_enc_isutf32le, stri_enc_isutf8, stri_enc_list, stri_enc_mark, stri_enc_set, stri_enc_toascii, stri_enc_tonative, stri_enc_toutf32, stri_enc_toutf8, stri_encode, stri_endswith, stri_endswith_charclass, stri_endswith_coll, stri_endswith_fixed, stri_escape_unicode, stri_extract, stri_extract_all, stri_extract_all_boundaries, stri_extract_all_charclass, stri_extract_all_coll, stri_extract_all_fixed, stri_extract_all_regex, stri_extract_all_words, stri_extract_first, stri_extract_first_boundaries, stri_extract_first_charclass, stri_extract_first_coll, stri_extract_first_fixed, stri_extract_first_regex, stri_extract_first_words, stri_extract_last, stri_extract_last_boundaries, stri_extract_last_charclass, stri_extract_last_coll, stri_extract_last_fixed, stri_extract_last_regex, stri_extract_last_words, stri_flatten, stri_info, stri_isempty, stri_join, stri_join_list, stri_length, stri_list2matrix, stri_locale_get, stri_locale_info, stri_locale_list, stri_locale_set, stri_locate, stri_locate_all, stri_locate_all_boundaries, stri_locate_all_charclass, stri_locate_all_coll, stri_locate_all_fixed, stri_locate_all_regex, stri_locate_all_words, stri_locate_first, stri_locate_first_boundaries, stri_locate_first_charclass, stri_locate_first_coll, stri_locate_first_fixed, stri_locate_first_regex, stri_locate_first_words, stri_locate_last, stri_locate_last_boundaries, stri_locate_last_charclass, stri_locate_last_coll, stri_locate_last_fixed, stri_locate_last_regex, stri_locate_last_words, stri_match, stri_match_all, stri_match_all_regex, stri_match_first, stri_match_first_regex, stri_match_last, stri_match_last_regex, stri_na2empty, stri_numbytes, stri_opts_brkiter, stri_opts_collator, stri_opts_fixed, stri_opts_regex, stri_order, stri_pad, stri_pad_both, stri_pad_left, stri_pad_right, stri_paste, stri_paste_list, stri_rand_lipsum, stri_rand_shuffle, stri_rand_strings, stri_read_lines, stri_read_raw, stri_remove_empty, stri_replace, stri_replace_all, stri_replace_all_charclass, stri_replace_all_coll, stri_replace_all_fixed, stri_replace_all_regex, stri_replace_first, stri_replace_first_charclass, stri_replace_first_coll, stri_replace_first_fixed, stri_replace_first_regex, stri_replace_last, stri_replace_last_charclass, stri_replace_last_coll, stri_replace_last_fixed, stri_replace_last_regex, stri_replace_na, stri_reverse, stri_sort, stri_split, stri_split_boundaries, stri_split_charclass, stri_split_coll, stri_split_fixed, stri_split_lines, stri_split_lines1, stri_split_regex, stri_startswith, stri_startswith_charclass, stri_startswith_coll, stri_startswith_fixed, stri_stats_general, stri_stats_latex, stri_sub, stri_subset, stri_subset_charclass, stri_subset_coll, stri_subset_fixed, stri_subset_regex, stri_timezone_get, stri_timezone_info, stri_timezone_list, stri_timezone_set, stri_trans_char, stri_trans_general, stri_trans_isnfc, stri_trans_isnfd, stri_trans_isnfkc, stri_trans_isnfkc_casefold, stri_trans_isnfkd, stri_trans_list, stri_trans_nfc, stri_trans_nfd, stri_trans_nfkc, stri_trans_nfkc_casefold, stri_trans_nfkd, stri_trans_tolower, stri_trans_totitle, stri_trans_toupper, stri_trim, stri_trim_both, stri_trim_left, stri_trim_right, stri_unescape_unicode, stri_unique, stri_width, stri_wrap, stri_write_lines

> latex(table1, file = "", caption = table1.caption, 
+     caption.loc = "bottom", cgroups = cgroups, n.cgroups = c(3, 
+         3, 3, 1), rgroups = .... [TRUNCATED] 

  When sourcing 'BBvignetteJSS.R':
Error: could not find function "latex"
Execution halted