returnCode {maxLik}R Documentation

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, ...)
## Default S3 method:
returnCode(x, ...)

Arguments

x

object, usually an estimator, achieved by optimisation

...

further arguments for other methods

Details

The default methods returns component returnCode.

Value

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

Author(s)

Ott Toomet, otoomet@ut.ee

See Also

returnMessage, maxNR

Examples

## 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)

[Package maxLik version 1.1-0 Index]