Library: | nummath |
See also: | nmparabint |
Quantlet: | nmbracket | |
Description: | This quantlet brackets a minimum of a given scalar function |
Usage: | {a,b,c,fa,fb,fc} = nmbracket(func {,a0,b0}) | |
Input: | ||
func | name of function (string) whose minimum should be bracketed. The function should have just one scalar parameter x. As a result, the function should return a scalar. | |
a0,b0 | distinct initial points (scalars) for bracketing, default: a0 = 0, b0 = 1 | |
Output: | ||
a,b,c | points (scalars) bracketing a minimum of func; a < b < c | |
fa,fb,fc | function values at points a,b,c respectively; bracketing of minimum means that fb < fa and fb < fc |
library("nummath") ; ; definition of function ; proc(p)=f(x) p = cos((x+3*pi)/4)*x^2 endp bracket=nmbracket("f") bracket
Contents of bracket.a [1,] 2.618 Contents of bracket.b [1,] 5.2361 Contents of bracket.c [1,] 9.4721 Contents of bracket.fa [1,] -6.7955 Contents of bracket.fb [1,] -23.743 Contents of bracket.fc [1,] 1.0622