shubert: Shubert-Piyavskii Method

View source: R/shubert.R

shubertR Documentation

Shubert-Piyavskii Method

Description

Shubert-Piyavskii Univariate Function Maximization

Usage

shubert(f, a, b, L, crit = 1e-04, nmax = 1000)

Arguments

f

function to be optimized.

a, b

search between a and b for a maximum.

L

a Lipschitz constant for the function.

crit

critical value

nmax

maximum number of steps.

Details

The Shubert-Piyavskii method, often called the Sawtooth Method, finds the global maximum of a univariate function on a known interval. It is guaranteed to find the global maximum on the interval under certain conditions:

The function f is Lipschitz-continuous, that is there is a constant L such that

|f(x) - f(y)| \le L |x - y|

for all x, y in [a, b].

The process is stopped when the improvement in the last step is smaller than the input argument crit.

Value

Returns a list with the following components:

xopt

the x-coordinate of the minimum found.

fopt

the function value at the minimum.

nopt

number of steps.

References

Y. K. Yeo. Chemical Engineering Computation with MATLAB. CRC Press, 2017.

See Also

findmins

Examples

# Determine the global minimum of sin(1.2*x)+sin(3.5*x) in [-3, 8].
f <- function(x) sin(1.2*x) + sin(3.5*x)
shubert(function(x) -f(x), -3, 8, 5, 1e-04, 1000)
## $xopt
## [1] 3.216231     # 3.216209
## $fopt
## [1] 1.623964
## $nopt
## [1] 481

pracma documentation built on Nov. 10, 2023, 1:14 a.m.