linfun_r1 | R Documentation |
Test function 33 from the More', Garbow and Hillstrom paper.
linfun_r1(m = 100)
m |
Number of summand functions in the objective function. Should be
equal to or greater than |
The objective function is the sum of m
functions, each of n
parameters.
Dimensions: Number of parameters n
variable, number of
summand functions m >= n
.
Minima: f = (m * (m - 1)) / (2 * (2 * m + 1))
at any set of
points x[j]
with j = 1, 2, ..., n
where the sum of
j * x[j] = 3 / (2 * m + 1)
.
The number of parameters, n
, in the objective function is not
specified when invoking this function. It is implicitly set by the length of
the parameter vector passed to the objective and gradient functions that this
function creates. See the 'Examples' section.
A list containing:
m
The number of functions to sum. Default is 100.
fn
Objective function which calculates the value given input
parameter vector.
gr
Gradient function which calculates the gradient vector
given input parameter vector.
he
If available, the hessian matrix (second derivatives)
of the function w.r.t. the parameters at the given values.
fg
A function which, given the parameter vector, calculates
both the objective value and gradient, returning a list with members
fn
and gr
, respectively.
x0
Function returning the standard starting point, given
n
, the number of variables desired.
fmin
reported minimum
xmin
parameters at reported minimum
More', J. J., Garbow, B. S., & Hillstrom, K. E. (1981). Testing unconstrained optimization software. ACM Transactions on Mathematical Software (TOMS), 7(1), 17-41. \Sexpr[results=rd]{tools:::Rd_expr_doi("doi.org/10.1145/355934.355936")}
linr1 <- linfun_r1(m = 10)
# 6 variable problem using the standard starting point
x0_6 <- linr1$x0(n = 6)
res_6 <- stats::optim(x0_6, linr1$fn, linr1$gr, method = "L-BFGS-B")
# Standing starting point with 8 variables
res_8 <- stats::optim(linr1$x0(8), linr1$fn, linr1$gr, method = "L-BFGS-B")
# Create your own 4 variable starting point
res_4 <- stats::optim(c(0.1, 0.2, 0.3, 0.4), linr1$fn, linr1$gr,
method = "L-BFGS-B")
# Use 20 summand functions
linr1_m20 <- linfun_r1(m = 20)
# Repeat 4 parameter optimization with new test function
res_n4_m20 <- stats::optim(c(0.1, 0.2, 0.3, 0.4), linr1_m20$fn, linr1_m20$gr,
method = "L-BFGS-B")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.