{ } Raw JSON

bundles / scipy 1.17.1 / scipy / linalg / interpolative / estimate_rank

function

scipy.linalg.interpolative:estimate_rank

source: /scipy/linalg/interpolative.py :885

Signature

def   estimate_rank ( A eps rng = None )

Summary

Estimate matrix rank to a specified relative precision using randomized methods.

Extended Summary

The matrix A can be given as either a numpy.ndarray or a scipy.sparse.linalg.LinearOperator, with different algorithms used for each case. If A is of type numpy.ndarray, then the output rank is typically about 8 higher than the actual numerical rank.

Parameters

A : :class:`numpy.ndarray` or :class:`scipy.sparse.linalg.LinearOperator`

Matrix whose rank is to be estimated, given as either a numpy.ndarray or a scipy.sparse.linalg.LinearOperator with the rmatvec method (to apply the matrix adjoint).

eps : float

Relative error for numerical rank definition.

rng : `numpy.random.Generator`, optional

Pseudorandom number generator state. When rng is None, a new numpy.random.Generator is created using entropy from the operating system. Types other than numpy.random.Generator are passed to numpy.random.default_rng to instantiate a Generator. If rand is False, the argument is ignored.

Returns

: int

Estimated matrix rank.

Aliases

  • scipy.linalg.interpolative.estimate_rank