Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I used David J Taylor's Polyfit example (curvefit.zip), which implements a least squares curve fitting algorithm (also known as linear regression) David's site is <a href="http://www.satsignal.eu/software/components.html#CurveFit" rel="nofollow noreferrer">here</a>, but keep reading, because my version is better. (See below).</p> <p>The origin of the algorithms David is using is a book on scientific math for Pascal programmers, Allen Miller's Curve Fitting routine from the book "Pascal Programs For Scientists And Engineers", typed and submitted to MTPUG in Oct. 1982 by Juergen Loewner, and corrected and adaptated for Turbo Pascal by Jeff Weiss. </p> <p>You can grab curvefit.zip directly from bitbucket <a href="https://bitbucket.org/wpostma/curvefit/downloads/curvefit.zip" rel="nofollow noreferrer">here</a>. (You can clone the sourcecode with Mercurial/TortoiseHG, or download a ZIP from bitbucket)</p> <pre><code>hg clone https://bitbucket.org/wpostma/curvefit curvefit </code></pre> <p>It runs in any delphi version 5 and up, Unicode or not, even Delphi 10 Berlin. It has a little chart in the demo, added by me. I also added a way to force the result through the origin, a common technique where you want a best fit on all values, other than the constant term, which should be forced, either to zero, or to some experimentally derived average. A forced "blank subtraction" which is set equal to the average of a series of analytical "zero samples", is common in certain types of analytical chemistry when used with certain types of instrumentation, and in other scientific cases, where it can be more useful than a best-fit, because you may wish to minimize error around the origin more than minimize error across the area of the curve that is farthest from the origin.</p> <p>I should also clarify that for purposes of linear regression, a "curve" may also be a line, which is the case I needed for analytical chemistry purposes, and that equation for any straight line (y=mx+b) is also called the "calibration curve". A first order curve fit is a line (y = mx +b), a second order curve fit (shown in the picture) is a parabola (y= nX^2 + mX + b). As you might guess, this algorithm scales from first order up to any level you might wish. I haven't tested it above 8 terms though.</p> <p>Here's a screenshot:</p> <p><img src="https://i.stack.imgur.com/1cfuC.png" alt="polyfit example with chart"></p> <p>Bitbucket project link:</p> <p><a href="https://bitbucket.org/wpostma/curvefit/overview" rel="nofollow noreferrer">https://bitbucket.org/wpostma/curvefit/overview</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload