Math-Amoeba
view release on metacpan or search on metacpan
lib/Math/Amoeba.pm view on Meta::CPAN
=over
=item C<MinimiseND>
The simplest use is the B<MinimiseND> function. This takes a reference
to an array of guess values for the parameters at the function
minimum, a reference to an array of scales for these parameters
(sensible ranges around the guess in which to look), a reference to
the function, a convergence tolerence for the minimum, the maximum
number of iterations to be taken and the verbose flag (default ON).
It returns an array consisting of a reference to the function parameters
at the minimum and the value there.
=item C<Amoeba>
The B<Amoeba> function is the actual implimentation of the Downhill
Simpex Method in Multidimensions. It takes a reference to an array of
references to arrays which are the initial n+1 vertices (where n is
the number of function parameters), a reference to the function
valuation at these vertices, a reference to the function, a
convergence tolerence for the minimum, the maximum number of
iterations to be taken and the verbose flag (default ON).
It returns an array consisting of a reference to the function parameters
at the minimum and the value there.
=item C<ConstructVertices>
The B<ConstructVertices> is used by B<MinimiseND> to construct the
initial vertices for B<Amoeba> as the initial guess plus the parameter
scale parameters as vectors along the parameter axis.
=item C<EvaluateVertices>
lib/Math/Amoeba.pm view on Meta::CPAN
# Loop until any of stopping conditions hit
while (1)
{
($ilo, $inhi, $ihi) = _FindMarkers($y);
# Stopping conditions
my $rtol = 2*abs($y->[$ihi]-$y->[$ilo])/(abs($y->[$ihi])+abs($y->[$ilo])+TINY);
if ($rtol<$ftol) { last; }
if ($iter++>$itmax) {
carp "Amoeba exceeded maximum iterations\n" if ($verbose);
last;
}
# Determine the Centroid
if ($recalc) {
$pbar = _CalcCentroid($p, $ihi);
} else {
_AdjustCentroid($pbar, $p, $ihi_o, $ihi);
}
( run in 2.856 seconds using v1.01-cache-2.11-cpan-71847e10f99 )