GradMod: Gradient method for function minimum approximation.

Description Usage Arguments Examples

Description

Gradient method for approximating a functions minimum value. The purpose of this method is to compare its result with the BarBor method.

Usage

1
Gradmod(exp,eps,G,B,m,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.

B

Inner approximation coefficient, recommended value is 0.5.

m

Inner 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
test1 = expression(x1*x1+10*x2*x2)
eps = 10^-10
G = 10^-2
B = 0.5
m = 20
x = c(3,4)
v = c("x1","x2")
n = 10000
Gradmod(test1,eps,G,B,m,x,v,n)

BarBorGradient documentation built on May 2, 2019, 6:11 a.m.