[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference rusure::math

Title:Mathematics at DEC
Moderator:RUSURE::EDP
Created:Mon Feb 03 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2083
Total number of notes:14613

85.0. "Curve through 3 points" by HARE::STAN () Thu Jun 28 1984 02:46

From:	ROLL::USENET       "USENET Newsgroup Distributor" 25-JUN-1984 22:03
To:	HARE::STAN
Subj:	USENET net.math newsgroup articles

Newsgroups: net.math,net.ai,net.research
Path: decwrl!decvax!ittvax!dcdwest!sdcsvax!sdccsu3!ee171bbr
Subject: Best fitting curve
Posted: Sun Jun 24 09:26:54 1984


Given three points, what is the equation
of the best fit curve. (how does one
go about solving this?)

also, what is knuth's cocubic equation
and would that solve my problem?


John F.
T.RTitleUserPersonal
Name
DateLines
85.1HARE::STANThu Jun 28 1984 02:4616
From:	ROLL::USENET       "USENET Newsgroup Distributor" 26-JUN-1984 22:49
To:	HARE::STAN
Subj:	USENET net.math newsgroup articles

Newsgroups: net.math,net.ai,net.research
Path: decwrl!decvax!mcnc!unc!ulysses!allegra!mouton!mwg
Subject: Re: Best fitting curve - 3 points
Posted: Mon Jun 25 06:08:52 1984


++
Since three points determine a parabola, just plug them into
y = Ax^2 + Bx + C and solve the system.  If you are in more than two
dimensions, you can probably do a transformation somehow into the
plane determined by the three points and solve; then translate back.
		-Mark
85.2HARE::STANThu Jun 28 1984 02:4645
Newsgroups: net.math,net.ai,net.research
Path: decwrl!decvax!yale-comix!leichter
Subject: Re: Best fitting curve
Posted: Mon Jun 25 11:40:06 1984


The notion of a "best fitting curve" through some points has no inherent
meaning.  You have to specify what kinds of curves you are willing to allow,
what kind of constraints you want to put on them, and what kind of measurement
of "fit" you are interested in.

Given n points in the plane, in general there is a unique (n-1)st degree poly-
nomial that passes through those points.  (Hence, there are infinitely many
nth degree polynomials, one for every other point in the plane that you can
consider to be an (n+1)st point.)  Such a polynomial is "best" in the sense
that it has 0 error at every point specified.  It is almost certainly not
what you would want for fitting data; it will generally oscillate between
your data points and will have uncontrollable behavior outside the range in
which your data points occur - i.e., the curve will not look at all "smooth"
to the eye.  Even if you want a curve that "looks good", you can use a
cubic (or higher-order) spline curve.  This is a curve defined by fitting
together polynomials; you take the first 4 points in order, pass a cubic
through them, take the last two and the next one, pick a cubic through those
that has the same derivative at the 4th point as the first cubic, etc...
(There are many other ways to choose spline curves.  This particular method
passes through all the points; in some cases, "smoothness" of some sort may
be more important than actually touching the points, so some kinds of splines
don't even pass through the given data points.  All spline curves are piece-
wise defined polynomials; there is no simple algebraic formula that defines
them; rather, there is a series of such formulas, one for each range of input
values.)

If the goal of "best fit" is to produce good interpolated values for a function,
rather than a curve that "looks" like it is determined by the points, all sorts
of other techniques exist.  For example, a Chebyshev approximation will have
the least maximum error (assuming a model in which you are approximating some
known, complex function by choosing some representative points on it and
an approximating polynomial.)  However, least maximum error is not the same
as least average absolute error, or least RMS error, or...

So, in summary:  If you give me three points, I can write down pretty much
ANY function and find some way to defend it's being the "best fit" to the
three given points.  You will have to specify your goals more precisely.
							-- Jerry
					decvax!yale-comix!leichter leichter@yale