@@ -201,6 +201,45 @@ def compute_rqb(
201201) -> NamedTuple (
202202 "RQB" , [("Q" , np .ndarray ), ("B" , np .ndarray ), ("Omega" , np .ndarray )]
203203):
204+ """
205+ Randomized QB Decomposition.
206+
207+ :param X: the matrix to decompose.
208+ :type X: np.ndarray
209+ :param svd_rank: the rank for the truncation; If 0, the method computes
210+ the optimal rank and uses it for truncation; if positive interger,
211+ the method uses the argument for the truncation; if float between 0
212+ and 1, the rank is the number of the biggest singular values that
213+ are needed to reach the 'energy' specified by `svd_rank`; if -1,
214+ the method does not compute truncation. Use this parameter to
215+ define the target rank of the input matrix.
216+ :type svd_rank: int or float
217+ :param oversampling: Number of additional samples (beyond the target rank)
218+ to use when computing the random test matrix. Note that values in the
219+ range [5, 10] tend to be sufficient.
220+ :type oversampling: int
221+ :param power_iters: Number of power iterations to perform when executing
222+ the Randomized QB Decomposition. Note that as many as 1 to 2 power
223+ iterations often lead to considerable improvements.
224+ :type power_iters: int
225+ :param Omega: The random test matrix that will be used when executing
226+ the Randomized QB Decomposition. If not provided, the `svd_rank` and
227+ `oversampling` parameters will be used to compute the random matrix.
228+ :type Omega: numpy.ndarray
229+ :param seed: Seed used to initialize the random generator when computing
230+ random test matrices.
231+ :type seed: int
232+ :return: the orthonormal basis matrix, the transformed data matrix, and
233+ the random test matrix.
234+ :rtype: NamedTuple("RQB", [('Q', np.ndarray),
235+ ('B', np.ndarray),
236+ ('Omega', np.ndarray)])
237+
238+ References:
239+ N. Benjamin Erichson, Lionel Mathelin, J. Nathan Kutz, Steven L. Brunton.
240+ Randomized dynamic mode decomposition. SIAM Journal on Applied Dynamical
241+ Systems, 18, 2019.
242+ """
204243 if X .ndim != 2 :
205244 raise ValueError ("Please ensure that input data is a 2D array." )
206245
0 commit comments