Padmanand Madhavan Nambiar <padmanandm <at> gmail.com> writes: > > Hi Sir, > > How to use the "optim" for maximization. I don't understand the > control$fnscale option that is given on help page. It says if the > control$fnscale is negative, the function will be maximized. > > Thanks a lot > > Padmanand
If 'fn' is your objective function and 'par' is your starting parameter vector, just optim(par=par,fn=fn,control=list(fnscale=-1)) ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.