https://github.com/cran/bbmle
Raw File
Tip revision: 13982dbec4de7e8f454e60e5769fa597e6de56aa authored by Ben Bolker on 11 May 2022, 07:20:02 UTC
version 1.0.25
Tip revision: 13982db
optimx.Rout.save

R Under development (unstable) (2017-10-27 r73634) -- "Unsuffered Consequences"
Copyright (C) 2017 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)
> if (require(optimx)) {
+ x <- 0:10
+ y <- c(26, 17, 13, 12, 20, 5, 9, 8, 5, 4, 8)
+ d <- data.frame(x,y)
+ 
+ ## breaks, don't try this
+ ## optimx(fn=Lfn,par=c(15,6),method="Rvmmin")
+ 
+ suppressWarnings(m1 <- mle2(minuslogl=y~dpois(lambda=ymax/(1+x/xhalf)),
+      start=list(ymax=15,xhalf=6),data=d,
+      optimizer="optimx",
+            method=c("BFGS","Nelder-Mead","CG")))
+ 
+ ## FIXME!! fails (although not with an error, because
+ ##  errors are caught by profiling) due to npar now
+ ## being restricted to >1 in optimx 2012.05.24 ...
+ 
+ suppressWarnings(head(as.data.frame(profile(m1))))
+ detach("package:optimx")
+ }
Loading required package: optimx
> options(old_opt)
> 
> proc.time()
   user  system elapsed 
  5.852   0.188  13.617 
back to top