QuantEcon / Gensys.jl

A Julia version of Gensys (Sims 2000)
5 stars 11 forks source link

Support for complex Schur decomposition #6

Open FuZhiyu opened 4 years ago

FuZhiyu commented 4 years ago

First of all, thanks for this package. I made some slight modifications to account for the recent changes of Julia (see my forked repo). It significantly saved my time compared to totally rewriting it from scratch.

I noticed that (at least under Julia>=1.0) if the input matrix Gamma0 and Gamma1 are real, by default schur decomposition will only return the real component of the eigenvalues when complex decomposition should be returned.. This behavior is inconsistent with the original MATLAB functions, and sometimes yields non-existence for valid inputs.

In my own implementation, I simply convert the input to complex matrices, and everything works now.

matthieugomez commented 4 years ago

Thanks. Do you want to do a pull request with these changes?

FuZhiyu commented 4 years ago

For the moment I only modified gensysct.jl for my own usage but not gensysdt.jl. Would be happy to do a pull request once I fixed them all.

Also, my gensysct.jl cannot pass the last test in runtest.jl, though on my computer the original matlab script gives the same results. Probably the same issue as #4 .

matthieugomez commented 4 years ago

That would be great! Yes feel free to modify the test to be consistent with Matlab.

It would be nice also to add a test that correspond to the behavior you correct (ie that requires the Complex conversion)

On Mon, Dec 30, 2019 at 6:40 PM FuZhiyu notifications@github.com wrote:

For the moment I only modified gensysct.jl for my own usage but not gensysdt.jl. Would be happy to do a pull request once I fixed them all.

Also, my gensysct.jl cannot pass the last test in runtest.jl, though on my computer the original matlab script gives the same results. Probably the same issue as #4 https://github.com/QuantEcon/Gensys.jl/issues/4 .

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/QuantEcon/Gensys.jl/issues/6?email_source=notifications&email_token=ABPPPXJZ6JILH7VJFC57YWDQ3IXCTA5CNFSM4KBF5I4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH2ZZTQ#issuecomment-569744590, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPPPXPAYAQMBOLKTMR7FSTQ3IXCTANCNFSM4KBF5I4A .