fixed.qlessQR

Q-less QR decomposition

Description

example

R = fixed.qlessQR(A) returns the upper-triangular R factor of the QR decomposition A = QR.

This is equivalent to computing

[~,R] = qr(A)

example

R = fixed.qlessQR(A,forgettingFactor) returns the upper-triangular R factor of the QR decomposition and multiplies R by the forgettingFactor before each row of A is processed.

R = fixed.qlessQR(A,[],regularizationParameter) returns the upper-triangular R factor of the QR decomposition of $\left[\begin{array}{c}\lambda {I}_{n}\\ A\end{array}\right]$ where A is an m-by-n matrix and λ is the regularizationParameter.

R = fixed.qlessQR(A,forgettingFactor,regularizationParameter) returns the upper-triangular R factor of the QR decomposition of

$\left[\begin{array}{c}{\alpha }^{m}\lambda {I}_{n}\\ \left[\begin{array}{cccc}{\alpha }^{m}& & & \\ & {\alpha }^{m-1}& & \\ & & \ddots & \\ & & & \alpha \end{array}\right]A\end{array}\right]$

where α is the forgettingFactor, λ is the regularizationParameter, and A is an m-by-n matrix.

Examples

collapse all

This example shows how to solve the system of equations ${\left(\mathit{A}}^{\prime }\mathit{A}\right)\mathit{x}=\mathit{B}$ using forward and backward substitution.

Specify the input variables, A and B.

rng default;
A = gallery('randsvd', [5,3], 1000);
b = [1; 1; 1; 1; 1];

Compute the upper-triangular factor, R, of A, where $\mathit{A}=\mathit{QR}$.

R = fixed.qlessQR(A);

Use forward and backward substitution to compute the value of X.

X = fixed.forwardSubstitute(R,b);
X(:) = fixed.backwardSubstitute(R,X)
X = 5×1
105 ×

-0.9088
2.7123
-0.8958
0
0

This solution is equivalent to using the fixed.qlessQRMatrixSolve function.

x = fixed.qlessQRMatrixSolve(A,b)
x = 5×1
105 ×

-0.9088
2.7123
-0.8958
0
0

Using a forgetting factor with the fixed.qlessQR function is roughly equivalent to the Complex- and Real Partial-Systolic Q-less QR with Forgetting Factor blocks. These blocks process one row of the input matrix at a time and apply the forgetting factor before each row is processed. The fixed.qlessQR function takes in all rows of A at once, but carries out the computation in the same way as the blocks. The forgetting factor is applied before each row is processed.

Specifying a forgetting factor is useful when you want to stream an indefinite number of rows continuously, such as reading values from a sensor array continuously, without accumulating the data without bound.

Without using a forgetting factor, the accumulation is the square root of the number of rows, so 10000 rows would accumulate to $\sqrt{10000}=100$.

A = ones(10000,3);
R = fixed.qlessQR(A)
R = 3×3

100.0000  100.0000  100.0000
0    0.0000    0.0000
0         0    0.0000

To accrue with the effective height of m=16 rows, set the forgetting factor to the following.

m=16;
forgettingFactor = exp(-1/(2*m))
forgettingFactor = 0.9692

Using the forgetting factor, fixed.qlessQR would accumulate to about square root of 16.

R = fixed.qlessQR(A,forgettingFactor)
R = 3×3

3.9377    3.9377    3.9377
0    0.0000    0.0000
0         0    0.0000

Input Arguments

collapse all

Input matrix, specified as a matrix.

Data Types: single | double | fi
Complex Number Support: Yes

Forgetting factor, specified as a nonnegative scalar between 0 and 1. The forgetting factor determines how much weight past data is given. The forgettingFactor value is multiplied by R before each row of A is processed.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fi

Regularization parameter, specified as a nonnegative scalar. Small, positive values of the regularization parameter can improve the conditioning of the problem and reduce the variance of the estimates. While biased, the reduced variance of the estimate often results in a smaller mean squared error when compared to least-squares estimates.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fi

Output Arguments

collapse all

Upper-triangular factor, returned as a matrix that satisfies A = QR.

Version History

Introduced in R2020b