# What are “least square solutions”

## Description

computes a matrix *X* that solves the linear matrix equation *A**X* = *B* in the least squares sense: the columns *X*_{j} of minimize where the *B*_{j} are the columns of .

For a given vector *B*, a vector *X* minimizes if and only if *X* is a solution of the “normal equations” *A*^{H}*A**X* = *A*^{H}*B*, where *A*^{H} is the Hermitian transpose of the *m*×*n* matrix *A*. The solution is unique if *rank*(*A*) = *n*.

allows to solve several least squares problems simultaneously by combining several ‘right hand sides’ *B*_{j} columnwise to a matrix .

If no return type is specified via the option , the domain type of the return data depends on the type of the input matrix :

The special solution

*X*as well as the kernel of an array*A*are returned as arrays.The special solution and the kernel of an hfarray of domain type are returned as hfarrays.

For a dense matrix

*A*of type , both the special solution*X*as well as the kernel are returned as matrices of type over the ring of MuPAD^{®}expressions.For all other matrices of category , both the special solution

*X*as well as the kernel are returned as matrices of type over the ring of MuPAD expressions. This includes input matrices of type , , etc.

Without , the input data are converted to floating-point numbers. The matrix *A* must not contain non-convertible parameters, unless is used. If such objects are found, automatically switches to its symbolic mode, issuing a warning. This warning may be suppressed via .

Symbolic parameters in *B* are accepted without warning. However, cannot be used if there are any symbolic parameters in *A* or *B*.

If *A*^{H}*A* has a non-trivial kernel, the least squares solution *X* is not unique. The return value is a *special* solution of the equation *A*^{H}*A**X* = *A*^{H}*B*. With the method, is the special solution with columns of minimal Euclidean length.

### Note

The result computed with may differ from the solution computed with or ! In particular, this is the case for systems with a non-trivial kernel. Further, the The results computed with and may differ.

The kernel is computed only in the symbolic mode (option ). All floating-point methods return the value for the kernel.

With , the *n*×*d* matrix is the most general solution of *A*^{H}*A**X* = 0. Its columns span the *d*-dimensional kernel of *A*^{H}*A*.

If the kernel is 0-dimensional, the return value of is the integer 0. If is returned as an array, the dimension *d* of the kernel is = . If is returned as a matrix of type or , the dimension *d* of the kernel is = .

### Note

Without the option , the implemented algorithms take care of numerical stabilization.

With , exact data are assumed. The least squares solutions is computed via . The symbolic strategy tries do maximize speed and does not take care of numerical stabilization! Do not use for systems involving floating-point entries! In particluar, due to round-off, it may happen that no solution of *A*^{H}*A**X* = *A*^{H}*B* is found. In such a case, is returned. Cf. Example 4.

All entries of and must be arithmetical expressions.

### Note

Apart from matrices of type , objects from matrix domains such as or are internally converted to arrays over expressions via . Note that the option should be used if the entries cannot be converted to numerical expressions.

The same holds true for matrices passed as objects.

## Return Values

A list is returned.

The (special) least squares solution is an *n*×*p* matrix.

With , is an *n*×*d* matrix (*d* is the dimension of the kernel of *A*^{H}*A*). Its columns span the kernel of *A*^{H}*A*. If the kernel is trivial, is the integer 0.

Without , the kernel is not computed. The value is returned for the .

The list of arithmetical expressions consists of the minimized least squares deviations corresponding to the columns of and .

- What constitutes a landslide in voting
- What are the features of Android Pi
- Why are Reagan Bush shirts so popular
- What is a cronut
- Orthography Are there any vowel only scripts
- Can we call Poriferans diploblastic animals
- Can you feed cows dry corn
- What are the scopes over studying VisCom
- What do you prioritise friendship or relationship
- What do you hate that teens do
- Can SEO understand online
- Does America pay taxes to the queen
- What is worst case complexity
- When is word repetition appropriate in writing
- How do I implement latent Dirichlet allocation