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

Cholesky identification #2

Closed
BenjaminBorn opened this issue Jul 3, 2018 · 5 comments
Closed

Cholesky identification #2

BenjaminBorn opened this issue Jul 3, 2018 · 5 comments

Comments

@BenjaminBorn
Copy link
Collaborator

Hi Luca,

Sorry to bother you again but I tried to use your package to replicate some Cholesky identified IRFs generated using old Matlab codes of mine and I didn't succeed. I then noticed that in the irf_chol() function you have the following line:
https://github.com/lucabrugnolini/VAR.jl/blob/2f0f8e51e32c92494df1598b1095b5718811cf2b/src/VAR.jl#L548
This is puzzling as full(cholfact(A)) just reconstructs the matrix A but I think what you need is the lower diagonal matrix cholfact(A)[:L]. See the following example

A = [2.0 2.0; 2.0 2.0]
Base.LinAlg.Cholesky{Float64,Array{Float64,2}} with factor:
[1.41421 0.0; 1.41421 2.10734e-8]

cholfact(A)[:L]
2×2 LowerTriangular{Float64,Array{Float64,2}}:
 1.41421   ⋅        
 1.41421  2.10734e-8

full(cholfact(A))
2×2 Array{Float64,2}:
 2.0  2.0
 2.0  2.0

If I replace line 548 by mSigma = cholfact(V.Σ)[:L], I can replicate my results. I'm probably missing something and it would be great if you could help me out.

Best, Benjamin

@lucabrugnolini
Copy link
Owner

lucabrugnolini commented Jul 4, 2018 via email

@BenjaminBorn
Copy link
Collaborator Author

Thanks for looking into this and for adding me to the project.

I guess it would be worthwhile to set up some tests so that if Julia syntax breaks we are alerted. Maybe we could test against the codes supplied with the Kilian/Luetkepohl book at: http://www-personal.umich.edu/~lkilian/book.html

@lucabrugnolini
Copy link
Owner

lucabrugnolini commented Jul 4, 2018 via email

@lucabrugnolini
Copy link
Owner

I did some fix and added an example in test/runtest.jl with known DGP. Have a check if you still get the same problem, and in case let me know.

Thanks

@BenjaminBorn
Copy link
Collaborator Author

Yep, that fixes the issue. Thanks a lot.

lucabrugnolini pushed a commit that referenced this issue Jun 21, 2022
…-00-07-26-922-4217838583

CompatHelper: add new compat entry for "GrowableArrays" at version "0.1"
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

2 participants