fastR2 (version 1.2.4)

nlmax: Nonlinear maximization and minimization

Description

nlmin and nlmax are thin wrappers around nlm, a non-linear minimizer. nlmax avoids the necessity of modifying the function to construct a minimization problem from a problem that is naturally a maximization problem. The summary method for the resulting objects provides output that is easier for humnans to read.

Usage

nlmax(f, ...)

nlmin(f, ...)

# S3 method for nlmax summary(object, nsmall = 4, ...)

# S3 method for nlmin summary(object, nsmall = 4, ...)

Arguments

f

a function to optimize

...

additional arguments passed to nlm. Note that p is a required argument for nlm. See the help for nlm for details.

object

an object returned from nlmin or nlmax

nsmall

a numeric passed through to format

Examples

Run this code
summary( nlmax( function(x) 5 - 3*x - 5*x^2, p=0 ) )

Run the code above in your browser using DataLab