Pijavski: Global univariate minimization of Lipschitz functions using...

Description Usage Arguments Value Author(s) Examples

View source: R/RcppExports.R

Description

Pijavski performs global univariate optimization of a Lipschitz function fn. The return value is a list containing x,val=fn(x), precision reached and number of iterations made. Pijavski code in C++ is being called from R environment with multiple arguments

Usage

1
Pijavski( fn, Lips, a, b, iter, prec, env)

Arguments

fn

input, a pointer to the objective function fn

Lips

input, an overestimate of the Lipschitz constant of fn

a,b

input, left and right boundaries of the interval of minimization

iter

input and output, the maximum number of function evaluations, on return, the number of iterations made

prec

input and output, the desired precision in terms of the value of fn, on return the difference between best fn and the lower estimate on the minimum. If negative, the Lipschitz constant is too small

env

input, environment variable passed from R containing a reference to fn, should be defined as new.env(list(fn = myfunction))

Value

A list with components

x

The global minimizer of fn.

value

The final value of the function being optimized.

precision

The precision of the result in terms of the difference of value and the lower estimate on fn.

iterations

Number of function evaluations performed.

Author(s)

Gleb Beliakov and Gita Das

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
 optimize_funcR <- function(x,y){
   y <- x * x
   return(y)
 }

 output<-Pijavski(optimize_funcR, 5, -2.0, 1.0, 1000, 10^-3,
         new.env(list(fn = optimize_funcR)))
 output

# named parameters
 output<-Pijavski(fn= optimize_funcR, Lips=4, a=-2.0, b=1.0, 
    iter=1000, prec=10^-3, env=new.env(list(fn = optimize_funcR)))

 output

Example output

[[1]]
[1] -3.975338e-05

[[2]]
[1] 1.580331e-09

[[3]]
[1] 0.0009961356

[[4]]
[1] 367

[[1]]
[1] 0.0001892551

[[2]]
[1] 3.581748e-08

[[3]]
[1] 0.0009811363

[[4]]
[1] 279

Pijavski documentation built on Jan. 13, 2021, 6:35 p.m.

Related to Pijavski in Pijavski...