https://github.com/cran/bbmle
Raw File
Tip revision: 1efe3d25b4e3d86356743a59d83699cfe2e301f9 authored by Ben Bolker on 11 February 2016, 16:57:55 UTC
version 1.0.18
Tip revision: 1efe3d2
optimx.Rout.save

R Under development (unstable) (2013-08-18 r63609) -- "Unsuffered Consequences"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: i686-pc-linux-gnu (32-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)
> require(optimx)
Loading required package: optimx
Loading required package: numDeriv
> 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))))
       param      z par.vals.ymax par.vals.xhalf focal
ymax.1  ymax -3.377          14.0           9.99  14.0
ymax.2  ymax -2.341          16.7           6.54  16.7
ymax.3  ymax -1.458          19.5           4.79  19.5
ymax.4  ymax -0.687          22.2           3.75  22.2
ymax.5  ymax  0.000          25.0           3.06  25.0
ymax.6  ymax  0.620          27.7           2.57  27.7
> detach("package:optimx")
> options(old_opt)
> 
> proc.time()
   user  system elapsed 
  7.848   4.400  12.412 
back to top