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.
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: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of > jmbucci at stat.ucla.edu > Sent: Friday, October 28, 2005 1:23 AM > To: r-help at 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 at 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}}
Try: optim(.....)$par Bye Elio jmbucci at stat.ucla.edu wrote:>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 at 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 > > >-- ---------------------------------------------------------------------------------- Prof. Angelo M. Mineo Dipartimento di Scienze Statistiche e Matematiche "S. Vianelli" Universit?? degli Studi di Palermo Viale delle Scienze 90128 Palermo url: http://dssm.unipa.it/elio