Thread View: bit.listserv.graph-ti
2 messages
2 total messages
Started by ANDREW CHEYNE
Thu, 12 Jan 1995 02:43
looking for a formula.
Author: ANDREW CHEYNE
Date: Thu, 12 Jan 1995 02:43
Date: Thu, 12 Jan 1995 02:43
19 lines
1725 bytes
1725 bytes
Hello!
I'm attempting to write a program that will read in a bunch of data
points, perform a least squares fit to the points, and then draw the best
fit line. I know the basics behind writing the program, but I'm in need of
formulas that woud calculate m and b in y=mx+b. I know I should be able to
figure these out with a little bit of calculus, but the calculus seems to
lost on me! I also know that I should be able to do this using the Stats
button on my TI-85, but I want to be able to integrate this program between
the 85 and my PC. If anyone could mail me the formulas, I'd really
appreciate it!
Thanks,
Andrew
[=-=-=]_____________________________________________________[=-=-=]
||||| Andrew Cheyne 006809c@axe.acadiau.ca |||||
--- 233 Barrax Acadia University ---
||||| (902) 542-0195 Wolfville, NS |||||
[=-=-=]-----------------------------------------------------[=-=-=]
Re: looking for a formula.
Author: Andy Den Tandt
Date: Fri, 13 Jan 1995 12:58
Date: Fri, 13 Jan 1995 12:58
45 lines
2463 bytes
2463 bytes
ANDREW CHEYNE (006809c@axe.acadiau.ca) wrote:
: Hello!
: I'm attempting to write a program that will read in a bunch of data
: points, perform a least squares fit to the points, and then draw the best
: fit line. I know the basics behind writing the program, but I'm in need of
: formulas that woud calculate m and b in y=mx+b. I know I should be able to
: figure these out with a little bit of calculus, but the calculus seems to
: lost on me! I also know that I should be able to do this using the Stats
: button on my TI-85, but I want to be able to integrate this program between
: the 85 and my PC. If anyone could mail me the formulas, I'd really
: appreciate it!
The general least squares fit for A.X=Y
with A a (m x n) matrix,
X a (n x 1)
Y a (m x 1)
For you, A=[ x0 1 ] X= [m] Y=[y0]
[ x1 1 ] [b] [y1]
etc. etc.
T T
is given by the lineair system A .A.X=A .Y, so you transpose A and
multiply by AX and Y.
There's allways a solution, but you need the one with the smallest
length. I think that if your x0,x1.. aren't all the same, there should be
only one solution. And if they are, the y's are it too, so you took only
1 point, which is crazy.
Hope I helped.
************************************************************
Watch out! Even I am not perfect!
************************************************************
****************************
** Andy Den Tandt **
****************************
** adntandt@rug.ac.be **
****************************
** University of Ghent **
** Belgium **
****************************
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads