multivariate-optimization | R Documentation |
Multivariate Optimization
cg1(init, f, g, args)
cg2(init, f, args)
bfgs1(init, f, g, args)
bfgs2(init, f, args)
lbfgsb1(init, f, g, args)
lbfgsb2(init, f, args)
neldermead(init, f, args)
nlm1(init, f, g, h, args)
nlm2(init, f, g, args)
nlm3(init, f, args)
init |
Initial value |
f |
Function |
g |
Gradient function of |
args |
List of additional arguments for optimization. |
h |
Hessian function of |
The argument args
should be a list constructed from one of the following
functions:
bfgs_args
for BFGS;
lbfgsb_args
for L-BFGS-B;
cg_args
for CG;
neldermead_args
for Nelder-Mead;
nlm_args
for the Newton-type algorithm used in nlm
.
When g
or h
are omitted, the gradient or Hessian will be respectively
be computed via finite differences.
A list with results corresponding to the specified function. See the package vignette for further details.
cg1
and cg2
return a cg_result
which is documented in the section
"Conjugate Gradient".
bfgs1
and bfgs2
return a bfgs_result
which is documented in the
section "BFGS".
lbfgsb1
and lbfgsb2
return a lbfgsb_result
which is documented in
the section "L-BFGS-B".
neldermead
returns a neldermead_result
which is documented in
the section "Nelder-Mead".
nlm1
, nlm2
, and nlm3
return a nlm_result
which is documented in
the section "Newton-Type Algorithm for Nonlinear Optimization".
f = function(x) { sum(x^2) }
g = function(x) { 2*x }
h = function(x) { 2*diag(length(x)) }
x0 = c(1,1)
args = cg_args()
cg1(x0, f, g, args)
cg2(x0, f, args)
args = bfgs_args()
bfgs1(x0, f, g, args)
bfgs2(x0, f, args)
args = lbfgsb_args()
lbfgsb1(x0, f, g, args)
lbfgsb2(x0, f, args)
args = neldermead_args()
neldermead(x0, f, args)
args = nlm_args()
nlm1(x0, f, g, h, args)
nlm2(x0, f, g, args)
nlm3(x0, f, args)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.