document.write( "Question 313163: I'm stumped.\r
\n" ); document.write( "\n" ); document.write( "Given an array of known X and Y values, and a list of *new* X values, how can I solve for what the new Y value will be ?\r
\n" ); document.write( "\n" ); document.write( "A bit more detail: In Excel, I plotted these known X and Y values by means of a XY Scatter Chart, then asked it to create me a Trend Line, showing me the formula. The formula, for this data, is: y = 14.132x² - 63.03x + 79.647. I need to know how to actually *arrive* at that formula by a more manual means.\r
\n" ); document.write( "\n" ); document.write( "Thanks! :)
\n" ); document.write( "

Algebra.Com's Answer #223913 by Fombitz(32388)\"\" \"About 
You can put this solution on YOUR website!
Check out the link below for the particulars.
\n" ); document.write( "You can do this all within an EXCEL spreadsheet.
\n" ); document.write( "You're trying to fit \"y=a0%2Ba1%2Ax%2Ba2%2Ax%5E2\"to the given \"N\" sets of data (\"xi\",\"yi\").
\n" ); document.write( ".
\n" ); document.write( ".
\n" ); document.write( ".
\n" ); document.write( "You need to create a matrix of values.
\n" ); document.write( "[X]=\"%28matrix%283%2C3%2Ca%2Cb%2Cc%2Cb%2Cc%2Cd%2Cc%2Cd%2Ce%29%29\"
\n" ); document.write( "where
\n" ); document.write( "\"a=N\"
\n" ); document.write( "\"b=sum%28xi%2C1%2CN%29\"
\n" ); document.write( "\"c=sum%28xi%5E2%2C1%2CN%29\"
\n" ); document.write( "\"d=sum%28xi%5E3%2C1%2CN%29\"
\n" ); document.write( "\"e=sum%28xi%5E4%2C1%2CN%29\"
\n" ); document.write( ".
\n" ); document.write( ".
\n" ); document.write( ".
\n" ); document.write( "Then create another matrix of values,
\n" ); document.write( "[Y]=\"%28matrix%283%2C1%2Cp%2Cq%2Cr%29%29\"
\n" ); document.write( "where
\n" ); document.write( "\"p=sum%28yi%2C1%2CN%29\"
\n" ); document.write( "\"q=sum%28xi%2Ayi%2C1%2CN%29\"
\n" ); document.write( "\"r=sum%28xi%5E2%2Ayi%2C1%2CN%29\"
\n" ); document.write( "Then you have the coefficients a0,a1, and a2.
\n" ); document.write( "[a]=\"%28matrix%283%2C1%2Ca0%2Ca1%2Ca2%29%29\"
\n" ); document.write( ".
\n" ); document.write( ".
\n" ); document.write( ".
\n" ); document.write( "The matrix equation you need to solve is,
\n" ); document.write( "[X][a]=[Y]
\n" ); document.write( "[a]=[X]inv[Y]
\n" ); document.write( "So find the inverse of [X] and matrix multiply by [Y].
\n" ); document.write( "That will provide you the coefficients of the least square fit quadratic, [a].
\n" ); document.write( ".
\n" ); document.write( ".
\n" ); document.write( ".
\n" ); document.write( "http://mathworld.wolfram.com/LeastSquaresFittingPolynomial.html
\n" ); document.write( "
\n" );