From 09fe0fed32d0403cd40f5444be48a95573d0543a Mon Sep 17 00:00:00 2001 From: thorek1 Date: Wed, 18 Dec 2024 22:22:03 +0000 Subject: [PATCH] remove last timer --- src/MacroModelling.jl | 21 ++++++++++++--------- src/filter/inversion.jl | 7 ++++++- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/MacroModelling.jl b/src/MacroModelling.jl index d759197c..f99ca53e 100644 --- a/src/MacroModelling.jl +++ b/src/MacroModelling.jl @@ -4179,7 +4179,7 @@ function calculate_second_order_stochastic_steady_state(parameters::Vector{M}, A = 𝐒₁[:,1:𝓂.timings.nPast_not_future_and_mixed] BĖ‚ = 𝐒₂[:,kron_s⁚_s⁚] - SSSstates, converged = calculate_second_order_stochastic_steady_state(Val(:Newton), 𝐒₁, 𝐒₂, SSSstates, 𝓂) # , timer = timer) + SSSstates, converged = calculate_second_order_stochastic_steady_state(Val(:newton), 𝐒₁, 𝐒₂, SSSstates, 𝓂) # , timer = timer) if !converged if verbose println("SSS not found") end @@ -4206,7 +4206,7 @@ end -function calculate_second_order_stochastic_steady_state(::Val{:Newton}, +function calculate_second_order_stochastic_steady_state(::Val{:newton}, 𝐒₁::Matrix{Float64}, 𝐒₂::AbstractSparseMatrix{Float64}, x::Vector{Float64}, @@ -4264,7 +4264,7 @@ end -function calculate_second_order_stochastic_steady_state(::Val{:Newton}, +function calculate_second_order_stochastic_steady_state(::Val{:newton}, 𝐒₁::Matrix{ℱ.Dual{Z,S,N}}, 𝐒₂::AbstractSparseMatrix{ℱ.Dual{Z,S,N}}, x::Vector{ℱ.Dual{Z,S,N}}, @@ -4334,7 +4334,7 @@ end function rrule(::typeof(calculate_second_order_stochastic_steady_state), - ::Val{:Newton}, + ::Val{:newton}, 𝐒₁::Matrix{Float64}, 𝐒₂::AbstractSparseMatrix{Float64}, x::Vector{Float64}, @@ -4519,7 +4519,7 @@ function calculate_third_order_stochastic_steady_state( parameters::Vector{M}, BĖ‚ = 𝐒₂[:,kron_s⁚_s⁚] CĖ‚ = 𝐒₃[:,kron_s⁚_s⁚_s⁚] - SSSstates, converged = calculate_third_order_stochastic_steady_state(Val(:Newton), 𝐒₁, 𝐒₂, 𝐒₃, SSSstates, 𝓂) + SSSstates, converged = calculate_third_order_stochastic_steady_state(Val(:newton), 𝐒₁, 𝐒₂, 𝐒₃, SSSstates, 𝓂) if !converged if verbose println("SSS not found") end @@ -4544,7 +4544,7 @@ function calculate_third_order_stochastic_steady_state( parameters::Vector{M}, end -function calculate_third_order_stochastic_steady_state(::Val{:Newton}, +function calculate_third_order_stochastic_steady_state(::Val{:newton}, 𝐒₁::Matrix{Float64}, 𝐒₂::AbstractSparseMatrix{Float64}, 𝐒₃::AbstractSparseMatrix{Float64}, @@ -4596,7 +4596,7 @@ function calculate_third_order_stochastic_steady_state(::Val{:Newton}, end -function calculate_third_order_stochastic_steady_state(::Val{:Newton}, +function calculate_third_order_stochastic_steady_state(::Val{:newton}, 𝐒₁::Matrix{ℱ.Dual{Z,S,N}}, 𝐒₂::AbstractSparseMatrix{ℱ.Dual{Z,S,N}}, 𝐒₃::AbstractSparseMatrix{ℱ.Dual{Z,S,N}}, @@ -4676,7 +4676,7 @@ end function rrule(::typeof(calculate_third_order_stochastic_steady_state), - ::Val{:Newton}, + ::Val{:newton}, 𝐒₁::Matrix{Float64}, 𝐒₂::AbstractSparseMatrix{Float64}, 𝐒₃::AbstractSparseMatrix{Float64}, @@ -7413,7 +7413,10 @@ function get_relevant_steady_state_and_state_update(::Val{:first_order}, sylvester_algorithm::Symbol = :bicgstab, # timer::TimerOutput = TimerOutput(), verbose::Bool = false)::Tuple{timings, Vector{S}, Union{Matrix{S},Vector{AbstractMatrix{S}}}, Vector{Vector{Float64}}, Bool} where S <: Real - SS_and_pars, (solution_error, iters) = get_NSSS_and_parameters(𝓂, parameter_values, tol = tol, timer = timer, verbose = verbose) + SS_and_pars, (solution_error, iters) = get_NSSS_and_parameters(𝓂, parameter_values, + tol = tol, + # timer = timer, + verbose = verbose) state = zeros(𝓂.timings.nVars) diff --git a/src/filter/inversion.jl b/src/filter/inversion.jl index 76365e07..e7c9472c 100644 --- a/src/filter/inversion.jl +++ b/src/filter/inversion.jl @@ -3358,6 +3358,7 @@ function filter_data_with_model(𝓂::â„ģ, data_in_deviations::KeyedArray{Float64}, ::Val{:first_order}, # algo ::Val{:inversion}; # filter + quadratic_matrix_equation_solver::Symbol = :schur, warmup_iterations::Int = 0, smooth::Bool = true, verbose::Bool = false) @@ -3381,7 +3382,11 @@ function filter_data_with_model(𝓂::â„ģ, ∇₁ = calculate_jacobian(𝓂.parameter_values, SS_and_pars, 𝓂)# |> Matrix - 𝐒₁, qme_sol, solved = calculate_first_order_solution(∇₁; T = T, initial_guess = 𝓂.solution.perturbation.qme_solution, verbose = verbose) + 𝐒₁, qme_sol, solved = calculate_first_order_solution(∇₁; + T = T, + quadratic_matrix_equation_solver = quadratic_matrix_equation_solver, + initial_guess = 𝓂.solution.perturbation.qme_solution, + verbose = verbose) if solved 𝓂.solution.perturbation.qme_solution = qme_sol end