lbfgs_share: Use lbfgs packages's lbfgs function but pass in a single...

Description Usage Arguments Value Examples

Description

Use lbfgs packages's lbfgs function but pass in a single function that returns both the function and gradient together in a list. Useful when the function and gradient are expensive to calculate and can be calculated faster together than separate.

Usage

1

Arguments

fngr

A function that returns a list of two elements: the function value and the gradient value.

vars

Initial values for the parameters to be optimized over. Will be passed to optim as par argument.

...

Other arguments passed to lbfgs

Value

Result from running lbfgs on the given function

Examples

1
2
quad_share <- function(x){list(sum(x^4), 4*x^3)}
lbfgs_share(vars=c(3, -5), fngr=quad_share)


Search within the splitfngr package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.