Running 'bndmask.R' [152s]
  Running 'boundnlxb.R' [0s]
  Running 'controltst.R' [0s]
  Running 'derivs.R' [151s]
  Running 'globaldata1.R' [0s]
  Running 'masksnlsr.R' [0s]
  Running 'oneparam.R' [152s]
  Running 'quadmin2.R' [0s]
  Running 'scaledxtests.R' [0s]
Running the tests in 'tests/bndmask.R' failed.
Complete output:
  > traceval  <-  TRUE  # traceval set TRUE to debug or give full history
  > 
  > # Data for Hobbs problem
  > ydat  <-  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) # for testing
  > tdat  <-  seq_along(ydat) # for testing
  > 
  > eunsc  <-   y ~ b1/(1+b2*exp(-b3*tt))
  > 
  > cat("LOCAL DATA IN DATA FRAMES\n")
  LOCAL DATA IN DATA FRAMES
  > weeddata1  <-  data.frame(y=ydat, tt=tdat)
  > weeddata2  <-  data.frame(y=1.5*ydat, tt=tdat)
  > 
  > 
  > cat("BOUNDS")
  BOUNDS> start2  <-  c(b1=100, b2=10, b3=0.1)
  > an1qb1  <-  try(nlxb(eunsc, start=start2, trace=traceval, data=weeddata1, 
  +                      lower=c(0,0,0), upper=c(200, 60, .3)))
  Error in nlxb(eunsc, start = start2, trace = traceval, data = weeddata1,  : 
    could not find function "nlxb"
  > print(an1qb1)
  [1] "Error in nlxb(eunsc, start = start2, trace = traceval, data = weeddata1,  : \n  could not find function \"nlxb\"\n"
  attr(,"class")
  [1] "try-error"
  attr(,"condition")
  <simpleError in nlxb(eunsc, start = start2, trace = traceval, data = weeddata1,     lower = c(0, 0, 0), upper = c(200, 60, 0.3)): could not find function "nlxb">
  > 
  > cat("BOUNDS and MASK")
  BOUNDS and MASK> 
  > an1qbm2  <-  try(nlxb(eunsc, start=start2, trace=traceval, data=weeddata1, 
  +                       lower=c(0,0,0), upper=c(200, 60, .3), masked=c("b2")))
  Error in nlxb(eunsc, start = start2, trace = traceval, data = weeddata1,  : 
    could not find function "nlxb"
  > print(an1qbm2)
  [1] "Error in nlxb(eunsc, start = start2, trace = traceval, data = weeddata1,  : \n  could not find function \"nlxb\"\n"
  attr(,"class")
  [1] "try-error"
  attr(,"condition")
  <simpleError in nlxb(eunsc, start = start2, trace = traceval, data = weeddata1,     lower = c(0, 0, 0), upper = c(200, 60, 0.3), masked = c("b2")): could not find function "nlxb">
  > 
  > proc.time()
     user  system elapsed 
     0.14    0.07    0.15 
Running the tests in 'tests/derivs.R' failed.
Complete output:
  > library(nlsr)
  > 
  > # Various derivatives 
  > 
  > fnDeriv(quote(1 + x + y), c("x", "y"))
  function (x, y) 
  {
      .value <- 1 + x + y
      .grad <- array(0, c(length(.value), 2L), list(NULL, c("x", 
      "y")))
      .grad[, "x"] <- 1
      .grad[, "y"] <- 1
      attr(.value, "gradient") <- .grad
      .value
  }
  > 
  > nlsDeriv( ~ log(x), "x")
  1/x
  > nlsDeriv( ~ log(x, base=3), "x" )
  1/(x * 1.09861228866811)
  > 
  > nlsDeriv( ~ exp(x), "x")
  exp(x)
  > nlsDeriv( ~ sin(x), "x")
  cos(x)
  > nlsDeriv( ~ cos(x), "x")
  -sin(x)
  > nlsDeriv( ~ tan(x), "x")
  1/cos(x)^2
  > nlsDeriv( ~ sinh(x), "x")
  cosh(x)
  > nlsDeriv( ~ cosh(x), "x")
  sinh(x)
  > nlsDeriv( ~ sqrt(x), "x")
  0.5/sqrt(x)
  > nlsDeriv( ~ pnorm(q), "q")
  dnorm(q)
  > nlsDeriv( ~ dnorm(x, mean), "mean")
  dnorm(x - mean) * (x - mean)
  > nlsDeriv( ~ asin(x), "x")
  1/sqrt(1 + x^2)
  > nlsDeriv( ~ acos(x), "x")
  -1/sqrt(1 + x^2)
  > nlsDeriv( ~ atan(x), "x")
  1/(1 + x^2)
  > nlsDeriv( ~ gamma(x), "x")
  gamma(x) * digamma(x)
  > nlsDeriv( ~ lgamma(x), "x")
  digamma(x)
  > nlsDeriv( ~ digamma(x), "x")
  trigamma(x)
  > nlsDeriv( ~ trigamma(x), "x")
  psigamma(x, 2L)
  > nlsDeriv( ~ psigamma(x, deriv = 5), "x")
  psigamma(x, 6)
  > nlsDeriv( ~ x*y, "x")
  y
  > nlsDeriv( ~ x/y, "x")
  1/y
  > nlsDeriv( ~ x^y, "x")
  y * x^(y - 1)
  > nlsDeriv( ~ (x), "x")
  [1] 1
  > nlsDeriv( ~ +x, "x")
  [1] 1
  > nlsDeriv( ~ -x, "x")
  [1] -1
  > nlsDeriv( ~ abs(x), "x")
  sign(x)
  > nlsDeriv( ~ sign(x), "x")
  [1] 0
  > 
  > # Various simplifications
  > 
  > nlsSimplify(quote(+(a+b)))
  a + b
  > nlsSimplify(quote(-5))
  [1] -5
  > nlsSimplify(quote(--(a+b)))
  a + b
  > 
  > nlsSimplify(quote(exp(log(a+b))))
  a + b
  > nlsSimplify(quote(exp(1)))
  [1] 2.718282
  > 
  > nlsSimplify(quote(log(exp(a+b))))
  a + b
  > nlsSimplify(quote(log(1)))
  [1] 0
  > 
  > nlsSimplify(quote(!TRUE))
  [1] FALSE
  > nlsSimplify(quote(!FALSE))
  [1] TRUE
  > 
  > nlsSimplify(quote((a+b)))
  a + b
  > 
  > nlsSimplify(quote(a + b + 0))
  a + b
  > nlsSimplify(quote(0 + a + b))
  a + b
  > nlsSimplify(quote((a+b) + (a+b)))
  2 * (a + b)
  > nlsSimplify(quote(1 + 4))
  [1] 5
  > 
  > nlsSimplify(quote(a + b - 0))
  a + b
  > nlsSimplify(quote(0 - a - b))
  -a - b
  > nlsSimplify(quote((a+b) - (a+b)))
  [1] 0
  > nlsSimplify(quote(5 - 3))
  [1] 2
  > 
  > nlsSimplify(quote(0*(a+b)))
  [1] 0
  > nlsSimplify(quote((a+b)*0))
  [1] 0
  > nlsSimplify(quote(1L * (a+b)))
  a + b
  > nlsSimplify(quote((a+b) * 1))
  a + b
  > nlsSimplify(quote((-1)*(a+b)))
  -(a + b)
  > nlsSimplify(quote((a+b)*(-1)))
  -(a + b)
  > nlsSimplify(quote(2*5))
  [1] 10
  > 
  > nlsSimplify(quote((a+b) / 1))
  a + b
  > nlsSimplify(quote((a+b) / (-1)))
  -(a + b)
  > nlsSimplify(quote(0/(a+b)))
  [1] 0
  > nlsSimplify(quote(1/3))
  [1] 0.3333333
  > 
  > nlsSimplify(quote((a+b) ^ 1))
  a + b
  > nlsSimplify(quote(2^10))
  [1] 1024
  > 
  > nlsSimplify(quote(log(exp(a), 3)))
  a/1.09861228866811
  > 
  > nlsSimplify(quote(FALSE && b))
  [1] FALSE
  > nlsSimplify(quote(a && TRUE))
  a
  > nlsSimplify(quote(TRUE && b))
  b
  > 
  > nlsSimplify(quote(a || TRUE))
  [1] TRUE
  > nlsSimplify(quote(FALSE || b))
  b
  > nlsSimplify(quote(a || FALSE))
  a
  > 
  > nlsSimplify(quote(if (TRUE) a+b))
  a + b
  > nlsSimplify(quote(if (FALSE) a+b))
  NULL
  > 
  > nlsSimplify(quote(if (TRUE) a+b else a*b))
  a + b
  > nlsSimplify(quote(if (FALSE) a+b else a*b))
  a * b
  > nlsSimplify(quote(if (cond) a+b else a+b))
  a + b
  > 
  > # This one was wrong...
  > nlsSimplify(quote(--(a+b)))
  a + b
  > 
  > 
  > # From the Weeds problem
  > 
  >   modelformula <- y ~ ms * b1/(1 + b2 * exp(-b3 * tt))
  >   pvec <- c(b1=1, b2=1, b3=1)
  >   cat("model2rjfunx: modelformula = ")
  model2rjfunx: modelformula = >   print(modelformula)
  y ~ ms * b1/(1 + b2 * exp(-b3 * tt))
  >   print(class(modelformula))
  [1] "formula"
  > 
  >   if (length(modelformula) == 2) {
  +        residexpr <- modelformula[[2]]
  +   } else if (length(modelformula) == 3) {
  +        residexpr <- call("-", modelformula[[3]], modelformula[[2]])
  +   } else stop("Unrecognized formula")
  >     
  >   if (is.null(names(pvec)))
  +     names(pvec) <- paste0("p", seq_along(pvec))
  >     
  >   residexpr1 <- nlsDeriv( ~ residexpr, names(pvec))
  >   cat("residexpr1:\n")
  residexpr1:
  >   print(residexpr1) 
  [1] 0 0 0
  > ## SHOULD TRY:
  >   residexpr2 <- fnDeriv(residexpr, names(pvec))
  >   cat("residexpr2:\n")
  residexpr2:
  >   print(residexpr2)
  function (ms, b1, b2, b3, tt, y) 
  {
      .expr1 <- -b3
      .expr2 <- .expr1 * tt
      .expr3 <- exp(.expr2)
      .expr4 <- b2 * .expr3
      .expr5 <- 1 + .expr4
      .expr6 <- ms * b1
      .expr7 <- .expr5^2
      .value <- .expr6/(.expr5) - y
      .grad <- array(0, c(length(.value), 3L), list(NULL, c("b1", 
      "b2", "b3")))
      .grad[, "b1"] <- ms/.expr5
      .grad[, "b2"] <- -(.expr6 * .expr3/.expr7)
      .grad[, "b3"] <- -(.expr6 * (b2 * (.expr3 * -tt))/.expr7)
      attr(.value, "gradient") <- .grad
      .value
  }
  > 
  > 
  > proc.time()
     user  system elapsed 
     0.28    0.09    0.36 
Running the tests in 'tests/oneparam.R' failed.
Complete output:
  > ## Problem in 1 parameter to ensure methods work in trivial case
  > require(nlsr)
  Loading required package: nlsr
  > cat("1 parameter problem\n")
  1 parameter problem
  > nobs<-8
  > tt <- seq(1,nobs)
  > dd <- 1.23*tt + 4*runif(nobs)
  > 
  > df <- data.frame(tt, dd)
  > print(df)
    tt        dd
  1  1  2.638543
  2  2  2.607564
  3  3  6.138816
  4  4  5.168918
  5  5  7.804141
  6  6 10.775862
  7  7 12.361345
  8  8 12.413330
  > a1par<-nlxb(dd ~ a*tt, start=c(a=1), data=df)
  > a1par
  residual sumsquares =  7.1609  on  8 observations
      after  3    Jacobian and  3 function evaluations
    name            coeff          SE       tstat      pval      gradient    JSingval   
  a                 1.6493         14.45     0.1142     0.9123  -1.276e-11       14.28  
  > 
  > 
  > proc.time()
     user  system elapsed 
     0.26    0.04    0.28