Learn R Programming

gptk (version 1.0)

SCGoptim: Optimise the given function using (scaled) conjugate gradients.

Description

Optimise the given function using (scaled) conjugate gradients.

Usage

options <- optimiDefaultOptions()
  newParams <- SCGoptim(x, fn, grad, options, ...)
  newParams <- CGoptim(x, fn, grad, options, ...)
  model <- modelOptimise(model, options, ...)

Arguments

model
the model to be optimised.
x
initial parameter values.
fn
objective function to minimise
grad
gradient function of the objective
options
options structure like one returned by optimiDefaultOptions. The fields are interpreted as\ option[1] : number of iterations\ option[2] : interval for the line search\ option[3] : tolerence for x to terminate the loop\ opt
...
extra arguments to pass to fn and grad

Value

  • optionsan options structure
  • newParamsoptimised parameter values
  • modelthe optimised model.

See Also

modelObjective, modelGradient

Examples

Run this code
## Not run to speed up package checks
# model <- GPLearn(..., dontOptimise=TRUE)
# options <- optimiDefaultOptions()
# model <- modelOptimise(model, options)

Run the code above in your browser using DataLab