objectiveFn: Optimization Objective Function

Description Usage Arguments Value Author(s) Examples

View source: R/objectiveFn.R

Description

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

Usage

1
2
3
objectiveFn(x, ...)
## S3 method for class 'maxim'
objectiveFn(x, ...)

Arguments

x

an optimization result, inheriting from class ‘maxim’

...

other arguments for methods

Value

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

Author(s)

Ott Toomet

Examples

1
2
3
4
5
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

maxLik documentation built on July 27, 2021, 1:07 a.m.