Learn R Programming

maxLik (version 1.5-2.1)

objectiveFn: Optimization Objective Function

Description

This function returns the optimization objective function from a ‘maxim’ object.

Usage

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

Value

function, the function that was optimized. It can be directly called, given that all necessary variables are accessible from the current environment.

Arguments

x

an optimization result, inheriting from class ‘maxim’

...

other arguments for methods

Author

Ott Toomet

Examples

Run this code
hatf <- function(theta) exp(- theta %*% theta)
res <- maxNR(hatf, start=c(0,0))
print(summary(res))
print(objectiveFn(res))
print(objectiveFn(res)(2)) # 0.01832

Run the code above in your browser using DataLab