From 5ab5bb71b3acc40b6371211b997f17106784aba5 Mon Sep 17 00:00:00 2001 From: Thore Kockerols Date: Fri, 8 Nov 2024 23:03:25 +0000 Subject: [PATCH] no shocks message --- src/filter/find_shocks.jl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/filter/find_shocks.jl b/src/filter/find_shocks.jl index 353d63dd..c861bb2d 100644 --- a/src/filter/find_shocks.jl +++ b/src/filter/find_shocks.jl @@ -127,9 +127,10 @@ function find_shocks(::Val{:LagrangeNewton}, # println("Norm: $(ℒ.norm(x̂) / max(norm1,norm2))") # println(ℒ.norm(Δxλ)) # println(ℒ.norm(Δxλ) / ℒ.norm(xλ)) - if !(ℒ.norm(x̂) / max(norm1,norm2) < tol && ℒ.norm(Δxλ) / ℒ.norm(xλ) < sqrt(tol)) - println("Find shocks failed. Norm 1: $(ℒ.norm(x̂) / max(norm1,norm2)); Norm 2: $(ℒ.norm(Δxλ) / ℒ.norm(xλ))") - end + # if !(ℒ.norm(x̂) / max(norm1,norm2) < tol && ℒ.norm(Δxλ) / ℒ.norm(xλ) < sqrt(tol)) + # println("Find shocks failed. Norm 1: $(ℒ.norm(x̂) / max(norm1,norm2)); Norm 2: $(ℒ.norm(Δxλ) / ℒ.norm(xλ))") + # end + return x, ℒ.norm(x̂) / max(norm1,norm2) < tol && ℒ.norm(Δxλ) / ℒ.norm(xλ) < sqrt(tol) end @@ -351,9 +352,9 @@ function find_shocks(::Val{:LagrangeNewton}, # println(ℒ.norm(Δxλ)) # println(ℒ.norm(x̂) / max(norm1,norm2) < tol && ℒ.norm(Δxλ) / ℒ.norm(xλ) < tol) - if !(ℒ.norm(x̂) / max(norm1,norm2) < tol && ℒ.norm(Δxλ) / ℒ.norm(xλ) < sqrt(tol)) - println("Find shocks failed. Norm 1: $(ℒ.norm(x̂) / max(norm1,norm2)); Norm 2: $(ℒ.norm(Δxλ) / ℒ.norm(xλ))") - end + # if !(ℒ.norm(x̂) / max(norm1,norm2) < tol && ℒ.norm(Δxλ) / ℒ.norm(xλ) < sqrt(tol)) + # println("Find shocks failed. Norm 1: $(ℒ.norm(x̂) / max(norm1,norm2)); Norm 2: $(ℒ.norm(Δxλ) / ℒ.norm(xλ))") + # end return x, ℒ.norm(x̂) / max(norm1,norm2) < tol && ℒ.norm(Δxλ) / ℒ.norm(xλ) < sqrt(tol) end