Learn R Programming

maxLik (version 1.5-2.1)

maxValue: Function value at maximum

Description

Returns the function value at (estimated) maximum.

Usage

maxValue(x, ...)
# S3 method for maxim
maxValue(x, ...)

Value

numeric, the value of the objective function at maximum. In general, it is the last calculated value in case the process did not converge.

Arguments

x

a statistical model, or a result of maximisation, created by maxLik, maxNR or another optimizer.

...

further arguments for other methods

Author

Ott Toomet

See Also

maxLik, maxNR

Examples

Run this code
## Estimate the exponential distribution parameter:
t <- rexp(100, 2)
loglik <- function(theta) sum(log(theta) - theta*t)
## Estimate with numeric gradient and numeric Hessian
a <- maxNR(loglik, start=1)
maxValue(a)

Run the code above in your browser using DataLab