Hi,

is this what you meant?

myfun <- function(x) {
  return(x^2)
}

optim(par=0.5, fn=myfun, method="BFGS")$par 


Best,
Roland


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> [EMAIL PROTECTED]
> Sent: Friday, October 28, 2005 1:23 AM
> To: r-help@stat.math.ethz.ch
> Subject: [R] Optim function
> 
> Hello,
> 
> Is there a general procedure when using the the optim 
> function("BFGS") to
> only output the converging value (i.e. final par value) 
> rather than all
> the other output?
> 
> Thank you.
> 
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 

+++++
This mail has been sent through the MPI for Demographic Rese...{{dropped}}

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to