Powell: Powell's method for finding a functions local minimum.

Description Usage Arguments Examples

View source: R/Powell.R

Description

Powell's method for finding a function local minimum. The function need not be differentiable, and no derivatives are taken. The function must be a real-valued function of a fixed number of real-valued inputs.

Usage

1
Powell(exp,eps,G,eta,m,k,x,v,n)

Arguments

exp

Expression of the function to be minimized.

eps

Precision of the approximation, recommended value is 10^-10.

G

Inner approximation coefficient, recommended value is 10^-2.

eta

Inner approximation coefficient, recommended value is G*2.

m

Inner steps, recommended value is 20.

k

Second inner approximation steps, recommended value is 20.

x

Starting point of the approximation.

v

A character vector of the functions variables. Exmaple: the two dimension fuction x1*x1+10*x2*x2 needs a c("x1","x2") vector.

n

Maximum setps to make while approximating, if the calculation reaches this number it exits with the current value and point. Recommended to be 10000.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
test1 = expression(100*(x1*x1-x2)*(x1*x1-x2)+(1-x1)*(1-x1))
eps = 10^-5
G = 10^-2
eta = G *2
m = 20
k = 20
n = 10000
max = 1000
x = c(1,1)
v = c("x1","x2")
Powell(test1,eps,G,eta,m,k,x,v,n)

Example output

[1] "Stacionarius pont: "
[1] 1 1
[1] "Fuggveny ertek: "
[1] 0
[1] "Lepesszam: "
[1] 1

BarBorGradient documentation built on May 29, 2017, 7:21 p.m.