Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pdl::opt::simplex(3) [suse man page]

Simplex(3)						User Contributed Perl Documentation						Simplex(3)

NAME
PDL::Opt::Simplex -- Simplex optimization routines SYNOPSIS
use PDL::Opt::Simplex; ($optimum,$ssize) = simplex($init,$initsize,$minsize, $maxiter, sub {evaluate_func_at($_[0])}, sub {display_simplex($_[0])} ); DESCRIPTION
This package implements the commonly used simplex optimization algorithm. The basic idea of the algorithm is to move a "simplex" of N+1 points in the N-dimensional search space according to certain rules. The main benefit of the algorithm is that you do not need to calculate the derivatives of your function. $init is a 1D vector holding the initial values of the N fitted parameters, $optimum is a vector holding the final solution. $initsize is the size of $init (more...) $minsize is some sort of convergence criterion (more...) - e.g. $minsize = 1e-6 The sub is assumed to understand more than 1 dimensions and threading. Its signature is 'inp(nparams); [ret]out()'. An example would be sub evaluate_func_at { my($xv) = @_; my $x1 = $xv->slice("(0)"); my $x2 = $xv->slice("(1)"); return $x1**4 + ($x2-5)**4 + $x1*$x2; } Here $xv is a vector holding the current values of the parameters being fitted which are then sliced out explicitly as $x1 and $x2. $ssize gives a very very approximate estimate of how close we might be - it might be miles wrong. It is the euclidean distance between the best and the worst vertices. If it is not very small, the algorithm has not converged. FUNCTIONS
simplex Simplex optimization routine ($optimum,$ssize) = simplex($init,$initsize,$minsize, $maxiter, sub {evaluate_func_at($_[0])}, sub {display_simplex($_[0])} ); See module "PDL::Opt::Simplex" for more information. CAVEATS
Do not use the simplex method if your function has local minima. It will not work. Use genetic algorithms or simulated annealing or conjugate gradient or momentum gradient descent. They will not really work either but they are not guaranteed not to work ;) (if you have infinite time, simulated annealing is guaranteed to work but only after it has visited every point in your space). SEE ALSO
Ron Shaffer's chemometrics web page and references therein: "http://chem1.nrl.navy.mil/~shaffer/chemoweb.html". Numerical Recipes (bla bla bla XXX ref). The demonstration (Examples/Simplex/tsimp.pl and tsimp2.pl). AUTHOR
Copyright(C) 1997 Tuomas J. Lukka. All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. perl v5.12.1 2009-10-17 Simplex(3)

Check Out this Related Man Page

MROOT(3)						User Contributed Perl Documentation						  MROOT(3)

NAME
PDL::GSL::MROOT - PDL interface to multidimensional root-finding routines in GSL DESCRIPTION
This is an interface to the multidimensional root-finding package present in the GNU Scientific Library. At the moment there is a single function gslmroot_fsolver which provides an interface to the algorithms in the GSL library that do not use derivatives. SYNOPSIS
use PDL; use PDL::GSL::MROOT; my $init = pdl (-10.00, -5.0); my $epsabs = 1e-7; $res = gslmroot_fsolver($init, &rosenbrock, {Method => 0, EpsAbs => $epsabs}); sub rosenbrock{ my ($x) = @_; my $a = 1; my $b = 10; my $y = zeroes($x); $y->slice(0) .= $a * (1 - $x->slice(0)); $y->slice(1) .= $b * ($x->slice(1) - $x->slice(0)**2); return $y; } FUNCTIONS
gslmroot_fsolver -- Multidimensional root finder without using derivatives This function provides an interface to the multidimensional root finding algorithms in the GSL library. It takes a minimum of two argumennts: a piddle $init with an initial guess for the roots of the system and a reference to a function. The latter function must return a piddle whose i-th element is the i-th equation evaluated at the vector x (a piddle which is the sole input to this function). See the example in the Synopsis above for an illustration. The function returns a piddle with the roots for the system of equations. Two optional arguments can be specified as shown below. One is Method, which can take the values 0,1,2,3. They correspond to the 'hybrids', 'hybrid', 'dnewton' and 'broyden' algorithms respectively (see GSL documentation for details). The other optional argument is Epsabs, which sets the absolute accuracy to which the roots of the system of equations are required. The default value for Method is 0 ('hybrids' algorithm) and the default for Epsabs is 1e-3. Usage: $res = gslmroot_fsolver($init, $function_ref, [{Method => $method, Epsabs => $epsabs}]); SEE ALSO
PDL The GSL documentation is online at http://sources.redhat.com/gsl/ref/gsl-ref_toc.html AUTHOR
This file copyright (C) 2006 Andres Jordan <ajordan@eso.org> and Simon Casassus <simon@das.uchile.cl> All rights reserved. There is no warranty. You are allowed to redistribute this software/documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file. FUNCTIONS
fsolver_meat Signature: (double xfree(n); double epsabs(); int method(); SV* funcion1) info not available fsolver_meat does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. perl v5.12.1 2010-07-05 MROOT(3)
Man Page