Difference between revisions of "ApCoCoA-1:Num.LeastSquaresQR"
From ApCoCoAWiki
m (Bot: Category moved) |
m (replaced <quotes> tag by real quotes) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <command> | + | {{Version|1}} |
+ | <command> | ||
<title>Num.LeastSquaresQR</title> | <title>Num.LeastSquaresQR</title> | ||
<short_description>Computes the least squares solution of the linear system of equations <tt>Ax=b</tt>.</short_description> | <short_description>Computes the least squares solution of the linear system of equations <tt>Ax=b</tt>.</short_description> | ||
Line 21: | Line 22: | ||
-- CoCoAServer: computing Cpu Time = 0 | -- CoCoAServer: computing Cpu Time = 0 | ||
------------------------------- | ------------------------------- | ||
− | [ | + | ["-0.99", "1"] |
------------------------------- | ------------------------------- | ||
</example> | </example> | ||
</description> | </description> | ||
<seealso> | <seealso> | ||
− | <see>Introduction to CoCoAServer</see> | + | <see>ApCoCoA-1:Introduction to CoCoAServer|Introduction to CoCoAServer</see> |
</seealso> | </seealso> | ||
<types> | <types> |
Latest revision as of 13:47, 29 October 2020
This article is about a function from ApCoCoA-1. |
Num.LeastSquaresQR
Computes the least squares solution of the linear system of equations Ax=b.
Syntax
Num.LeastSquaresQR(Mat:MAT, Vec:MAT):LIST
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.
This command computes the least squares solution of the linear system of equations Ax=b, if 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 of the linear system of equations.
@param Vec Vector B as a matrix.
@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 ------------------------------- ["-0.99", "1"] -------------------------------
See also