Skip to content

Commit

Permalink
fixed doubling, sign error
Browse files Browse the repository at this point in the history
  • Loading branch information
thorek1 committed Jul 31, 2024
1 parent f955d28 commit cda8faa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/MacroModelling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7242,8 +7242,14 @@ function calculate_third_order_moments(parameters::Vector{T},
lyapunov_algorithm::Symbol = :doubling,
tol::AbstractFloat = eps()) where {U, T <: Real}

Σʸ₂, Σᶻ₂, μʸ₂, Δμˢ₂, autocorr_tmp, ŝ_to_ŝ₂, ŝ_to_y₂, Σʸ₁, Σᶻ₁, SS_and_pars, 𝐒₁, ∇₁, 𝐒₂, ∇₂ = calculate_second_order_moments(parameters, 𝓂, verbose = verbose, sylvester_algorithm = sylvester_algorithm)
second_order_moments = calculate_second_order_moments(parameters,
𝓂,
verbose = verbose,
sylvester_algorithm = sylvester_algorithm,
lyapunov_algorithm = lyapunov_algorithm)

Σʸ₂, Σᶻ₂, μʸ₂, Δμˢ₂, autocorr_tmp, ŝ_to_ŝ₂, ŝ_to_y₂, Σʸ₁, Σᶻ₁, SS_and_pars, 𝐒₁, ∇₁, 𝐒₂, ∇₂ = second_order_moments

if !covariance && !autocorrelation
return μʸ₂, Δμˢ₂, Σʸ₁, Σᶻ₁, SS_and_pars, 𝐒₁, ∇₁, 𝐒₂, ∇₂
end
Expand Down
2 changes: 1 addition & 1 deletion src/lyapunov.jl
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function solve_lyapunov_equation( A::AbstractSparseMatrix{Float64},
max_iter = 500

for i in 1:max_iter
𝐂¹ = 𝐀 * 𝐂 * 𝐀' - 𝐂
𝐂¹ = 𝐀 * 𝐂 * 𝐀' + 𝐂

𝐀 *= 𝐀

Expand Down

0 comments on commit cda8faa

Please sign in to comment.