Learn R Programming

maxLik (version 0.5-6)

returnCode: Return code for optimisation and other objects

Description

This function gives the return code of various optimisation objects. The return code gives a brief information about the success or problems, occured during the optimisation (see documentation for the corresponding function).

Usage

returnCode(x, ...)
## S3 method for class 'default':
returnCode(x, ...)

Arguments

x
object, usually an estimator, achieved by optimisation
...
further arguments for other methods

Value

  • Integer, the success code of optimisation procedure. However, different optimisation routines may define it in a different way.

Details

The default methods returns component returnCode.

See Also

returnMessage, maxNR

Examples

Run this code
## maximise the exponential bell
f1 <- function(x) exp(-x^2)
a <- maxNR(f1, start=2)
returnCode(a) # should be success (1 or 2)
## Now try to maximise log() function
f2 <- function(x) log(x)
a <- maxNR(f2, start=2)
returnCode(a) # should give a failure (4)

Run the code above in your browser using DataLab