Skip to content

Commit

Permalink
try catch schur
Browse files Browse the repository at this point in the history
  • Loading branch information
thorek1 committed Dec 24, 2023
1 parent bb373b5 commit 960c6e5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/MacroModelling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4452,8 +4452,12 @@ function riccati_forward(∇₁::Matrix{Float64}; T::timings, explosive::Bool =
D = vcat(hcat(Ã₀₋, Ã₊), hcat(I₋, Z₊))
E = vcat(hcat(-Ã₋,-Ã₀₊), hcat(Z₋, I₊))
# this is the companion form and by itself the linearisation of the matrix polynomial used in the linear time iteration method. see: https://opus4.kobv.de/opus4-matheon/files/209/240.pdf
schdcmp =.schur(D,E)

schdcmp = try
.schur(D, E)
catch
return zeros(T.nVars,T.nPast_not_future_and_mixed), false
end

if explosive # returns false for NaN gen. eigenvalue which is correct here bc they are > 1
eigenselect = abs.(schdcmp.β ./ schdcmp.α) .>= 1

Expand Down

0 comments on commit 960c6e5

Please sign in to comment.