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 |
Here's one for you lunchtime mathematicians. And a solution is urgently needed. I am without any reference books and working on customer site. I need a subroutine that will give me a best-fit linear equation through 3 calibration points. by best-fit, i mean that I desire the linear equation that minimizes the errors^2 for each of the three points supplied. C C C CALL BESTFIT( X1,Y1 , X2,Y2 , X3,Y3 , M_COEF, B_COEF) C C C How does the math work?? dj brown (I can guarantee that no two of the calib pts have the same X value)
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
1552.1 | CLT::KOBAL::GILBERT | Ownership Obligates | Thu Jan 30 1992 12:50 | 27 | |
Problem: Given x[i] and y[i] for i=1..n, find m and b that minimize: n f = sum (m�x[i]+b - y[i])� i=1 Solution: Using partial derivatives we get these two equations: m�Sx + b�n - Sy = 0 m�Sxx + b�Sx - Sxy = 0 where: n n Sx = sum x[i], Sy = sum y[i], i=1 i=1 n n Sxx = sum x[i]�, Sxy = sum x[i]�y[i] i=1 i=1 So finally, m = (Sxy�n - Sx�Sy)/(Sxx�n - (Sx)�) b = (Sxx�Sy - Sx�Sxy)/(Sxx�n - (Sx)�) | |||||
1552.2 | solution found ! | PTOVAX::DJBROWN | To feel we are able, is to be so | Thu Jan 30 1992 14:24 | 9 |
This is wonderful ! Thanks a million. You know, its resources like this (having a nation-wide NOTE-ing network) and the fact that we have a lot of top-notch people working for this company that *REALLY* impress our customers ! I have my solution tested and implimented, and works great. Again, Thanks ::GILBERT ! |