storedValues: Return the stored values of optimization

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/storedValues.R

Description

Retrieve the objective function value for each iteration if stored during the optimization.

Usage

1
2
3
4
5
6
storedValues(x, ...)
## S3 method for class 'maxim'
storedValues(x, ...)
storedParameters(x, ...)
## S3 method for class 'maxim'
storedParameters(x, ...)

Arguments

x

a result of maximization, created by maxLik, maxSGA or another optimizer.

...

further arguments for other methods

Details

These is a generic method. If asked by control parameter storeValues=TRUE or storeParameters=TRUE, certain optimization methods store the objective function value and the parameter value at each epoch. These methods retrieves the stored values.

Value

In both cases, the first value stored corresponds to the initial parameter.

Author(s)

Ott Toomet

See Also

maxSGA, maxControl

Examples

1
2
3
4
5
6
7
8
9
## Estimate the exponential distribution parameter
t <- rexp(100, 2)
loglik <- function(theta, index) sum(log(theta) - theta*t[index])
## Estimate with numeric gradient and numeric Hessian
a <- maxSGA(loglik, start=1,
            control=list(storeValues=TRUE, storeParameters=TRUE, iterlim=10),
            nObs=100)
storedValues(a)
storedParameters(a)

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