Difference between revisions of "ApCoCoA-1:Num.LeastSquaresQR"
From ApCoCoAWiki
Line 1: | Line 1: | ||
<command> | <command> | ||
− | <title> | + | <title>Num.LeastSquaresQR</title> |
<short_description>Calculates the least squares solution to the general problem Ax=b</short_description> | <short_description>Calculates the least squares solution to the general problem Ax=b</short_description> | ||
<syntax> | <syntax> | ||
− | Num.LeastSquaresQR(Mat: | + | Num.LeastSquaresQR(Mat:MAT, Vec:MAT):MAT; |
</syntax> | </syntax> | ||
<description> | <description> | ||
− | + | <em>Please note:</em> The function(s) explained on this page is/are using the <em>ApCoCoAServer</em>. You will have to start the ApCoCoAServer in order to use it/them. | |
− | + | <par/> | |
Calculates the least squares solution to the general problem Ax=b, when there is no exact solution. The matrix Mat must have the same number of rows as Vec. | Calculates the least squares solution to the general problem Ax=b, when there is no exact solution. The matrix Mat must have the same number of rows as Vec. | ||
− | The QR | + | The QR decomposition of Mat is used to find the solution. |
<itemize> | <itemize> | ||
<item>@param <em>Mat</em> Matrix A</item> | <item>@param <em>Mat</em> Matrix A</item> | ||
<item>@param <em>Vec</em> Vector B in matrix form.</item> | <item>@param <em>Vec</em> Vector B in matrix form.</item> | ||
− | <item>@return The least squares | + | <item>@return The least squares solution to Ax=b.</item> |
</itemize> | </itemize> | ||
Line 34: | Line 34: | ||
<type>apcocoaserver</type> | <type>apcocoaserver</type> | ||
</types> | </types> | ||
− | |||
<key>Num.LeastSquaresQR</key> | <key>Num.LeastSquaresQR</key> | ||
<key>LeastSquaresQR</key> | <key>LeastSquaresQR</key> | ||
<wiki-category>Package_numerical</wiki-category> | <wiki-category>Package_numerical</wiki-category> | ||
</command> | </command> |
Revision as of 16:43, 23 April 2009
Num.LeastSquaresQR
Calculates the least squares solution to the general problem Ax=b
Syntax
Num.LeastSquaresQR(Mat:MAT, Vec:MAT):MAT;
Description
Please note: The function(s) explained on this page is/are using the ApCoCoAServer. You will have to start the ApCoCoAServer in order to use it/them.
Calculates the least squares solution to the general problem Ax=b, when there is no exact solution. The matrix Mat must have the same number of rows as Vec.
The QR decomposition of Mat is used to find the solution.
@param Mat Matrix A
@param Vec Vector B in matrix form.
@return The least squares solution to Ax=b.
Example
Dec(Num.LeastSquaresQR([[1,1],[0,1],[1,1]],[[0],[1],[0]]),2); -- CoCoAServer: computing Cpu Time = 0 ------------------------------- Mat([ ["-0.99"], ["1"] ]) -------------------------------
See also