如果我们计算像 A=[1 2 3;4 5 6;7 8 9] 这样的秩亏矩阵的 QR 分解,R 矩阵的一些对角项将“非常小”。然而,当在 Julia 中进行数值计算时,这些对角线条目必须有多小才能被视为零(因此排名不足)?我正在尝试找到一个公式,而不是一个绝对数字。
A
可以被认为是
完全秩不足,但有一些加性噪声,则应忽略的
R
对角线的小错误非零元素将与以下大小大致相同A
中的噪音。例如,
julia> d = Diagonal(-5*log.(rand(5)))
5×5 Diagonal{Float64, Vector{Float64}}:
5.56654 ⋅ ⋅ ⋅ ⋅
⋅ 17.6294 ⋅ ⋅ ⋅
⋅ ⋅ 2.20874 ⋅ ⋅
⋅ ⋅ ⋅ 2.91583 ⋅
⋅ ⋅ ⋅ ⋅ 26.5664
julia> A = [d zeros(5,3); zeros(3,8)]
8×8 SparseArrays.SparseMatrixCSC{Float64, Int64} with 5 stored entries:
5.56654 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ 17.6294 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ 2.20874 ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ 2.91583 ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ 26.5664 ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅
julia> diag(qr(A).R)
8-element SparseArrays.SparseVector{Float64, Int64} with 5 stored entries:
[1] = 5.56654
[2] = 17.6294
[3] = 2.20874
[4] = 2.91583
[5] = 26.5664
julia> diag(qr(A+rand(8,8)*1e-6).R)
8-element Vector{Float64}:
-5.566543507821689
-17.629411781406233
-2.20873750628613
-2.915828986361413
-26.56641073082019
-1.1241491098747558e-6
-6.122032725632311e-7
-2.3444092119580006e-7