Strange (and wrong) factorization

Open
#33 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
julia
Domain
backend

Research direction

No source file or test is named. Start by reproducing the matrix example and comparing cholesky(Positive, F) with Julia's cholesky(F), then trace the package's positive-definite factorization entry point. Done means the final factor and the resulting inverse behave consistently with the reference factorization for this case.

Written by the indexing model from the issue text.

Description

Consider this matrix:

F = [42491.1429254459 1.0544416413649244e6 64.9016820609457 1712.2779951809016; 1.0544416413649244e6 2.616823794441869e7 1610.468694700484 42488.422800411565; 64.9016820609457 1610.468694700484 0.10421453600353446 2.6155294717625517; 1712.2779951809016 42488.422800411565 2.6155294717625517 69.0045838263577]

It is not particularly good, but also not awfully bad, eg

det(F) # 0.020309321582317352 which is close to 0, but OK

Here is what I get with the package against the Julia base

julia> cholesky(Positive, F).L
4×4 LowerTriangular{Float64, Matrix{Float64}}:
  206.134       ⋅          ⋅           ⋅ 
 5115.33      40.9241      ⋅           ⋅ 
    0.314852  -0.0025192  0.071248     ⋅ 
    8.30663   -0.0664632  2.98325e-8  1.0

julia> cholesky(F).L
4×4 LowerTriangular{Float64, Matrix{Float64}}:
  206.134       ⋅          ⋅           ⋅ 
 5115.33      40.9241      ⋅           ⋅ 
    0.314852  -0.0025192  0.071248     ⋅ 
    8.30663   -0.0664632  2.98325e-8  0.000236804

Basically the factorizations are almost identical with the exception of the last element. It also gives the wrong inverse

julia> inv(cholesky(Positive, F)) * F
4×4 Matrix{Float64}:
 1.0          -5.05104e-11  -1.11159e-15   0.0805992
 5.60538e-14   1.0          -1.24247e-16  -0.00162406
 1.14508e-13  -7.95464e-11   1.0           4.18713e-7
 2.27374e-13  -7.27596e-12  -1.33227e-15   5.60763e-8
Dominant language
Julia
Stars
40
Forks
12
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from timholy/PositiveFactorizations.jl

All issues in timholy/PositiveFactorizations.jl

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.