[Rd] optim bug (PR#9684)

From: <christina.merz_at_gmx.de>
Date: Mon, 14 May 2007 20:11:24 +0200 (CEST)

Full_Name: Christina Merz
Version: R version 2.5.0 (2007-04-23)
OS: mingw32
Submission from: (NULL) (

R> version

platform       i386-pc-mingw32             
arch           i386                        
os             mingw32                     
system         i386, mingw32               
major          2                           
minor          5.0                         
year           2007                        
month          04                          
day            23                          
svn rev        41293                       
language       R                           
version.string R version 2.5.0 (2007-04-23)

R> sessionInfo()
R version 2.5.0 (2007-04-23)


attached base packages:
[1] "stats" "graphics" "grDevices" "utils" "datasets" "methods"
[7] "base"

'optim' does not accept arguments called 'u'. Here is an example:

R> fun<-function(x,u) (x-u)^2
R> optim(7,fn=fun,u=9)

Fehler in fn(par, ...) : Argument "u" fehlt (ohne Standardwert) Zusätzlich: Warning message:
bounds can only be used with method L-BFGS-B in: optim(7, fn = fun, u = 9)


R> fun<-function(x,y) (x-y)^2
R> optim(7,fn=fun,y=9)
[1] 8.999854

[1] 2.145767e-08

function gradient

      28 NA

[1] 0

NULL Warning message:
one-diml optimization by Nelder-Mead is unreliable: use optimize in: optim(7, fn = fun, y = 9)


R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Tue 15 May 2007 - 06:46:33 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 15 May 2007 - 07:33:36 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.