Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

posdef(::WoodburyPDMat) is not always correct #29

Open
tpgillam opened this issue Jul 15, 2022 · 0 comments
Open

posdef(::WoodburyPDMat) is not always correct #29

tpgillam opened this issue Jul 15, 2022 · 0 comments

Comments

@tpgillam
Copy link
Contributor

In the case that S has all entries being zero, which is permitted, the resulting matrix will be positive semi-definite, but only positive definite if all the following are true:

  • size(A, 1) == size(A, 2)
  • all elements of D are positive (again, only non-negativity is enforced)

For example, this matrix is positive semi-definite, but not positive definite:

julia> A, D, S = ([1 2 3; 4 1 7]', Diagonal([1, 2]), Diagonal([0, 0, 0]))
([1 4; 2 1; 3 7], [1 0; 0 2], [0 0 0; 0 0 0; 0 0 0])

julia> x = WoodburyPDMat(A, D, S)
3×3 WoodburyPDMat{Int64, Adjoint{Int64, Matrix{Int64}}, Diagonal{Int64, Vector{Int64}}, Diagonal{Int64, Vector{Int64}}}:
 33  10   59
 10   6   20
 59  20  107

julia> isposdef(x)
true

julia> isposdef(Matrix(x))
false

(I do wonder whether there should be a ispossemidef function defined somewhere central, e.g. LinearAlgebra or maybe PDMats. since being PSD is useful, and often sufficient for many useful algorithms to apply)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant