O'Reilly logo

Nonlinear Parameter Optimization Using R Tools by John C. Nash

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8Function minimization tools in the base R system

The scientists who built the core R system have included a number of tools for optimization. In this chapter, we explore these and review their strengths and weaknesses. It is, however, important to note the following.

  • All the methods discussed in this chapter are relatively “old.” They date from the 1970s to 1980s at the latest, even if the codes are somewhat more recent. This does not mean that they are not good tools. It is rather that there are more recent tools that take account of changing requirements, deal with larger or somewhat different problems, and include capabilities that the base tools lack.
  • The base methods have been used by other R tools, so are present in some cases as support for those tools.
  • It is very difficult to remove something from a working system, even if there are more suitable replacements.

8.1 optim()

optim() is one of the most used tools in R. It incorporates five methods, three of which are derived from the author's own work (Nash, 1979). The five methods are largely independent but are all called through optim(), using a call such as

 ans<-optim(start, fn=myfn, gr=mygr, method="BFGS",
        X=myx, Y=myY, control=list(trace=1))

where start is the vector of parameters that are used as the initial point of the optimization iteration, myfn is the function to be minimized, mygr is its gradient, and the control list specifies that we want to follow the iterations (trace), while the elements given ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required