
R Under development (unstable) (2019-12-03 r77509) -- "Unsuffered Consequences"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(bbmle)
Loading required package: stats4
> old_opt <- options(digits=3)
> x <- 0:10
> y <- c(26, 17, 13, 12, 20, 5, 9, 8, 5, 4, 8)
> d <- data.frame(x,y)
> 
> 
> ## throws warning on some CRAN system (BDR report 2019-12-20)
> ## /tests-noLD/bbmle.Rcheck’
> ## * using R Under development (unstable) (2019-12-19 r77606)
> ## * using platform: x86_64-pc-linux-gnu (64-bit)
> ## suppressWarnings() doesn't seem to suppress the warning??
> ## instead use test from https://www.r-bloggers.com/a-nold-platform-on-r-hub-package-builder/
> if (capabilities("long.double")) {
+    fit0 <- suppressWarnings(
+     mle2(y~dpois(lambda=ymean),start=list(ymean=mean(y)),data=d,
+          method="L-BFGS-B",lower=10)
+    )
+    stopifnot(is.na(confint(fit0)[1]))
+ }
> 
> fit1 <- mle2(y~dpois(lambda=exp(a+b*x)),start=list(a=0,b=2),data=d,
+              method="L-BFGS-B",lower=-0.2)
> 
> suppressWarnings(confint(fit1))
  2.5 %  97.5 %
a  2.81  3.3579
b    NA -0.0944
> 
> fit2 <- mle2(y~dpois(lambda=exp(a+b*x)),start=list(a=0,b=2),data=d,
+              method="L-BFGS-B")
> 
> pp <- suppressWarnings(profile(fit2,prof.lower=-0.2))
> stopifnot(min(subset(as.data.frame(pp),param=="b")$par.vals.b)==-0.2)
> ## note that b does go below -0.2 when profiling a ...
> options(old_opt)
> 
> proc.time()
   user  system elapsed 
  2.312   0.124   2.654 
