Unix/Linux Go Back    

RedHat 9 (Linux i386) - man page for pdl::opt::simplex (redhat section 3)

Linux & Unix Commands - Search Man Pages
Man Page or Keyword Search:   man
Select Man Page Set:       apropos Keyword Search (sections above)

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

       PDL::Opt::Simplex -- Simplex optimization routines

	use PDL::Opt::Simplex;

	($optimum,$ssize) = simplex($init,$initsize,$minsize,
			sub {evaluate_func_at($_[0])},
			sub {display_simplex($_[0])}

       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.


       Simplex optimization routine

	($optimum,$ssize) = simplex($init,$initsize,$minsize,
			sub {evaluate_func_at($_[0])},
			sub {display_simplex($_[0])}

       See module "PDL::Opt::Simplex" for more information.

       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

       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).

       Ron Shaffer's chemometrics web page and references therein:

       Numerical Recipes (bla bla bla XXX ref).

       The demonstration (Examples/Simplex/tsimp.pl and tsimp2.pl).

       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.8.0				    2000-05-30				       Simplex(3)
Unix & Linux Commands & Man Pages : ©2000 - 2018 Unix and Linux Forums

All times are GMT -4. The time now is 04:23 AM.