Running ‘bdstest.R’
  Running ‘hobbs.R’ [7s/15s]
  Running ‘jonesrun.R’
  Running ‘maxfn.R’
  Running ‘rosenbrock.R’
  Running ‘run1param.R’
  Running ‘simplefuntst.R’
  Running ‘snsimple.R’
  Running ‘snwood.R’
  Running ‘ssqbtest.R’
  Running ‘tfnchk.R’
  Running ‘tgrchk.R’
  Running ‘tkktc.R’
  Running ‘trig1507.R’
Running the tests in ‘tests/hobbs.R’ failed.
Complete output:
  > rm(list=ls())
  > require(optimx)
  Loading required package: optimx
  > ## Optimization test function HOBBS
  > ## ?? refs (put in .doc??)
  > ## Nash and Walker-Smith (1987, 1989) ...
  > 
  > 
  > hobbs.f<- function(x){ # # Hobbs weeds problem -- function
  +     if (abs(12*x[3]) > 500) { # check computability
  +        fbad<-.Machine$double.xmax
  +        return(fbad)
  +     }
  +     res<-hobbs.res(x)
  +     f<-sum(res*res)
  + }
  > 
  > 
  > hobbs.res<-function(x){ # Hobbs weeds problem -- residual
  + # This variant uses looping
  +     if(length(x) != 3) stop("hobbs.res -- parameter vector n!=3")
  +     y<-c(5.308, 7.24, 9.638, 12.866, 17.069, 23.192, 31.443, 38.558, 50.156, 62.948,
  +          75.995, 91.972)
  +     t<-1:12
  +     if(abs(12*x[3])>50) {
  +        res<-rep(Inf,12)
  +     } else {
  +        res<-x[1]/(1+x[2]*exp(-x[3]*t)) - y
  +     }
  + }
  > 
  > hobbs.jac<-function(x){ # Jacobian of Hobbs weeds problem
  +    jj<-matrix(0.0, 12, 3)
  +    t<-1:12
  +     yy<-exp(-x[3]*t)
  +     zz<-1.0/(1+x[2]*yy)
  +      jj[t,1] <- zz
  +      jj[t,2] <- -x[1]*zz*zz*yy
  +      jj[t,3] <- x[1]*zz*zz*yy*x[2]*t
  +    return(jj)
  + }
  > 
  > hobbs.g<-function(x){ # gradient of Hobbs weeds problem
  +     # NOT EFFICIENT TO CALL AGAIN
  +     jj<-hobbs.jac(x)
  +     res<-hobbs.res(x)
  +     gg<-as.vector(2.*t(jj) %*% res)
  +     return(gg)
  + }
  > 
  > 
  > hobbs.rsd<-function(x) { # Jacobian second derivative
  +     rsd<-array(0.0, c(12,3,3))
  +     t<-1:12
  +     yy<-exp(-x[3]*t)
  +     zz<-1.0/(1+x[2]*yy)
  +     rsd[t,1,1]<- 0.0
  +     rsd[t,2,1]<- -yy*zz*zz
  +     rsd[t,1,2]<- -yy*zz*zz
  +     rsd[t,2,2]<- 2.0*x[1]*yy*yy*zz*zz*zz
  +     rsd[t,3,1]<- t*x[2]*yy*zz*zz
  +     rsd[t,1,3]<- t*x[2]*yy*zz*zz
  +     rsd[t,3,2]<- t*x[1]*yy*zz*zz*(1-2*x[2]*yy*zz)
  +     rsd[t,2,3]<- t*x[1]*yy*zz*zz*(1-2*x[2]*yy*zz)
  + ##    rsd[t,3,3]<- 2*t*t*x[1]*x[2]*x[2]*yy*yy*zz*zz*zz
  +     rsd[t,3,3]<- -t*t*x[1]*x[2]*yy*zz*zz*(1-2*yy*zz*x[2])
  +     return(rsd)
  + }
  > 
  > 
  > hobbs.h <- function(x) { ## compute Hessian
  + #   cat("Hessian not yet available\n")
  + #   return(NULL)
  +     H<-matrix(0,3,3)
  +     res<-hobbs.res(x)
  +     jj<-hobbs.jac(x)
  +     rsd<-hobbs.rsd(x)
  + ##    H<-2.0*(t(res) %*% rsd + t(jj) %*% jj)
  +     for (j in 1:3) {
  +        for (k in 1:3) {
  +           for (i in 1:12) {
  +              H[j,k]<-H[j,k]+res[i]*rsd[i,j,k]
  +           }
  +        }
  +     }
  +     H<-2*(H + t(jj) %*% jj)
  +     return(H)
  + }
  > 
  > 
  > 
  > x0 <- c(200, 50, .3)
  > # This start seems to be OK for all methods
  > cat("Start for Hobbs:")
  Start for Hobbs:> print(x0)
  [1] 200.0  50.0   0.3
  > cat("Initial value of hobbs.f = ",hobbs.f(x0),"\n")
  Initial value of hobbs.f =  158.2324 
  > ahobb0 <- opm(x0, hobbs.f, hobbs.g, hess=hobbs.h, method="ALL")
  This problem is unconstrained.
  Error in if (delfb > -armtst/n) { : missing value where TRUE/FALSE needed
  In addition: Warning messages:
  1: In Rcgminu(par = spar, fn = efn, gr = egr, control = mcontrol, ...) :
    Rcgmin - undefined function
  2: In Rcgminu(par = spar, fn = efn, gr = egr, control = mcontrol, ...) :
    Rcgmin - undefined function
  3: In Rcgminu(par = spar, fn = efn, gr = egr, control = mcontrol, ...) :
    Rcgmin - undefined function
  4: In Rcgminu(par = spar, fn = efn, gr = egr, control = mcontrol, ...) :
    Rcgmin - undefined function
  5: In Rcgminu(par = spar, fn = efn, gr = egr, control = mcontrol, ...) :
    Rcgmin - undefined function
  Warning message:
  In dfoptim::hjk(par = spar, fn = efn, control = mcontrol, ...) :
    Function evaluation limit exceeded -- may not converge.
  > print(summary(ahobb0, order=value))
                    p1       p2        p3         value fevals gevals convergence
  ucminf      196.1863 49.09164 0.3135697  2.587277e+00     22     22           0
  subplex     196.1863 49.09164 0.3135697  2.587277e+00    823     NA           0
  Rvmmin      196.1863 49.09164 0.3135697  2.587277e+00     35     17           0
  snewtonm    196.1863 49.09164 0.3135697  2.587277e+00     13      9           0
  nlminb      196.1863 49.09164 0.3135697  2.587277e+00      8      7           0
  nlm         196.1863 49.09164 0.3135697  2.587277e+00     NA      6           0
  snewton     196.1863 49.09164 0.3135697  2.587277e+00     10     10          92
  lbfgs       196.1863 49.09166 0.3135697  2.587277e+00     NA     NA           0
  BFGS        196.1856 49.09156 0.3135701  2.587277e+00     74     25           0
  Rcgmin      196.1888 49.09191 0.3135683  2.587277e+00   2005    272           1
  Nelder-Mead 196.1782 49.09055 0.3135750  2.587279e+00    162     NA           0
  newuoa      196.5159 49.12861 0.3133856  2.587519e+00   4938     NA           0
  spg         199.6503 49.47564 0.3116572  2.612872e+00    974    419           0
  CG          199.9263 49.48658 0.3114687  2.617055e+00   4924   1001           1
  L-BFGS-B    200.0162 49.51389 0.3114545  2.618411e+00     25     25           0
  lbfgsb3     200.0162 49.51389 0.3114545  2.618411e+00     25     25           0
  bobyqa      200.4891 49.98062 0.3120166  2.662018e+00     38     NA           0
  hjkb        202.3617 49.66696 0.3099792  2.668468e+00  10001     NA           1
  Rtnmin      203.8197 50.04305 0.3096444  2.707066e+00      8      8           3
  hjn         221.3600 51.79258 0.3008320  3.639897e+00  10000     NA           1
  nmkb              NA       NA        NA 8.988466e+307     NA     NA        9999
               kkt1  kkt2 xtime
  ucminf       TRUE FALSE 0.011
  subplex      TRUE FALSE 0.021
  Rvmmin       TRUE FALSE 0.013
  snewtonm     TRUE FALSE 0.005
  nlminb       TRUE FALSE 0.004
  nlm          TRUE FALSE 0.116
  snewton      TRUE FALSE 0.007
  lbfgs        TRUE FALSE 0.015
  BFGS         TRUE FALSE 0.150
  Rcgmin       TRUE FALSE 0.069
  Nelder-Mead FALSE FALSE 0.004
  newuoa      FALSE FALSE 0.426
  spg         FALSE FALSE 0.192
  CG          FALSE FALSE 0.149
  L-BFGS-B    FALSE FALSE 0.004
  lbfgsb3     FALSE FALSE 0.037
  bobyqa      FALSE FALSE 0.004
  hjkb        FALSE FALSE 0.284
  Rtnmin      FALSE FALSE 0.016
  hjn         FALSE FALSE 0.284
  nmkb           NA    NA 0.011
  > 
  > 
  > x1 <- c(1, 1, 1)
  > # Several methods fail because f or g becomes Inf.
  > cat("Start for Hobbs:")
  Start for Hobbs:> print(x1)
  [1] 1 1 1
  > cat("Initial value of hobbs.f = ",hobbs.f(x1),"\n")
  Initial value of hobbs.f =  23520.58 
  > ahobb1 <- opm(x1, hobbs.f, hobbs.g, hess=hobbs.h, method="ALL")
  Error in optim(par = par, fn = efn, gr = egr, method = method, hessian = FALSE,  : 
    L-BFGS-B needs finite values of 'fn'
  In addition: Warning message:
  In kktchk(ans$par, fn, wgr, hess = NULL, upper = NULL, lower = NULL,  :
    Eigenvalue failure for projected Hessian
  This problem is unconstrained.
  Error in lbfgsb3::lbfgsb3(prm = spar, fn = efn, gr = egr, control = mcontrol,  : 
    NA/NaN/Inf in foreign function call (arg 7)
  In addition: Warning messages:
  1: In nlm(f = nlmfn, p = spar, iterlim = iterlim, print.level = print.level,  :
    NA/Inf replaced by maximum positive value
  2: In nlm(f = nlmfn, p = spar, iterlim = iterlim, print.level = print.level,  :
    NA/Inf replaced by maximum positive value
  3: In nlm(f = nlmfn, p = spar, iterlim = iterlim, print.level = print.level,  :
    NA/Inf replaced by maximum positive value
  4: In nlm(f = nlmfn, p = spar, iterlim = iterlim, print.level = print.level,  :
    NA/Inf replaced by maximum positive value
  terminate called after throwing an instance of 'std::range_error'
    what():  non-finite x values not allowed in calfun