Algorithm-CurveFit-Simple

 view release on metacpan or  search on metacpan

bin/curvefit  view on Meta::CPAN

Options and their defaults, if any:
    --time-limit=3    Maximum number of seconds to spend calculating best fit
    --iterations=#    Maximum number of iterations to spend calculating best fit (default is to use a time limit)
    --terms=3         Number of terms in polynomial, max 10
    --inv             Invert the sense of the fit to f(y) = x
    --impl-lang=perl  Language used for output implementation: perl, C
    --impl-name=x2y   Name of function in output implementation
    --bounds-check    Implementation will check for out-of-bounds input
    --round-result    Implementation will round output to nearest integer
    --suppress-includes (C only) Do not put #include directives in output implementation
    --quiet           Do not write supplementary information to stderr
    --profile         Dump %STATS_H to stderr as json
See also: Algorithm::CurveFit::Simple
USAGE
    exit(0);
}

=head1 NAME

curvefit - Fit a polynomial to data points

=head1 SYNOPSIS

bin/curvefit  view on Meta::CPAN


      --time-limit=3    Maximum number of seconds to spend calculating best fit
      --iterations=#    Maximum number of iterations to spend calculating best fit (default is to use a time limit)
      --terms=3         Number of terms in polynomial, max 10
      --inv             Invert the sense of the fit to f(y) = x
      --impl-lang=perl  Language used for output implementation: perl, C
      --impl-name=x2y   Name of function in output implementation
      --bounds-check    Implementation will check for out-of-bounds input
      --round-result    Implementation will round output to nearest integer
      --suppress-includes (C only) Do not put #include directives in output implementation
      --quiet           Do not write supplementary information to stderr
      --profile         Dump %STATS_H to STDERR as json

=head1 DESCRIPTION

This is a thin wrapper around L<Algorithm::CurveFit::Simple>, which is in turn a convenience wrapper around L<Algorithm::CurveFit>.

Given a set of x,y data pairs on STDIN, it will generate a polynomial formula f(x) = y which fits that data, and write a source code implementation of that formula to STDOUT.

Additionally it will write a maximum deviation and average deviation to STDERR.  Closer to 1.0 is better.  Play with --terms=# until these deviations are as close to 1.0 as possible, and beware overfitting.  Use --quiet to suppress this information.



( run in 0.501 second using v1.01-cache-2.11-cpan-49f99fa48dc )