From 1fc4fd03837000cc1a17755ae1d80d50835dc01e Mon Sep 17 00:00:00 2001 From: thorek1 Date: Sun, 19 Nov 2023 23:04:03 +0000 Subject: [PATCH 01/34] no precompile --- src/MacroModelling.jl | 142 +++++++++++++++++++++--------------------- 1 file changed, 71 insertions(+), 71 deletions(-) diff --git a/src/MacroModelling.jl b/src/MacroModelling.jl index 0741f9b1..dfe27b9b 100644 --- a/src/MacroModelling.jl +++ b/src/MacroModelling.jl @@ -6148,79 +6148,79 @@ end -@setup_workload begin - # Putting some things in `setup` can reduce the size of the - # precompile file and potentially make loading faster. - @model FS2000 precompile = true begin - dA[0] = exp(gam + z_e_a * e_a[x]) - log(m[0]) = (1 - rho) * log(mst) + rho * log(m[-1]) + z_e_m * e_m[x] - - P[0] / (c[1] * P[1] * m[0]) + bet * P[1] * (alp * exp( - alp * (gam + log(e[1]))) * k[0] ^ (alp - 1) * n[1] ^ (1 - alp) + (1 - del) * exp( - (gam + log(e[1])))) / (c[2] * P[2] * m[1])=0 - W[0] = l[0] / n[0] - - (psi / (1 - psi)) * (c[0] * P[0] / (1 - n[0])) + l[0] / n[0] = 0 - R[0] = P[0] * (1 - alp) * exp( - alp * (gam + z_e_a * e_a[x])) * k[-1] ^ alp * n[0] ^ ( - alp) / W[0] - 1 / (c[0] * P[0]) - bet * P[0] * (1 - alp) * exp( - alp * (gam + z_e_a * e_a[x])) * k[-1] ^ alp * n[0] ^ (1 - alp) / (m[0] * l[0] * c[1] * P[1]) = 0 - c[0] + k[0] = exp( - alp * (gam + z_e_a * e_a[x])) * k[-1] ^ alp * n[0] ^ (1 - alp) + (1 - del) * exp( - (gam + z_e_a * e_a[x])) * k[-1] - P[0] * c[0] = m[0] - m[0] - 1 + d[0] = l[0] - e[0] = exp(z_e_a * e_a[x]) - y[0] = k[-1] ^ alp * n[0] ^ (1 - alp) * exp( - alp * (gam + z_e_a * e_a[x])) - gy_obs[0] = dA[0] * y[0] / y[-1] - gp_obs[0] = (P[0] / P[-1]) * m[-1] / dA[0] - log_gy_obs[0] = log(gy_obs[0]) - log_gp_obs[0] = log(gp_obs[0]) - end - - @parameters FS2000 silent = true precompile = true begin - alp = 0.356 - bet = 0.993 - gam = 0.0085 - mst = 1.0002 - rho = 0.129 - psi = 0.65 - del = 0.01 - z_e_a = 0.035449 - z_e_m = 0.008862 - end +# @setup_workload begin +# # Putting some things in `setup` can reduce the size of the +# # precompile file and potentially make loading faster. +# @model FS2000 precompile = true begin +# dA[0] = exp(gam + z_e_a * e_a[x]) +# log(m[0]) = (1 - rho) * log(mst) + rho * log(m[-1]) + z_e_m * e_m[x] +# - P[0] / (c[1] * P[1] * m[0]) + bet * P[1] * (alp * exp( - alp * (gam + log(e[1]))) * k[0] ^ (alp - 1) * n[1] ^ (1 - alp) + (1 - del) * exp( - (gam + log(e[1])))) / (c[2] * P[2] * m[1])=0 +# W[0] = l[0] / n[0] +# - (psi / (1 - psi)) * (c[0] * P[0] / (1 - n[0])) + l[0] / n[0] = 0 +# R[0] = P[0] * (1 - alp) * exp( - alp * (gam + z_e_a * e_a[x])) * k[-1] ^ alp * n[0] ^ ( - alp) / W[0] +# 1 / (c[0] * P[0]) - bet * P[0] * (1 - alp) * exp( - alp * (gam + z_e_a * e_a[x])) * k[-1] ^ alp * n[0] ^ (1 - alp) / (m[0] * l[0] * c[1] * P[1]) = 0 +# c[0] + k[0] = exp( - alp * (gam + z_e_a * e_a[x])) * k[-1] ^ alp * n[0] ^ (1 - alp) + (1 - del) * exp( - (gam + z_e_a * e_a[x])) * k[-1] +# P[0] * c[0] = m[0] +# m[0] - 1 + d[0] = l[0] +# e[0] = exp(z_e_a * e_a[x]) +# y[0] = k[-1] ^ alp * n[0] ^ (1 - alp) * exp( - alp * (gam + z_e_a * e_a[x])) +# gy_obs[0] = dA[0] * y[0] / y[-1] +# gp_obs[0] = (P[0] / P[-1]) * m[-1] / dA[0] +# log_gy_obs[0] = log(gy_obs[0]) +# log_gp_obs[0] = log(gp_obs[0]) +# end + +# @parameters FS2000 silent = true precompile = true begin +# alp = 0.356 +# bet = 0.993 +# gam = 0.0085 +# mst = 1.0002 +# rho = 0.129 +# psi = 0.65 +# del = 0.01 +# z_e_a = 0.035449 +# z_e_m = 0.008862 +# end - ENV["GKSwstype"] = "nul" - - @compile_workload begin - # all calls in this block will be precompiled, regardless of whether - # they belong to your package or not (on Julia 1.8 and higher) - @model RBC precompile = true begin - 1 / c[0] = (0.95 / c[1]) * (α * exp(z[1]) * k[0]^(α - 1) + (1 - δ)) - c[0] + k[0] = (1 - δ) * k[-1] + exp(z[0]) * k[-1]^α - z[0] = 0.2 * z[-1] + 0.01 * eps_z[x] - end +# ENV["GKSwstype"] = "nul" + +# @compile_workload begin +# # all calls in this block will be precompiled, regardless of whether +# # they belong to your package or not (on Julia 1.8 and higher) +# @model RBC precompile = true begin +# 1 / c[0] = (0.95 / c[1]) * (α * exp(z[1]) * k[0]^(α - 1) + (1 - δ)) +# c[0] + k[0] = (1 - δ) * k[-1] + exp(z[0]) * k[-1]^α +# z[0] = 0.2 * z[-1] + 0.01 * eps_z[x] +# end - @parameters RBC silent = true precompile = true begin - δ = 0.02 - α = 0.5 - end +# @parameters RBC silent = true precompile = true begin +# δ = 0.02 +# α = 0.5 +# end - get_SS(FS2000) - get_SS(FS2000, parameters = :alp => 0.36) - get_solution(FS2000) - get_solution(FS2000, parameters = :alp => 0.35) - get_standard_deviation(FS2000) - get_correlation(FS2000) - get_autocorrelation(FS2000) - get_variance_decomposition(FS2000) - get_conditional_variance_decomposition(FS2000) - get_irf(FS2000) - - data = simulate(FS2000)[:,:,1] - observables = [:c,:k] - calculate_kalman_filter_loglikelihood(FS2000, data(observables), observables) - get_mean(FS2000, silent = true) - # get_SSS(FS2000, silent = true) - # get_SSS(FS2000, algorithm = :third_order, silent = true) - - # import Plots, StatsPlots - # plot_irf(FS2000) - # plot_solution(FS2000,:k) # fix warning when there is no sensitivity and all values are the same. triggers: no strict ticks found... - # plot_conditional_variance_decomposition(FS2000) - end -end +# get_SS(FS2000) +# get_SS(FS2000, parameters = :alp => 0.36) +# get_solution(FS2000) +# get_solution(FS2000, parameters = :alp => 0.35) +# get_standard_deviation(FS2000) +# get_correlation(FS2000) +# get_autocorrelation(FS2000) +# get_variance_decomposition(FS2000) +# get_conditional_variance_decomposition(FS2000) +# get_irf(FS2000) + +# data = simulate(FS2000)[:,:,1] +# observables = [:c,:k] +# calculate_kalman_filter_loglikelihood(FS2000, data(observables), observables) +# get_mean(FS2000, silent = true) +# # get_SSS(FS2000, silent = true) +# # get_SSS(FS2000, algorithm = :third_order, silent = true) + +# # import Plots, StatsPlots +# # plot_irf(FS2000) +# # plot_solution(FS2000,:k) # fix warning when there is no sensitivity and all values are the same. triggers: no strict ticks found... +# # plot_conditional_variance_decomposition(FS2000) +# end +# end end From e23b0ad87b85fef7215fe3a7dc0aa0f69f876022 Mon Sep 17 00:00:00 2001 From: thorek1 Date: Wed, 22 Nov 2023 16:07:40 +0100 Subject: [PATCH 02/34] first test script --- test/test_cycles.jl | 209 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 209 insertions(+) create mode 100644 test/test_cycles.jl diff --git a/test/test_cycles.jl b/test/test_cycles.jl new file mode 100644 index 00000000..0f3b2c69 --- /dev/null +++ b/test/test_cycles.jl @@ -0,0 +1,209 @@ +using MacroModelling +import LinearAlgebra as ℒ +import RecursiveFactorization as RF + +@model cycle_prototype begin + μ[0] * λ[0] = Q[0] * e[1]^φₑ * λ[1] + + Q[0] = (1 + (1 - e[0]) * ϕ * Φ[0]) + + Φ[0] = Φ̄ * exp(Φ̄² * (100 * (e[0] - ē))^2 + Φ̄³ * (100 * (e[0] - ē))^3) + + λ[0] = (Y[1] + (1 - δ - γ) / (1 - δ) * X[0] - (1 - δ - ψ) / (1 - δ) * γ * Y[0])^(-ω) + + X[1] = (1 - δ) * X[0] + ψ * Y[1] + + Y[1] = z[0] * e[0]^α + + log(μ[0]) = ρμ * log(μ[-1]) + σμ * ϵμ[x] + + log(z[0]) = ρz * log(z[-1]) + σz * ϵz[x] +end + + +@parameters cycle_prototype begin + ρμ = 0.0671 + ρz = 0.6254 + σμ = 0.00014 + σz = 0.0027 + α = 0.67 + ψ = 0.3905 + δ = 0.05 + ω = 0.2736 + γ = 0.6259 + ē = 0.943 + Φ̄³ = 0.00066 + Φ̄² = 0.0018 + Φ̄ = 0.047 + ϕ = 0.9108 + φₑ = 0.046 +end + + +SS(cycle_prototype) +# include("../models/RBC_baseline.jl") + + +𝓂 = cycle_prototype +verbose = true +parameters = 𝓂.parameter_values +T = 𝓂.timings + + +SS_and_pars, (solution_error, iters) = 𝓂.SS_solve_func(parameters, 𝓂, verbose, false, 𝓂.solver_parameters) + +∇₁ = calculate_jacobian(parameters, SS_and_pars, 𝓂) |> Matrix + + +∇₊ = @view ∇₁[:,1:T.nFuture_not_past_and_mixed] +∇₀ = @view ∇₁[:,T.nFuture_not_past_and_mixed .+ range(1, T.nVars)] +∇₋ = @view ∇₁[:,T.nFuture_not_past_and_mixed + T.nVars .+ range(1, T.nPast_not_future_and_mixed)] + + +Q = ℒ.qr(collect(∇₀[:,T.present_only_idx])) +Qinv = Q.Q' + +A₊ = Qinv * ∇₊ +A₀ = Qinv * ∇₀ +A₋ = Qinv * ∇₋ + +dynIndex = T.nPresent_only+1:T.nVars + +Ã₊ = @view A₊[dynIndex,:] +Ã₋ = @view A₋[dynIndex,:] +Ã₀₊ = @view A₀[dynIndex, T.future_not_past_and_mixed_idx] +Ã₀₋ = @views A₀[dynIndex, T.past_not_future_idx] * ℒ.diagm(ones(T.nPast_not_future_and_mixed))[T.not_mixed_in_past_idx,:] + +Z₊ = zeros(T.nMixed,T.nFuture_not_past_and_mixed) +I₊ = @view ℒ.diagm(ones(T.nFuture_not_past_and_mixed))[T.mixed_in_future_idx,:] + +Z₋ = zeros(T.nMixed,T.nPast_not_future_and_mixed) +I₋ = @view ℒ.diagm(ones(T.nPast_not_future_and_mixed))[T.mixed_in_past_idx,:] + +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) + + +############## +expand = @views [ℒ.diagm(ones(T.nVars))[T.future_not_past_and_mixed_idx,:], +ℒ.diagm(ones(T.nVars))[T.past_not_future_and_mixed_idx,:]] + +∇₊ = @views ∇₁[:,1:T.nFuture_not_past_and_mixed] * expand[1] +∇₀ = @views ∇₁[:,T.nFuture_not_past_and_mixed .+ range(1,T.nVars)] +∇₋ = @views ∇₁[:,T.nFuture_not_past_and_mixed + T.nVars .+ range(1,T.nPast_not_future_and_mixed)] * expand[2] +∇ₑ = @views ∇₁[:,(T.nFuture_not_past_and_mixed + T.nVars + T.nPast_not_future_and_mixed + 1):end] + +A = [∇₊ zero(∇₊) + zero(∇₊) ℒ.diagm(fill(1,size(∇₊,1)))] + +B = [∇₀ ∇₋ + ℒ.diagm(fill(1,size(∇₊,1))) zero(∇₊) ] + + +schdcmp = ℒ.schur(A,B) + +eigenselect = abs.(schdcmp.β ./ schdcmp.α) .< 1 +ℒ.ordschur!(schdcmp, eigenselect) + +eigen(-schdcmp.Z[T.nVars+1:end, 1:T.nVars] \ schdcmp.Z[T.nVars+1:end, T.nVars+1:end]) +abs.(eigenvalues) + +# check eigenvals +eigenvalues = schdcmp.β ./ schdcmp.α + +# inside unit circle +eigenvalue_inside_unit_circle = abs.(eigenvalues) .< 1 + +# real and > 1 +eigenvalue_real_greater_one = isapprox.(imag.(eigenvalues), 0) .&& real.(eigenvalues) .> 1 + +# infinite +eigenvalue_infinite = abs.(eigenvalues) .> 1e10 + +eigenvalue_never_include = eigenvalue_infinite .|| eigenvalue_real_greater_one + +ny = 𝓂.timings.nPast_not_future_and_mixed + +other_eigenvalues = .!(eigenvalue_inside_unit_circle .|| eigenvalue_never_include) + +ny - sum(eigenvalue_inside_unit_circle) + + + +ℒ.ordschur!(schdcmp, .!eigenvalue_infinite) + +# check eigenvals +eigenvalues = schdcmp.β ./ schdcmp.α + +# inside unit circle +eigenvalue_inside_unit_circle = abs.(eigenvalues) .< 1 + +# real and > 1 +eigenvalue_real_greater_one = isapprox.(imag.(eigenvalues), 0) .&& real.(eigenvalues) .> 1 + +# infinite +eigenvalue_infinite = abs.(eigenvalues) .> 1e10 + +eigenvalue_never_include = eigenvalue_infinite .|| eigenvalue_real_greater_one + +ny = 𝓂.timings.nPast_not_future_and_mixed + +other_eigenvalues = .!(eigenvalue_inside_unit_circle .|| eigenvalue_never_include) + +ny - sum(eigenvalue_inside_unit_circle) + + + +ℒ.ordschur!(schdcmp, eigenvalue_inside_unit_circle) + + + +eigenselect = abs.(schdcmp.β ./ schdcmp.α) .< 1 +eigenselect = BitVector([1,1,0,0,1,0]) +ℒ.ordschur!(schdcmp, eigenselect) +schdcmp.β ./ schdcmp.α +(schdcmp.S[1:3,1:3]' * schdcmp.T[1:3,1:3]) |> eigen + +# J45 + +Z₂₁ = @view schdcmp.Z[T.nPast_not_future_and_mixed+1:end, 1:T.nPast_not_future_and_mixed] +Z₁₁ = @view schdcmp.Z[1:T.nPast_not_future_and_mixed, 1:T.nPast_not_future_and_mixed] + +S₁₁ = @view schdcmp.S[1:T.nPast_not_future_and_mixed, 1:T.nPast_not_future_and_mixed] +T₁₁ = @view schdcmp.T[1:T.nPast_not_future_and_mixed, 1:T.nPast_not_future_and_mixed] + + +Ẑ₁₁ = RF.lu(Z₁₁, check = false) + +if !ℒ.issuccess(Ẑ₁₁) + return zeros(T.nVars,T.nPast_not_future_and_mixed), false +end +# end + +Ŝ₁₁ = RF.lu(S₁₁, check = false) + +if !ℒ.issuccess(Ŝ₁₁) + return zeros(T.nVars,T.nPast_not_future_and_mixed), false +end + +D = Z₂₁ / Ẑ₁₁ +L = Z₁₁ * (Ŝ₁₁ \ T₁₁) / Ẑ₁₁ + +sol = @views vcat(L[T.not_mixed_in_past_idx,:], D) + +Ā₀ᵤ = @view A₀[1:T.nPresent_only, T.present_only_idx] +A₊ᵤ = @view A₊[1:T.nPresent_only,:] +Ã₀ᵤ = @view A₀[1:T.nPresent_only, T.present_but_not_only_idx] +A₋ᵤ = @view A₋[1:T.nPresent_only,:] + +Ā̂₀ᵤ = RF.lu(Ā₀ᵤ, check = false) + +if !ℒ.issuccess(Ā̂₀ᵤ) + Ā̂₀ᵤ = ℒ.svd(collect(Ā₀ᵤ)) +end + +A = @views vcat(-(Ā̂₀ᵤ \ (A₊ᵤ * D * L + Ã₀ᵤ * sol[T.dynamic_order,:] + A₋ᵤ)), sol) + +@view(A[T.reorder,:]) \ No newline at end of file From 58752f4212bdfb583ad679228acf958290298705 Mon Sep 17 00:00:00 2001 From: thorek1 Date: Thu, 23 Nov 2023 07:56:03 +0100 Subject: [PATCH 03/34] trying to match SS --- test/test_cycles.jl | 65 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 15 deletions(-) diff --git a/test/test_cycles.jl b/test/test_cycles.jl index 0f3b2c69..85b3cacb 100644 --- a/test/test_cycles.jl +++ b/test/test_cycles.jl @@ -7,42 +7,77 @@ import RecursiveFactorization as RF Q[0] = (1 + (1 - e[0]) * ϕ * Φ[0]) + # Φ[0] = Φ̄ * exp(Φ̄² * (100 * (e[0] - e[ss]))^2 + Φ̄³ * (100 * (e[0] - e[ss]))^3) Φ[0] = Φ̄ * exp(Φ̄² * (100 * (e[0] - ē))^2 + Φ̄³ * (100 * (e[0] - ē))^3) λ[0] = (Y[1] + (1 - δ - γ) / (1 - δ) * X[0] - (1 - δ - ψ) / (1 - δ) * γ * Y[0])^(-ω) X[1] = (1 - δ) * X[0] + ψ * Y[1] - Y[1] = z[0] * e[0]^α + # Y[1] = z[0] * e[0]^α + Y[1] = e[0]^α log(μ[0]) = ρμ * log(μ[-1]) + σμ * ϵμ[x] - log(z[0]) = ρz * log(z[-1]) + σz * ϵz[x] + # log(z[0]) = ρz * log(z[-1]) + σz * ϵz[x] end -@parameters cycle_prototype begin - ρμ = 0.0671 - ρz = 0.6254 - σμ = 0.00014 - σz = 0.0027 - α = 0.67 - ψ = 0.3905 +@parameters cycle_prototype symbolic = true verbose = true begin δ = 0.05 + α = 0.67 + ē = 0.943 + # e[ss] = 0.943 | ē + e[ss] = 0.943 | Φ̄ + # Φ[ss] = 0.047 | Φ̄ ω = 0.2736 γ = 0.6259 - ē = 0.943 - Φ̄³ = 0.00066 - Φ̄² = 0.0018 - Φ̄ = 0.047 - ϕ = 0.9108 + ψ = 0.3905 φₑ = 0.046 + ϕ = 0.9108 + # Φ̄ = 0.047 + Φ̄² = 1.710280496#0.0018 + Φ̄³ = 186.8311838#0.00066 + + # Φ̄² = 0.0018 + # Φ̄³ = 0.00066 + + ρz = 0#0.6254 + σz = 0#0.0027 + + # ρz = 0.6254 + # σz = 0.0027 + + ρμ = 0.0671 + σμ = 0.00014 + + # .7 < e < 1 + # Φ < 1 + # Y < 1 + # X > 7.5 + # Q < .8 + # 1 > Φ > 0 + # 1 > ē > 0.6 + # X > 7.0 + # Y > 0.7 + # Q > 0.7 + # λ > 0.7 + # e > 0.7 end +# ψ = 0.3905 +# ē = 0.943 +# α = 0.67 +# δ = 0.05 + +# ψ * ē ^ α / δ + SS(cycle_prototype) +# SS(cycle_prototype, parameters = :Φ̄² => .92) # include("../models/RBC_baseline.jl") +get_solution(cycle_prototype) 𝓂 = cycle_prototype verbose = true @@ -148,7 +183,7 @@ eigenvalue_infinite = abs.(eigenvalues) .> 1e10 eigenvalue_never_include = eigenvalue_infinite .|| eigenvalue_real_greater_one -ny = 𝓂.timings.nPast_not_future_and_mixed +ny = 𝓂.timings.nFuture_not_past_and_mixed other_eigenvalues = .!(eigenvalue_inside_unit_circle .|| eigenvalue_never_include) From 1afe8498eb4d18aaae77edf2e0515a965f4af7dd Mon Sep 17 00:00:00 2001 From: thorek1 Date: Wed, 29 Nov 2023 11:49:14 +0100 Subject: [PATCH 04/34] add test script --- test/test_cycles.jl | 774 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 736 insertions(+), 38 deletions(-) diff --git a/test/test_cycles.jl b/test/test_cycles.jl index 85b3cacb..a5141be5 100644 --- a/test/test_cycles.jl +++ b/test/test_cycles.jl @@ -1,9 +1,544 @@ -using MacroModelling +using MacroModelling, StatsPlots import LinearAlgebra as ℒ import RecursiveFactorization as RF +@model reduced_form begin + K[0] = (1 - δ) * K[-1] + I[-1] + I[0] = α * K[-1] + G[0] + G[0] = a * I[-1] ^ 3 + b * I[-1] +end + +# irregular limit cycle +@parameters reduced_form begin + α = .15 + δ = .2 + a = 100 + b = -2 +end + +# irregular limit cycle +# @parameters reduced_form begin +# α = .2 +# δ = .2 +# a = -100 +# b = 1.3 +# end + +# limit cycle +# @parameters reduced_form begin +# α = .2 +# δ = .2 +# a = 1000 +# b = -.97 +# end + +SS(reduced_form) +get_solution(reduced_form) +get_solution(reduced_form, algorithm = :second_order)#, parameters = :b => -.0) +get_solution(reduced_form, algorithm = :third_order)#, parameters = :a => .15) + +get_parameters(reduced_form, values = true) + +plot_irf(reduced_form, initial_state = fill(1e-4, 3), periods = 1000) + +plot_irf(reduced_form, initial_state = fill(1e-4, 3), periods = 1000, algorithm = :second_order) + +plot_irf(reduced_form, initial_state = fill(1e-4, 3), periods = 1000, algorithm = :third_order) + + + + + +@model reduced_form_stochastic begin + K[0] = (1 - δ) * K[-1] + I[-1] + I[0] = α * K[-1] + G[0] + G[0] = a * I[-1] ^ 3 + b * I[-1] + σ * ϵ[x] +end + +# irregular limit cycle +@parameters reduced_form_stochastic begin + α = .15 + δ = .2 + σ = .0001 + a = 100 + b = -2 +end + + +SS(reduced_form_stochastic) +get_solution(reduced_form_stochastic) +get_solution(reduced_form_stochastic, algorithm = :second_order)#, parameters = :b => -.0) +get_solution(reduced_form_stochastic, algorithm = :third_order)#, parameters = :a => .15) + +get_parameters(reduced_form_stochastic, values = true) + +plot_irf(reduced_form_stochastic, periods = 100) + +plot_irf(reduced_form_stochastic, periods = 1000, algorithm = :second_order) + +plot_irf(reduced_form_stochastic, periods = 1000, algorithm = :third_order) +plot_irf(reduced_form_stochastic, algorithm = :third_order) + +plot_irf(reduced_form_stochastic, algorithm = :third_order, periods = 100) +plot_irf(reduced_form_stochastic, algorithm = :third_order, periods = 100, negative_shock = true) + + + +plot_irf(reduced_form_stochastic, periods = 100, algorithm = :linear_time_iteration) + +plot_irf(reduced_form_stochastic, algorithm = :pruned_second_order, periods = 100) + +plot_irf(reduced_form_stochastic, algorithm = :pruned_third_order, periods = 100) + + + + + + + + +@model reduced_form_forward_looking_stochastic begin + K[0] = (1 - δ) * K[-1] + I[0] + I[0] = α * K[-1] + G[0] + G[0] = a * I[1] ^ 3 + b * I[1] + σ * ϵ[x] +end + +# irregular limit cycle +@parameters reduced_form_forward_looking_stochastic begin + α = .15 + δ = .02 + σ = .0001 + a = 10 + b = .5 +end + +SS(reduced_form_forward_looking_stochastic) +get_solution(reduced_form_forward_looking_stochastic) + +get_eigenvalues(reduced_form_forward_looking_stochastic) + +plot_irf(reduced_form_forward_looking_stochastic, algorithm = :third_order)#, parameters = :b => .5) + +get_solution(reduced_form_forward_looking_stochastic, algorithm = :second_order)#, parameters = :b => -.0) +get_solution(reduced_form_forward_looking_stochastic, algorithm = :third_order)#, parameters = :a => .15) + +get_parameters(reduced_form_forward_looking_stochastic, values = true) + +plot_irf(reduced_form_forward_looking_stochastic, periods = 100) + +plot_irf(reduced_form_forward_looking_stochastic, periods = 1000, algorithm = :second_order) + +plot_irf(reduced_form_forward_looking_stochastic, periods = 1000, algorithm = :third_order) +plot_irf(reduced_form_forward_looking_stochastic, algorithm = :third_order) + +plot_irf(reduced_form_forward_looking_stochastic, algorithm = :third_order, periods = 100) +plot_irf(reduced_form_forward_looking_stochastic, algorithm = :third_order, periods = 100, negative_shock = true) + + + +plot_irf(reduced_form_forward_looking_stochastic, periods = 100, algorithm = :linear_time_iteration) + +plot_irf(reduced_form_forward_looking_stochastic, algorithm = :pruned_second_order, periods = 100) + +plot_irf(reduced_form_forward_looking_stochastic, algorithm = :pruned_third_order, periods = 100) + + + +function get_eigenvalues(𝓂) +# 𝓂 = reduced_form_forward_looking_stochastic#cycle_prototype + verbose = true + parameters = 𝓂.parameter_values + T = 𝓂.timings + + SS_and_pars, (solution_error, iters) = 𝓂.SS_solve_func(parameters, 𝓂, verbose, false, 𝓂.solver_parameters) + + ∇₁ = calculate_jacobian(parameters, SS_and_pars, 𝓂) |> Matrix + + + ∇₊ = @view ∇₁[:,1:T.nFuture_not_past_and_mixed] + ∇₀ = @view ∇₁[:,T.nFuture_not_past_and_mixed .+ range(1, T.nVars)] + ∇₋ = @view ∇₁[:,T.nFuture_not_past_and_mixed + T.nVars .+ range(1, T.nPast_not_future_and_mixed)] + + + Q = ℒ.qr(collect(∇₀[:,T.present_only_idx])) + Qinv = Q.Q' + + A₊ = Qinv * ∇₊ + A₀ = Qinv * ∇₀ + A₋ = Qinv * ∇₋ + + dynIndex = T.nPresent_only+1:T.nVars + + Ã₊ = @view A₊[dynIndex,:] + Ã₋ = @view A₋[dynIndex,:] + Ã₀₊ = @view A₀[dynIndex, T.future_not_past_and_mixed_idx] + Ã₀₋ = @views A₀[dynIndex, T.past_not_future_idx] * ℒ.diagm(ones(T.nPast_not_future_and_mixed))[T.not_mixed_in_past_idx,:] + + Z₊ = zeros(T.nMixed,T.nFuture_not_past_and_mixed) + I₊ = @view ℒ.diagm(ones(T.nFuture_not_past_and_mixed))[T.mixed_in_future_idx,:] + + Z₋ = zeros(T.nMixed,T.nPast_not_future_and_mixed) + I₋ = @view ℒ.diagm(ones(T.nPast_not_future_and_mixed))[T.mixed_in_past_idx,:] + + 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) + + + # check eigenvals + eigenvalues = schdcmp.β ./ schdcmp.α +end + + + + + +@model larger_forward_looking_stochastic begin + K[0] = (1 - δ) * K[-1] + I[0] + I[0] = α * K[-1] + G[0] + G[0] = a * I[1] ^ 3 + b * I[1] + gg[0] + gg[0] = ρ * gg[-1] + σ * ϵ[x] +end + +# irregular limit cycle +@parameters larger_forward_looking_stochastic begin + α = .15 + δ = .02 + σ = .0001 + ρ = .1 + a = 10 + b = .5 +end + + +SS(larger_forward_looking_stochastic) +get_solution(larger_forward_looking_stochastic) + +get_eigenvalues(larger_forward_looking_stochastic) + +plot_irf(larger_forward_looking_stochastic, algorithm = :first_order) + +plot_irf(larger_forward_looking_stochastic, algorithm = :second_order) + +plot_irf(larger_forward_looking_stochastic, algorithm = :third_order) + +plot_irf(larger_forward_looking_stochastic, algorithm = :third_order, periods = 100) +plot_irf(larger_forward_looking_stochastic, algorithm = :third_order, periods = 1000) +plot_irf(larger_forward_looking_stochastic, algorithm = :third_order, periods = 10000) + + + + + + +@model m begin + y[0]=A[0]*k[-1]^alpha + 1/c[0]=beta*1/c[1]*(alpha*A[1]*k[0]^(alpha-1)+(1-delta)) + 1/c[0]=beta*1/c[1]*(R[0]/Pi[1]) + R[0] * beta =(Pi[0]/Pibar)^phi_pi + I[0] = k[0] - (1-delta*z_delta[0])*k[-1] + A[0]*k[-1]^alpha=c[0]+I[0] + G[0] + z_delta[0] = 1 - rho_z_delta + rho_z_delta * z_delta[-1] + std_z_delta * delta_eps[x] + A[0] = 1 - rhoz + rhoz * A[-1] + std_eps * eps_z[x] + G[0] = a * I[1] ^ 3 + b * I[1] + g[0] + g[0] = ρ * g[-1] + σ * ϵ[x] +end + + +@parameters m verbose = true begin + σ = .0001 + ρ = .1 + a = 1 + b = .5 + + alpha = .157 + + beta = .999 + + delta = .0226 + + Pibar = 1.0008 + + phi_pi = 1.5 + rhoz = .9 + std_eps = .0068 + rho_z_delta = .9 + std_z_delta = .005 +end + + + + +SS(m) + +get_solution(m) +get_eigenvalues(m) + + +get_solution(m, parameters = [:b => -.1, :a => 4]) + +get_eigenvalues(m) + + +plot_irf(m, algorithm = :first_order) + +plot_irf(m, algorithm = :second_order) + +plot_irf(m, algorithm = :third_order) + + + + +@model larger_more_forward_looking_stochastic begin + 1 / C[0] = β / C[1] * (α * K[0]^(α - 1) + (1 - δ)) + K[0] = (1 - δ) * K[-1] + I[0] + I[0] + C[0] = K[-1]^α + G[1] + G[0] = a * I[0] ^ 3 + b * I[0] + g[0] + g[0] = ρ * g[-1] + σ * ϵ[x] +end + + +# irregular limit cycle +@parameters larger_more_forward_looking_stochastic begin + α = .25 + β = .95 + δ = .025 + σ = .0001 + ρ = .5 + a = -12 + b = -.5 +end + + +SS(larger_more_forward_looking_stochastic) + +get_solution(larger_more_forward_looking_stochastic) +get_eigenvalues(larger_more_forward_looking_stochastic) + + +get_solution(larger_more_forward_looking_stochastic, parameters = [:b => -10, :a => 40, :β => .96]) + + + +plot_irf(larger_more_forward_looking_stochastic, algorithm = :first_order) + +plot_irf(larger_more_forward_looking_stochastic, algorithm = :second_order) + +plot_irf(larger_more_forward_looking_stochastic, algorithm = :third_order) + +plot_irf(larger_forward_looking_stochastic, algorithm = :third_order, periods = 100) +plot_irf(larger_forward_looking_stochastic, algorithm = :third_order, periods = 1000) +plot_irf(larger_forward_looking_stochastic, algorithm = :third_order, periods = 10000) + + + +𝓂 = reduced_form#cycle_prototype +verbose = true +parameters = 𝓂.parameter_values +T = 𝓂.timings + +SS_and_pars, (solution_error, iters) = 𝓂.SS_solve_func(parameters, 𝓂, verbose, false, 𝓂.solver_parameters) + +∇₁ = calculate_jacobian(parameters, SS_and_pars, 𝓂) |> Matrix + + +∇₊ = @view ∇₁[:,1:T.nFuture_not_past_and_mixed] +∇₀ = @view ∇₁[:,T.nFuture_not_past_and_mixed .+ range(1, T.nVars)] +∇₋ = @view ∇₁[:,T.nFuture_not_past_and_mixed + T.nVars .+ range(1, T.nPast_not_future_and_mixed)] + + +Q = ℒ.qr(collect(∇₀[:,T.present_only_idx])) +Qinv = Q.Q' + +A₊ = Qinv * ∇₊ +A₀ = Qinv * ∇₀ +A₋ = Qinv * ∇₋ + +dynIndex = T.nPresent_only+1:T.nVars + +Ã₊ = @view A₊[dynIndex,:] +Ã₋ = @view A₋[dynIndex,:] +Ã₀₊ = @view A₀[dynIndex, T.future_not_past_and_mixed_idx] +Ã₀₋ = @views A₀[dynIndex, T.past_not_future_idx] * ℒ.diagm(ones(T.nPast_not_future_and_mixed))[T.not_mixed_in_past_idx,:] + +Z₊ = zeros(T.nMixed,T.nFuture_not_past_and_mixed) +I₊ = @view ℒ.diagm(ones(T.nFuture_not_past_and_mixed))[T.mixed_in_future_idx,:] + +Z₋ = zeros(T.nMixed,T.nPast_not_future_and_mixed) +I₋ = @view ℒ.diagm(ones(T.nPast_not_future_and_mixed))[T.mixed_in_past_idx,:] + +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) + + + + +# check eigenvals +eigenvalues = schdcmp.β ./ schdcmp.α + +# inside unit circle +eigenvalue_inside_unit_circle = abs.(eigenvalues) .< 1 + +# real and > 1 +eigenvalue_real_greater_one = isapprox.(imag.(eigenvalues), 0) .&& real.(eigenvalues) .> 1 + +# infinite +eigenvalue_infinite = abs.(eigenvalues) .> 1e10 + +eigenvalue_never_include = eigenvalue_infinite .|| eigenvalue_real_greater_one + +ny = 𝓂.timings.nPast_not_future_and_mixed + +other_eigenvalues = .!(eigenvalue_inside_unit_circle .|| eigenvalue_never_include) + +remaining_eigenvalues = ny - sum(eigenvalue_inside_unit_circle) + + + + + +unique_other_eigenvalues = unique(Float32.([real.(eigenvalues[other_eigenvalues]) abs.(imag.(eigenvalues[other_eigenvalues]))]), dims=1) + +number_of_unique_other_eigenvalues = size(unique_other_eigenvalues,1) + +eigenvalues + + +eigenselect = abs.(schdcmp.β ./ schdcmp.α) .< 1 +eigenselect = BitVector([1,0,1,0,0,0]) +ℒ.ordschur!(schdcmp, eigenselect) + + +# check eigenvals +eigenvalues = schdcmp.β ./ schdcmp.α + + + + + +eigenselect = abs.(schdcmp.β ./ schdcmp.α) .< 1 + +ℒ.ordschur!(schdcmp, BitVector([0,1])) +# reordering is irrelevant if there are no forward looking variables +Z₂₁ = @view schdcmp.Z[T.nPast_not_future_and_mixed+1:end, 1:T.nPast_not_future_and_mixed] +Z₁₁ = @view schdcmp.Z[1:T.nPast_not_future_and_mixed, 1:T.nPast_not_future_and_mixed] + +S₁₁ = @view schdcmp.S[1:T.nPast_not_future_and_mixed, 1:T.nPast_not_future_and_mixed] +T₁₁ = @view schdcmp.T[1:T.nPast_not_future_and_mixed, 1:T.nPast_not_future_and_mixed] + + +Ẑ₁₁ = RF.lu(Z₁₁, check = false) + +if !ℒ.issuccess(Ẑ₁₁) + return zeros(T.nVars,T.nPast_not_future_and_mixed), false +end + +Ŝ₁₁ = RF.lu(S₁₁, check = false) + +if !ℒ.issuccess(Ŝ₁₁) +return zeros(T.nVars,T.nPast_not_future_and_mixed), false +end + +D = Z₂₁ / Ẑ₁₁ +L = Z₁₁ * (Ŝ₁₁ \ T₁₁) / Ẑ₁₁ + +sol = @views vcat(L[T.not_mixed_in_past_idx,:], D) + +Ā₀ᵤ = @view A₀[1:T.nPresent_only, T.present_only_idx] +A₊ᵤ = @view A₊[1:T.nPresent_only,:] +Ã₀ᵤ = @view A₀[1:T.nPresent_only, T.present_but_not_only_idx] +A₋ᵤ = @view A₋[1:T.nPresent_only,:] + +Ā̂₀ᵤ = RF.lu(Ā₀ᵤ, check = false) + +if !ℒ.issuccess(Ā̂₀ᵤ) +Ā̂₀ᵤ = ℒ.svd(collect(Ā₀ᵤ)) +end + +A = @views vcat(-(Ā̂₀ᵤ \ (A₊ᵤ * D * L + Ã₀ᵤ * sol[T.dynamic_order,:] + A₋ᵤ)), sol) + +A = @view(A[T.reorder,:]) + + +Jm = @view(ℒ.diagm(ones(T.nVars))[T.past_not_future_and_mixed_idx,:]) + +∇₊ = @views ∇₁[:,1:T.nFuture_not_past_and_mixed] * ℒ.diagm(ones(T.nVars))[T.future_not_past_and_mixed_idx,:] +∇₀ = @view ∇₁[:,T.nFuture_not_past_and_mixed .+ range(1,T.nVars)] +∇ₑ = @view ∇₁[:,(T.nFuture_not_past_and_mixed + T.nVars + T.nPast_not_future_and_mixed + 1):end] + +B = -((∇₊ * A * Jm + ∇₀) \ ∇ₑ) + +𝐒₁ = hcat(A, B) +𝓂.solution.perturbation.first_order.solution_matrix +∇₂ = calculate_hessian(parameters, SS_and_pars, 𝓂) + +𝐒₂, solved2 = calculate_second_order_solution(∇₁, ∇₂, 𝐒₁, 𝓂.solution.perturbation.second_order_auxilliary_matrices; T = 𝓂.timings, tol = eps()) + +∇₃ = calculate_third_order_derivatives(parameters, SS_and_pars, 𝓂) + +𝐒₃, solved3 = calculate_third_order_solution(∇₁, ∇₂, ∇₃, 𝐒₁, 𝐒₂, 𝓂.solution.perturbation.second_order_auxilliary_matrices, 𝓂.solution.perturbation.third_order_auxilliary_matrices; T = 𝓂.timings, tol = eps()) + + +𝐒₁ = [𝐒₁[:,1:𝓂.timings.nPast_not_future_and_mixed] zeros(𝓂.timings.nVars) 𝐒₁[:,𝓂.timings.nPast_not_future_and_mixed+1:end]] + + +state = ones(𝓂.timings.nVars) * 1e-6 +shock = zeros(𝓂.timings.nExo) +# state[2] = -state[2] * 2.5 +aug_state = [state[𝓂.timings.past_not_future_and_mixed_idx] +1 +shock] + +sss = 𝐒₁ * aug_state + 𝐒₂ * ℒ.kron(aug_state, aug_state) / 2 + 𝐒₃ * ℒ.kron(ℒ.kron(aug_state,aug_state),aug_state) / 6 + +n_sims = 10000 + +aug_states = zeros(length(aug_state), n_sims) + +for i in 1:n_sims + aug_state = [sss[𝓂.timings.past_not_future_and_mixed_idx] + 1 + shock] + aug_states[:,i] = aug_state + sss = 𝐒₁ * aug_state + 𝐒₂ * ℒ.kron(aug_state, aug_state) / 2 + 𝐒₃ * ℒ.kron(ℒ.kron(aug_state,aug_state),aug_state) / 6 +end + +aug_states' + + + + + +using StatsPlots + +StatsPlots.plot(aug_states[1:2,500:550]') +StatsPlots.plot(aug_states[1:2,1000:1100]') + +StatsPlots.plot(aug_states[1:2,:]') + + + + +StatsPlots.plot(randn(10000)) + + +using StatsBase + +mean(aug_states[1:2,:], dims = 2) +Statistics.std(aug_states[1:2,:], dims = 2) +StatsBase.skewness(aug_states[1,:]) +StatsBase.skewness(aug_states[2,:]) + + + + + @model cycle_prototype begin μ[0] * λ[0] = Q[0] * e[1]^φₑ * λ[1] + # μ[-1] * λ[-1] = Q[-1] * e[0]^φₑ * λ[0] Q[0] = (1 + (1 - e[0]) * ϕ * Φ[0]) @@ -12,32 +547,40 @@ import RecursiveFactorization as RF λ[0] = (Y[1] + (1 - δ - γ) / (1 - δ) * X[0] - (1 - δ - ψ) / (1 - δ) * γ * Y[0])^(-ω) - X[1] = (1 - δ) * X[0] + ψ * Y[1] + # X[1] = (1 - δ) * X[0] + ψ * Y[1] + X[0] = (1 - δ) * X[-1] + ψ * Y[0] # Y[1] = z[0] * e[0]^α Y[1] = e[0]^α + # Y[0] = e[-1]^α log(μ[0]) = ρμ * log(μ[-1]) + σμ * ϵμ[x] + # log(μ[1]) = ρμ * log(μ[0]) + σμ * ϵμ[x] # log(z[0]) = ρz * log(z[-1]) + σz * ϵz[x] end -@parameters cycle_prototype symbolic = true verbose = true begin + +@parameters cycle_prototype symbolic = false verbose = true begin δ = 0.05 α = 0.67 - ē = 0.943 - # e[ss] = 0.943 | ē - e[ss] = 0.943 | Φ̄ - # Φ[ss] = 0.047 | Φ̄ - ω = 0.2736 - γ = 0.6259 - ψ = 0.3905 - φₑ = 0.046 - ϕ = 0.9108 - # Φ̄ = 0.047 - Φ̄² = 1.710280496#0.0018 - Φ̄³ = 186.8311838#0.00066 + ē = 0.942955411540974 + # e[ss] = 0.942955411540974 | ē + e[ss] = ē | Φ̄ + # Φ[ss] = 0.0469853516451966 | Φ̄ + ω = 0.273610828663897 + γ = 0.625910502827912 + ψ = 0.390475455756289 + φₑ = 0.0460159463504044 + ϕ = 0.910774708002035 + + # Φ̄ = 0.0469853516451966 + + Φ̄² = 1.71028049606731#0.0018 + Φ̄³ = 186.831183827810#0.00066 + # Φ̄² = 0.0018 + # Φ̄³ = 0.00066 # Φ̄² = 0.0018 # Φ̄³ = 0.00066 @@ -48,8 +591,90 @@ end # ρz = 0.6254 # σz = 0.0027 - ρμ = 0.0671 - σμ = 0.00014 + ρμ = 0.0671239825332901 + σμ = 0.000135769197101003 + +end + + +SS(cycle_prototype) + +get_solution(cycle_prototype) +get_solution(cycle_prototype, algorithm = :linear_time_iteration) + +get_solution(cycle_prototype, algorithm = :third_order) + + + + + +state, converged = third_order_stochastic_steady_state_iterative_solution([sparsevec(𝐒₁); vec(𝐒₂); vec(𝐒₃)]; dims = [size(𝐒₁); size(𝐒₂); size(𝐒₃)], 𝓂 = 𝓂) + + +elements_per_cluster = zeros(Int, nC) +for j = 1:nC + nEC[j] = count(==(j), CtoE) +end + + + + +using StatsPlots +plot_irf(cycle_prototype) +plot_irf(cycle_prototype, algorithm = :linear_time_iteration) +plot_irf(cycle_prototype, algorithm = :third_order) + + +@model cycle_prototype begin + μ[0] * λ[0] = Q[0] * e[1]^φₑ * λ[1] + + Q[0] = (1 + (1 - e[0]) * ϕ * Φ[0]) + + # Φ[0] = Φ̄ * exp(Φ̄² * (100 * (e[0] - e[ss]))^2 + Φ̄³ * (100 * (e[0] - e[ss]))^3) + Φ[0] = Φ̄ * exp(Φ̄² * (100 * (e[0] - ē))^2 + Φ̄³ * (100 * (e[0] - ē))^3) + + λ[0] = (Y[1] + (1 - δ - γ) / (1 - δ) * X[0] - (1 - δ - ψ) / (1 - δ) * γ * Y[0])^(-ω) + + # X[1] = (1 - δ) * X[0] + ψ * Y[1] + X[0] = (1 - δ) * X[-1] + ψ * Y[0] + + # Y[1] = z[0] * e[0]^α + # Y[1] = e[0]^α + Y[0] = e[-1]^α + + log(μ[0]) = ρμ * log(μ[-1]) + σμ * ϵμ[x] + + # log(z[0]) = ρz * log(z[-1]) + σz * ϵz[x] +end + + +@parameters cycle_prototype symbolic = false verbose = true begin + δ = 0.05 + α = 0.67 + ē = 0.942955411540974 + # e[ss] = 0.942955411540974 | ē + e[ss] = ē | Φ̄ + # Φ[ss] = 0.0469853516451966 | Φ̄² #Φ̄ + ω = 0.273610828663897 + γ = 0.625910502827912 + ψ = 0.390475455756289 + φₑ = 0.0460159463504044 + ϕ = 0.910774708002035 + # Φ̄ = 0.0469853516451966 + Φ̄² = 1.71028049606731#0.0018 + Φ̄³ = 186.831183827810#0.00066 + + # Φ̄² = 0.0018 + # Φ̄³ = 0.00066 + + ρz = 0#0.6254 + σz = 0#0.0027 + + # ρz = 0.6254 + # σz = 0.0027 + + ρμ = 0.0671239825332901 + σμ = 0.000135769197101003 # .7 < e < 1 # Φ < 1 @@ -57,25 +682,98 @@ end # X > 7.5 # Q < .8 # 1 > Φ > 0 - # 1 > ē > 0.6 + # .943 > ē > 0.942 # X > 7.0 # Y > 0.7 # Q > 0.7 # λ > 0.7 # e > 0.7 + # Φ̄ > 0.04 end -# ψ = 0.3905 -# ē = 0.943 -# α = 0.67 -# δ = 0.05 -# ψ * ē ^ α / δ +SS(cycle_prototype) -SS(cycle_prototype) -# SS(cycle_prototype, parameters = :Φ̄² => .92) -# include("../models/RBC_baseline.jl") +# al = in1(2,:); +# del = in1(1,:); +# e_ = in1(3,:); +# gam = in1(5,:); +# om = in1(4,:); +# phie = in1(7,:); +# psi = in1(6,:); +# t2 = e_.^al; +# t3 = 1.0./del; +# t4 = gam-1.0; +# t5 = -om; +# t6 = psi.*t2.*t3; +# t7 = t2+t6; +# t8 = t4.*t7; +# t9 = -t8; +# t10 = t9.^t5; + +# argSS = [psi*e_^al*1.0./del; +# e_^al; +# (-(gam-1.0)*(e_^al+psi*e_^al./del))^(-om); +# e_^phie*(-(gam-1.0)*(e_^al+psi*e_^al./del))^(-om); +# (-(gam-1.0)*(e_^al+psi*e_^al./del))]; + +# Y = e_^al +# X = psi*Y/del + +# argSS = [psi*Y/del; +# Y; +# (-(gam-1.0)*(Y+X))^(-om); +# e_^phie*(-(gam-1.0)*(Y+X))^(-om); +# (-(gam-1.0)*(Y+X))]; + + +# 0.942955411540974^0.0460159463504044 * ((1-.625910502827912) * 7.50815) ^(-.273610828663897) + + +# del = 0.0500000000000000 +# al = 0.670000000000000 +# e_ = 0.942955411540974 +# om = 0.273610828663897 +# gam = 0.625910502827912 +# psi = 0.390475455756289 +# phie = 0.0460159463504044 +# phi0 = 0.910774708002035 +# Phi0 = 0.0469853516451966 +# Phi2 = 1.71028049606731 +# Phi3 = 186.831183827810 +# rhoz = 0 +# sigz = 0 +# rhomu = 0.0671239825332901 +# sigmu = 0.000135769197101003 + + + +# argSS = [psi*e_^al*1.0./del; +# e_^al; +# (-(gam-1.0)*(e_^al+psi*e_^al./del))^(-om); +# e_^phie*(-(gam-1.0)*(e_^al+psi*e_^al./del))^(-om); +# (-(gam-1.0)*(e_^al+psi*e_^al./del))]; + + + +# SS +# 7.50814776972948 # :X +# 0.961410974626739 # :Y +# 0.729400010068976 # :λ +# 0.727431245459093 +# 3.16837297194568 + +# # ψ = 0.3905 +# # ē = 0.943 +# # α = 0.67 +# # δ = 0.05 + +# # ψ * ē ^ α / δ + + +# # SS(cycle_prototype, parameters = :Φ̄² => .92) +# # include("../models/RBC_baseline.jl") get_solution(cycle_prototype) @@ -122,22 +820,22 @@ schdcmp = ℒ.schur(D,E) ############## -expand = @views [ℒ.diagm(ones(T.nVars))[T.future_not_past_and_mixed_idx,:], -ℒ.diagm(ones(T.nVars))[T.past_not_future_and_mixed_idx,:]] +# expand = @views [ℒ.diagm(ones(T.nVars))[T.future_not_past_and_mixed_idx,:], +# ℒ.diagm(ones(T.nVars))[T.past_not_future_and_mixed_idx,:]] -∇₊ = @views ∇₁[:,1:T.nFuture_not_past_and_mixed] * expand[1] -∇₀ = @views ∇₁[:,T.nFuture_not_past_and_mixed .+ range(1,T.nVars)] -∇₋ = @views ∇₁[:,T.nFuture_not_past_and_mixed + T.nVars .+ range(1,T.nPast_not_future_and_mixed)] * expand[2] -∇ₑ = @views ∇₁[:,(T.nFuture_not_past_and_mixed + T.nVars + T.nPast_not_future_and_mixed + 1):end] +# ∇₊ = @views ∇₁[:,1:T.nFuture_not_past_and_mixed] * expand[1] +# ∇₀ = @views ∇₁[:,T.nFuture_not_past_and_mixed .+ range(1,T.nVars)] +# ∇₋ = @views ∇₁[:,T.nFuture_not_past_and_mixed + T.nVars .+ range(1,T.nPast_not_future_and_mixed)] * expand[2] +# ∇ₑ = @views ∇₁[:,(T.nFuture_not_past_and_mixed + T.nVars + T.nPast_not_future_and_mixed + 1):end] -A = [∇₊ zero(∇₊) - zero(∇₊) ℒ.diagm(fill(1,size(∇₊,1)))] +# A = [∇₊ zero(∇₊) +# zero(∇₊) ℒ.diagm(fill(1,size(∇₊,1)))] -B = [∇₀ ∇₋ - ℒ.diagm(fill(1,size(∇₊,1))) zero(∇₊) ] +# B = [∇₀ ∇₋ +# ℒ.diagm(fill(1,size(∇₊,1))) zero(∇₊) ] -schdcmp = ℒ.schur(A,B) +# schdcmp = ℒ.schur(A,B) eigenselect = abs.(schdcmp.β ./ schdcmp.α) .< 1 ℒ.ordschur!(schdcmp, eigenselect) @@ -167,7 +865,7 @@ ny - sum(eigenvalue_inside_unit_circle) -ℒ.ordschur!(schdcmp, .!eigenvalue_infinite) +ℒ.ordschur!(schdcmp, BitVector([1,0,0,0,1,0])) # check eigenvals eigenvalues = schdcmp.β ./ schdcmp.α From 749effe7a68cbc45eef0aa3630392a184523144b Mon Sep 17 00:00:00 2001 From: thorek1 Date: Wed, 29 Nov 2023 11:49:20 +0100 Subject: [PATCH 05/34] update todos --- docs/src/unfinished_docs/todo.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/src/unfinished_docs/todo.md b/docs/src/unfinished_docs/todo.md index b099fde8..8d69ab03 100644 --- a/docs/src/unfinished_docs/todo.md +++ b/docs/src/unfinished_docs/todo.md @@ -176,6 +176,7 @@ ## Not high priority - [ ] estimation codes with missing values (adopt kalman filter) +- [ ] add better error messages from dynare parser and dont have him change the folder even if he fails (catch the case and change the folder back) - [ ] whats a good error measure for higher order solutions (taking whole dist of future shock into account)? use mean error for n number of future shocks - [ ] improve redundant calculations of SS and other parts of solution - [ ] restructure functions and containers so that compiler knows what types to expect From 9e04d84597d06295d021faaa58b47e7dd247b770 Mon Sep 17 00:00:00 2001 From: thorek1 Date: Mon, 4 Dec 2023 00:01:01 +0100 Subject: [PATCH 06/34] add cycles notebook --- cycles.jl | 2755 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2755 insertions(+) create mode 100644 cycles.jl diff --git a/cycles.jl b/cycles.jl new file mode 100644 index 00000000..b8548583 --- /dev/null +++ b/cycles.jl @@ -0,0 +1,2755 @@ +### A Pluto.jl notebook ### +# v0.19.32 + +using Markdown +using InteractiveUtils + +# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error). +macro bind(def, element) + quote + local iv = try Base.loaded_modules[Base.PkgId(Base.UUID("6e696c72-6542-2067-7265-42206c756150"), "AbstractPlutoDingetjes")].Bonds.initial_value catch; b -> missing; end + local el = $(esc(element)) + global $(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : iv(el) + el + end +end + +# ╔═╡ 1989ec7e-8d47-11ee-13a7-87c968f56766 +using MacroModelling + +# ╔═╡ d450c895-1433-4fcc-9905-1c18879e49ec +using PlutoUI + +# ╔═╡ 8fc6e932-6d22-46c3-8ad6-b26684c38fa1 +show_pluto(x) = Text(sprint(show, "text/plain",x)); + +# ╔═╡ 97ff64bd-961f-43c3-b46d-f3b17e1aabd2 +import StatsPlots + +# ╔═╡ ea44d30c-2591-43b5-9cbf-ee301bb14020 +import LinearAlgebra as ℒ + +# ╔═╡ 1c646fb3-8f43-440f-834e-9c4e239bd5ad +md"# The simplest case: only backward looking" + +# ╔═╡ 2bdbbaf9-03dd-4492-abf4-ff7aca63e19e +@model reduced_form begin + K[0] = (1 - δ) * K[-1] + I[-1] + I[0] = α * K[-1] + G[0] + G[0] = a * I[-1] ^ 3 + b * I[-1] +end + +# ╔═╡ f5983385-9164-4509-bc44-ab3043d379cf +@parameters reduced_form begin + α = .15 + δ = .2 + a = 100 + b = -2 +end + +# ╔═╡ d61dd34b-7765-4cac-b610-4e7e1031a9e8 +md"This model has a reduced form nonlinear structure driving I and thereby K." + +# ╔═╡ 534226bf-cfef-4fd0-b40a-f9a3db201e64 +SS(reduced_form) |> show_pluto + +# ╔═╡ c365b37a-bef3-4a0d-96aa-3af2db6180ca +md"We approximate around a non-zero non stochastic steady state (NSSS)." + +# ╔═╡ dc224752-f3e2-489a-992d-101925299105 +get_solution(reduced_form) |> show_pluto + +# ╔═╡ 4199411e-38ef-4f8e-95ff-8d10cb0a909f +md"The autoregressive coefficient on investment is larger than 1 for the first order solution." + +# ╔═╡ 92c019c2-8540-431c-9972-93a6be2fdd38 +get_solution(reduced_form, algorithm = :second_order) |> show_pluto + +# ╔═╡ 42a61485-e3ba-4a37-8c50-18381c2dbd95 +md"The second order terms are negative due to the non-zero NSSS." + +# ╔═╡ c2f25861-5fff-47d1-bf4b-5671d61c0f45 +get_solution(reduced_form, algorithm = :third_order) |> show_pluto + +# ╔═╡ 1508faa7-3e2e-4f3a-90e1-6616b1544610 +md"## Plotting" + +# ╔═╡ ac41c574-c53e-4127-918b-5be4040cc601 +md"The paths for the first order solution are explosive. We should see this in the eigenvalues of the Schur (QZ) decomposition:" + +# ╔═╡ 383372a0-dc81-4343-bff8-74fe688e96e1 +@bind a Slider(0:10:1000, default = 100) + +# ╔═╡ 180918d3-ebc8-4200-8a21-a9b926797368 +a + +# ╔═╡ d51f5759-ee26-4d1a-a455-6f2f523e7f1b +function get_eigenvalues(𝓂) + verbose = false + parameters = 𝓂.parameter_values + T = 𝓂.timings + + SS_and_pars, (solution_error, iters) = 𝓂.SS_solve_func(parameters, 𝓂, verbose, false, 𝓂.solver_parameters) + + ∇₁ = calculate_jacobian(parameters, SS_and_pars, 𝓂) |> Matrix + + + ∇₊ = @view ∇₁[:,1:T.nFuture_not_past_and_mixed] + ∇₀ = @view ∇₁[:,T.nFuture_not_past_and_mixed .+ range(1, T.nVars)] + ∇₋ = @view ∇₁[:,T.nFuture_not_past_and_mixed + T.nVars .+ range(1, T.nPast_not_future_and_mixed)] + + + Q = ℒ.qr(collect(∇₀[:,T.present_only_idx])) + Qinv = Q.Q' + + A₊ = Qinv * ∇₊ + A₀ = Qinv * ∇₀ + A₋ = Qinv * ∇₋ + + dynIndex = T.nPresent_only+1:T.nVars + + Ã₊ = @view A₊[dynIndex,:] + Ã₋ = @view A₋[dynIndex,:] + Ã₀₊ = @view A₀[dynIndex, T.future_not_past_and_mixed_idx] + Ã₀₋ = @views A₀[dynIndex, T.past_not_future_idx] * ℒ.diagm(ones(T.nPast_not_future_and_mixed))[T.not_mixed_in_past_idx,:] + + Z₊ = zeros(T.nMixed,T.nFuture_not_past_and_mixed) + I₊ = @view ℒ.diagm(ones(T.nFuture_not_past_and_mixed))[T.mixed_in_future_idx,:] + + Z₋ = zeros(T.nMixed,T.nPast_not_future_and_mixed) + I₋ = @view ℒ.diagm(ones(T.nPast_not_future_and_mixed))[T.mixed_in_past_idx,:] + + D = vcat(hcat(Ã₀₋, Ã₊), hcat(I₋, Z₊)) + E = vcat(hcat(-Ã₋,-Ã₀₊), hcat(Z₋, I₊)) + + schdcmp = ℒ.schur(D,E) + + eigenvalues = schdcmp.β ./ schdcmp.α +end + +# ╔═╡ ad88b4bf-c614-4e0e-a6b2-dc485a7fe3b1 +get_eigenvalues(reduced_form) + +# ╔═╡ 5c17241c-0a5e-44ab-a71b-b77d0ad63e11 +md"There is one real eigenvalue > 1 and one within the unit circle. Note that this model has no forward looking (jump) variables. Therefore it does not satisfy the Blanchard-Kahn conditions. According to Galizia (2022) it might exhibit limit cycles using third or higher order perturbation." + +# ╔═╡ 7259ca28-58b7-4447-8e33-1a1d1bcecafd +md"For second order the paths are still explosive." + +# ╔═╡ 47901235-dc5d-45a2-908a-b1c00648727c +@bind b Slider(-2.25:.01:1, default = -2) + +# ╔═╡ 1a4c7a8a-2f33-4958-a719-439848fbfdfe +plot_irf(reduced_form, initial_state = fill(1e-4, 3), periods = 100, parameters = [:a => a, :b => b])[1] + +# ╔═╡ d3db2e0a-bea3-4314-82a7-9267aabed3de +plot_irf(reduced_form, initial_state = fill(1e-4, 3), periods = 100, algorithm = :second_order, parameters = [:a => a, :b => b])[1] + +# ╔═╡ f13e7256-b624-41ee-bf4d-aa912875c949 +b + +# ╔═╡ c0f45cf7-0a8e-42e8-8050-41861da51baf +plot_irf(reduced_form, initial_state = fill(1e-4, 3), periods = 100, algorithm = :third_order, parameters = [:a => a, :b => b])[1] + +# ╔═╡ 7e802bf1-e543-4f57-83ab-ad7f0e6655dc +md"Indeed at third order we get (non-trivial) limit cycles. Does this hold as well if we have shocks? +# Stochastic limit cycles" + +# ╔═╡ f9bc2196-7075-4334-981d-cb0d197a3292 +@model reduced_form_stochastic begin + K[0] = (1 - δ) * K[-1] + I[-1] + I[0] = α * K[-1] + G[0] + G[0] = a * I[-1] ^ 3 + b * I[-1] + σ * ϵ[x] +end + +# ╔═╡ 5718c81a-0fa2-49d6-94c3-8e8227daad12 +@parameters reduced_form_stochastic begin + α = .15 + δ = .2 + σ = .0001 + a = 100 + b = -2 +end + +# ╔═╡ 45fdbb11-893a-4051-b8b0-257c45c16cdc +SS(reduced_form_stochastic) |> show_pluto + +# ╔═╡ 8dd7cfbd-cb54-4de3-a5b6-2b39960e55ef +plot_irf(reduced_form_stochastic, periods = 100)[1] + +# ╔═╡ 1477de09-4e50-4339-a624-7c4e84b42b53 +plot_irf(reduced_form_stochastic, periods = 1000, algorithm = :second_order)[1] + +# ╔═╡ 25ba4aab-5195-4e74-be10-b498194498d1 +plot_irf(reduced_form_stochastic, periods = 100, algorithm = :third_order)[1] + +# ╔═╡ 290651f9-2315-4a3d-aa92-a115bea6b25a +plot_irf(reduced_form_stochastic, periods = 1000, algorithm = :third_order)[1] + +# ╔═╡ 78402155-bcbd-47b3-9dc3-47a8a4f494ff +md"With the shock size being small we get the same dynamics." + +# ╔═╡ 9422fe5b-8912-418f-941f-3fb8c51e62c0 +plot_irf(reduced_form_stochastic, algorithm = :third_order, periods = 100, negative_shock = true)[1] + +# ╔═╡ 1ff50a53-9a6e-4dc6-9979-3d8b859e3152 +md"Yet there is definitely a basin of attraction and if you go to far away you might not enter the limit cycle as is the case with a negative shock." + +# ╔═╡ 74b8daa2-b731-4217-ba9f-84b3f95e0693 +md"Does this also work with pruning?" + +# ╔═╡ 6df7f697-a6dc-45ac-aa6a-b453572bda8d +plot_irf(reduced_form_stochastic, algorithm = :pruned_third_order, periods = 100)[1] + +# ╔═╡ 1c84bf1d-01ee-4653-841e-df8a7ad67615 +md"No because there is no dynamic feedback counteracting the explosive first order dynamics." + +# ╔═╡ c867d3bc-cef7-478c-815b-d8877c3ab49a +md"# Forward looking stochastic limit cycles. +So far we focused on backward looking models but the interesting part is forward looking economic models. That is where the matching of unstable eigenvalues with forward looking variables should matter as well." + +# ╔═╡ afbf827a-01ae-4c46-86d9-5f75abf97bde +@model reduced_form_forward_looking_stochastic begin + K[0] = (1 - δ) * K[-1] + I[0] + I[0] = α * K[-1] + G[0] + G[0] = a * I[1] ^ 3 + b * I[1] + σ * ϵ[x] +end + +# ╔═╡ 2e16b9fd-67ca-4b0e-912f-e0e296b5b0b0 +@parameters reduced_form_forward_looking_stochastic begin + α = .15 + δ = .2 + σ = .0001 + a = 100 + b = -2 + # G < -.01 +end + +# ╔═╡ 38a6a4c3-2c22-4326-9fd7-0f9bdb5962f0 +md"Here we shifted the timing of investment in the first and last equation. Note that investment appears in expectations now." + +# ╔═╡ 0b941d86-bc37-49b2-95d5-7cad0b8d7902 +SS(reduced_form_forward_looking_stochastic) |> show_pluto + +# ╔═╡ e14b5d73-69d5-47dc-a540-5daef9e00211 +get_eigenvalues(reduced_form_forward_looking_stochastic) + +# ╔═╡ 7db069fb-d14a-4293-a761-f876f5eb33c2 +md"Note that the eigenvalues of the QZ are very different in the forward looking model. We choose another parameterisation in order to have at least one unstable eigenvalue:" + +# ╔═╡ da83e580-15c2-43dd-962e-6269cbc36796 +@model reduced_form_forward_looking_stoch begin + K[0] = (1 - δ) * K[-1] + I[0] + I[0] = α * K[-1] + G[0] + G[0] = a * I[1] ^ 3 + b * I[1] + σ * ϵ[x] +end + +# ╔═╡ b77e6ae0-ace5-4a3c-b4a2-8d2f3bff7a04 +@parameters reduced_form_forward_looking_stoch begin + α = .15 + δ = .02 + σ = .0001 + a = 10 + b = .5 +end + +# ╔═╡ 12ce5865-1e12-45be-84bb-7fe016f17397 +SS(reduced_form_forward_looking_stoch) |> show_pluto + +# ╔═╡ 73362a28-37ad-43fb-a257-348fa29fba77 +md"Now we do the Taylor approximation around the zero NSSS." + +# ╔═╡ 0df34990-2cbb-421d-b28b-9de3c6b7289c +get_eigenvalues(reduced_form_forward_looking_stoch) + +# ╔═╡ 9fceddc8-c0ab-475c-a6db-f75ab935788e +md"And we get two unstable eigenvalues in this case. Even though we only have one forward looking variable. As before we have one unstable eigenvalue too much." + +# ╔═╡ 67002428-4110-4d2c-9c7a-a9d7380ab810 +get_solution(reduced_form_forward_looking_stoch) |> show_pluto + +# ╔═╡ 0ea8167b-0bec-4a1a-8d57-ebea2f84d154 +plot_irf(reduced_form_forward_looking_stoch)[1] + +# ╔═╡ 0dac68c2-878f-4cc4-a1dc-567c1cbb097c +@bind aa Slider(0:10:1000, default = 10) + +# ╔═╡ 9ab2da58-7e9c-4bcd-91ed-248fb13a3f04 +@bind bb Slider(0:.01:2, default = .5) + +# ╔═╡ 2d1ba40e-29ca-4383-898a-24c58d0b9507 +plot_irf(reduced_form_forward_looking_stoch, algorithm = :third_order, parameters = [:a => aa, :b => bb], periods = 100)[1] + +# ╔═╡ ca75e3c5-f47e-409e-ad82-d17a89d15957 +bb + +# ╔═╡ 2b7f586f-c502-4aa0-891f-db44bba58f37 +md"This parametrisation exhibits limit cycles at third order" + +# ╔═╡ dd09252b-b25e-4bbe-993e-16f022bd1b7a +plot_irf(reduced_form_forward_looking_stoch, algorithm = :third_order, negative_shock = true, parameters = [:a => aa, :b => bb], periods = 100)[1] + +# ╔═╡ db7990ab-3c16-4ab4-8120-9cb8f5da0e63 +md"and it seems to be symmetric around the NSSS." + +# ╔═╡ 729dfccc-1d4e-467e-8674-20bef581dd8e +md"# Larger forward looking stochastic limit cycle model +Let's add another state variabel for the shock process." + +# ╔═╡ dcfde53e-0579-4cbe-ba57-90c67f73ac93 +@model larger_forward_looking_stochastic begin + K[0] = (1 - δ) * K[-1] + I[0] + I[0] = α * K[-1] + G[0] + G[0] = a * I[1] ^ 3 + b * I[1] + gg[0] + gg[0] = ρ * gg[-1] + σ * ϵ[x] +end + +# ╔═╡ bdc4a3bb-2873-4904-8211-82b4ef0af094 +@parameters larger_forward_looking_stochastic begin + α = .15 + δ = .02 + σ = .0001 + ρ = .1 + a = 10 + b = .5 +end + +# ╔═╡ 4cbce23f-32b5-4df3-a183-f296c8e693e1 +SS(larger_forward_looking_stochastic) |> show_pluto + +# ╔═╡ 7444738c-7afd-4162-8b6b-7a65e1d5daf2 +md"We approximate around the zero NSSS." + +# ╔═╡ 271b2da3-d268-4d7b-81a3-606af4bf4cbe +get_eigenvalues(larger_forward_looking_stochastic) + +# ╔═╡ 6874f079-be63-4f9a-bbc5-67ca2c41671b +md"We have two unstable eigenvalues as before and one stable eigenvalue." + +# ╔═╡ ada42dd0-a210-45a9-850b-46c721dd8ae6 +plot_irf(larger_forward_looking_stochastic, algorithm = :third_order)[1] + +# ╔═╡ 1497fafd-a303-4c0a-a90a-1b78838644f7 +md"It appears an extra state does not change the first order solution:" + +# ╔═╡ ec2f323a-6df4-4fdb-92e5-78beba0f7354 +get_solution(larger_forward_looking_stochastic) |> show_pluto + +# ╔═╡ 4596f77c-60bd-48cc-8732-ef6e58d951d9 +md"In fact it does change the solution as some of the impact is attributed to the new state variable instead of past values of K. + +Note that also in this case he will sort the stable eigenvalue first and the other two unstable eigenvalues are paired. + +The case not covered is multiple unique groups of unstable eigenvalues. + +First attempts seem difficult. Economics might guide us here." + +# ╔═╡ 00000000-0000-0000-0000-000000000001 +PLUTO_PROJECT_TOML_CONTENTS = """ +[deps] +LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +MacroModelling = "687ffad2-3618-405e-ac50-e0f7b9c75e44" +PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8" +StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd" + +[compat] +MacroModelling = "~0.1.31" +PlutoUI = "~0.7.54" +StatsPlots = "~0.15.6" +""" + +# ╔═╡ 00000000-0000-0000-0000-000000000002 +PLUTO_MANIFEST_TOML_CONTENTS = """ +# This file is machine-generated - editing it directly is not advised + +julia_version = "1.10.0-rc1" +manifest_format = "2.0" +project_hash = "49605b00dd0caa22991bb9b36f0e12186d86cde7" + +[[deps.ADTypes]] +git-tree-sha1 = "332e5d7baeff8497b923b730b994fa480601efc7" +uuid = "47edcb42-4c32-4615-8424-f2b9edc5f35b" +version = "0.2.5" + +[[deps.AMD]] +deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse_jll"] +git-tree-sha1 = "45a1272e3f809d36431e57ab22703c6896b8908f" +uuid = "14f7f29c-3bd6-536c-9a0b-7339e30b5a3e" +version = "0.5.3" + +[[deps.ANSIColoredPrinters]] +git-tree-sha1 = "574baf8110975760d391c710b6341da1afa48d8c" +uuid = "a4c015fc-c6ff-483c-b24f-f7ea428134e9" +version = "0.0.1" + +[[deps.AbstractAlgebra]] +deps = ["GroupsCore", "InteractiveUtils", "LinearAlgebra", "MacroTools", "Preferences", "Random", "RandomExtensions", "SparseArrays", "Test"] +git-tree-sha1 = "c3c29bf6363b3ac3e421dc8b2ba8e33bdacbd245" +uuid = "c3fe647b-3220-5bb0-a1ea-a7954cac585d" +version = "0.32.5" + +[[deps.AbstractDifferentiation]] +deps = ["ExprTools", "LinearAlgebra", "Requires"] +git-tree-sha1 = "6a5e61dc899ab116035c18ead4ec890269f3c478" +uuid = "c29ec348-61ec-40c8-8164-b8c60e9d9f3d" +version = "0.6.0" + + [deps.AbstractDifferentiation.extensions] + AbstractDifferentiationChainRulesCoreExt = "ChainRulesCore" + AbstractDifferentiationFiniteDifferencesExt = "FiniteDifferences" + AbstractDifferentiationForwardDiffExt = ["DiffResults", "ForwardDiff"] + AbstractDifferentiationReverseDiffExt = ["DiffResults", "ReverseDiff"] + AbstractDifferentiationTrackerExt = "Tracker" + AbstractDifferentiationZygoteExt = "Zygote" + + [deps.AbstractDifferentiation.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + DiffResults = "163ba53b-c6d8-5494-b064-1a9d43ac40c5" + FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000" + ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" + ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" + Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" + Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" + +[[deps.AbstractFFTs]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "d92ad398961a3ed262d8bf04a1a2b8340f915fef" +uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c" +version = "1.5.0" +weakdeps = ["ChainRulesCore", "Test"] + + [deps.AbstractFFTs.extensions] + AbstractFFTsChainRulesCoreExt = "ChainRulesCore" + AbstractFFTsTestExt = "Test" + +[[deps.AbstractPlutoDingetjes]] +deps = ["Pkg"] +git-tree-sha1 = "793501dcd3fa7ce8d375a2c878dca2296232686e" +uuid = "6e696c72-6542-2067-7265-42206c756150" +version = "1.2.2" + +[[deps.AbstractTrees]] +git-tree-sha1 = "faa260e4cb5aba097a73fab382dd4b5819d8ec8c" +uuid = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" +version = "0.4.4" + +[[deps.Accessors]] +deps = ["CompositionsBase", "ConstructionBase", "Dates", "InverseFunctions", "LinearAlgebra", "MacroTools", "Test"] +git-tree-sha1 = "a7055b939deae2455aa8a67491e034f735dd08d3" +uuid = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" +version = "0.1.33" + + [deps.Accessors.extensions] + AccessorsAxisKeysExt = "AxisKeys" + AccessorsIntervalSetsExt = "IntervalSets" + AccessorsStaticArraysExt = "StaticArrays" + AccessorsStructArraysExt = "StructArrays" + + [deps.Accessors.weakdeps] + AxisKeys = "94b1ba4f-4ee9-5380-92f1-94cde586c3c5" + IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953" + Requires = "ae029012-a4dd-5104-9daa-d747884805df" + StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" + StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a" + +[[deps.AccurateArithmetic]] +deps = ["LinearAlgebra", "Random", "VectorizationBase"] +git-tree-sha1 = "07af26e8d08c211ef85918f3e25d4c0990d20d70" +uuid = "22286c92-06ac-501d-9306-4abd417d9753" +version = "0.3.8" + +[[deps.Adapt]] +deps = ["LinearAlgebra", "Requires"] +git-tree-sha1 = "02f731463748db57cc2ebfbd9fbc9ce8280d3433" +uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" +version = "3.7.1" +weakdeps = ["StaticArrays"] + + [deps.Adapt.extensions] + AdaptStaticArraysExt = "StaticArrays" + +[[deps.ArgTools]] +uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" +version = "1.1.1" + +[[deps.Arpack]] +deps = ["Arpack_jll", "Libdl", "LinearAlgebra", "Logging"] +git-tree-sha1 = "9b9b347613394885fd1c8c7729bfc60528faa436" +uuid = "7d9fca2a-8960-54d3-9f78-7d1dccf2cb97" +version = "0.5.4" + +[[deps.Arpack_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "OpenBLAS_jll", "Pkg"] +git-tree-sha1 = "5ba6c757e8feccf03a1554dfaf3e26b3cfc7fd5e" +uuid = "68821587-b530-5797-8361-c406ea357684" +version = "3.5.1+1" + +[[deps.ArrayInterface]] +deps = ["Adapt", "LinearAlgebra", "Requires", "SparseArrays", "SuiteSparse"] +git-tree-sha1 = "247efbccf92448be332d154d6ca56b9fcdd93c31" +uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" +version = "7.6.1" + + [deps.ArrayInterface.extensions] + ArrayInterfaceBandedMatricesExt = "BandedMatrices" + ArrayInterfaceBlockBandedMatricesExt = "BlockBandedMatrices" + ArrayInterfaceCUDAExt = "CUDA" + ArrayInterfaceGPUArraysCoreExt = "GPUArraysCore" + ArrayInterfaceStaticArraysCoreExt = "StaticArraysCore" + ArrayInterfaceTrackerExt = "Tracker" + + [deps.ArrayInterface.weakdeps] + BandedMatrices = "aae01518-5342-5314-be14-df237901396f" + BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0" + CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" + GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527" + StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" + Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" + +[[deps.Artifacts]] +uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" + +[[deps.AxisAlgorithms]] +deps = ["LinearAlgebra", "Random", "SparseArrays", "WoodburyMatrices"] +git-tree-sha1 = "66771c8d21c8ff5e3a93379480a2307ac36863f7" +uuid = "13072b0f-2c55-5437-9ae7-d433b7a33950" +version = "1.0.1" + +[[deps.AxisKeys]] +deps = ["AbstractFFTs", "ChainRulesCore", "CovarianceEstimation", "IntervalSets", "InvertedIndices", "LazyStack", "LinearAlgebra", "NamedDims", "OffsetArrays", "Statistics", "StatsBase", "Tables"] +git-tree-sha1 = "dba0fdaa3a95e591aa9cbe0df9aba41e295a2011" +uuid = "94b1ba4f-4ee9-5380-92f1-94cde586c3c5" +version = "0.2.13" + +[[deps.Base64]] +uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" + +[[deps.BenchmarkTools]] +deps = ["JSON", "Logging", "Printf", "Profile", "Statistics", "UUIDs"] +git-tree-sha1 = "d9a9701b899b30332bbcb3e1679c41cce81fb0e8" +uuid = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" +version = "1.3.2" + +[[deps.Bijections]] +git-tree-sha1 = "c9b163bd832e023571e86d0b90d9de92a9879088" +uuid = "e2ed5e7c-b2de-5872-ae92-c73ca462fb04" +version = "0.1.6" + +[[deps.BitFlags]] +git-tree-sha1 = "2dc09997850d68179b69dafb58ae806167a32b1b" +uuid = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35" +version = "0.1.8" + +[[deps.BitTwiddlingConvenienceFunctions]] +deps = ["Static"] +git-tree-sha1 = "0c5f81f47bbbcf4aea7b2959135713459170798b" +uuid = "62783981-4cbd-42fc-bca8-16325de8dc4b" +version = "0.1.5" + +[[deps.BlockTriangularForm]] +deps = ["SparseArrays"] +git-tree-sha1 = "64281233ecb50b39fc58d49b880a880203c31a96" +uuid = "adeb47b7-70bf-415a-bb24-c358563e873a" +version = "0.1.0" + +[[deps.Bzip2_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "19a35467a82e236ff51bc17a3a44b69ef35185a2" +uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0" +version = "1.0.8+0" + +[[deps.CPUSummary]] +deps = ["CpuId", "IfElse", "PrecompileTools", "Static"] +git-tree-sha1 = "601f7e7b3d36f18790e2caf83a882d88e9b71ff1" +uuid = "2a0fbf3d-bb9c-48f3-b0a9-814d99fd7ab9" +version = "0.2.4" + +[[deps.Cairo_jll]] +deps = ["Artifacts", "Bzip2_jll", "CompilerSupportLibraries_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "JLLWrappers", "LZO_jll", "Libdl", "Pixman_jll", "Pkg", "Xorg_libXext_jll", "Xorg_libXrender_jll", "Zlib_jll", "libpng_jll"] +git-tree-sha1 = "4b859a208b2397a7a623a03449e4636bdb17bcf2" +uuid = "83423d85-b0ee-5818-9007-b63ccbeb887a" +version = "1.16.1+1" + +[[deps.Calculus]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "f641eb0a4f00c343bbc32346e1217b86f3ce9dad" +uuid = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9" +version = "0.5.1" + +[[deps.ChainRulesCore]] +deps = ["Compat", "LinearAlgebra"] +git-tree-sha1 = "e0af648f0692ec1691b5d094b8724ba1346281cf" +uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" +version = "1.18.0" +weakdeps = ["SparseArrays"] + + [deps.ChainRulesCore.extensions] + ChainRulesCoreSparseArraysExt = "SparseArrays" + +[[deps.CloseOpenIntervals]] +deps = ["Static", "StaticArrayInterface"] +git-tree-sha1 = "70232f82ffaab9dc52585e0dd043b5e0c6b714f1" +uuid = "fb6a15b2-703c-40df-9091-08a04967cfa9" +version = "0.1.12" + +[[deps.Clustering]] +deps = ["Distances", "LinearAlgebra", "NearestNeighbors", "Printf", "Random", "SparseArrays", "Statistics", "StatsBase"] +git-tree-sha1 = "05f9816a77231b07e634ab8715ba50e5249d6f76" +uuid = "aaaa29a8-35af-508c-8bc3-b662a17a0fe5" +version = "0.15.5" + +[[deps.CodecBzip2]] +deps = ["Bzip2_jll", "Libdl", "TranscodingStreams"] +git-tree-sha1 = "c0ae2a86b162fb5d7acc65269b469ff5b8a73594" +uuid = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd" +version = "0.8.1" + +[[deps.CodecZlib]] +deps = ["TranscodingStreams", "Zlib_jll"] +git-tree-sha1 = "cd67fc487743b2f0fd4380d4cbd3a24660d0eec8" +uuid = "944b1d66-785c-5afd-91f1-9de20f533193" +version = "0.7.3" + +[[deps.ColorSchemes]] +deps = ["ColorTypes", "ColorVectorSpace", "Colors", "FixedPointNumbers", "PrecompileTools", "Random"] +git-tree-sha1 = "67c1f244b991cad9b0aa4b7540fb758c2488b129" +uuid = "35d6a980-a343-548e-a6ea-1d62b119f2f4" +version = "3.24.0" + +[[deps.ColorTypes]] +deps = ["FixedPointNumbers", "Random"] +git-tree-sha1 = "eb7f0f8307f71fac7c606984ea5fb2817275d6e4" +uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f" +version = "0.11.4" + +[[deps.ColorVectorSpace]] +deps = ["ColorTypes", "FixedPointNumbers", "LinearAlgebra", "Requires", "Statistics", "TensorCore"] +git-tree-sha1 = "a1f44953f2382ebb937d60dafbe2deea4bd23249" +uuid = "c3611d14-8923-5661-9e6a-0046d554d3a4" +version = "0.10.0" +weakdeps = ["SpecialFunctions"] + + [deps.ColorVectorSpace.extensions] + SpecialFunctionsExt = "SpecialFunctions" + +[[deps.Colors]] +deps = ["ColorTypes", "FixedPointNumbers", "Reexport"] +git-tree-sha1 = "fc08e5930ee9a4e03f84bfb5211cb54e7769758a" +uuid = "5ae59095-9a9b-59fe-a467-6f913c188581" +version = "0.12.10" + +[[deps.Combinatorics]] +git-tree-sha1 = "08c8b6831dc00bfea825826be0bc8336fc369860" +uuid = "861a8166-3701-5b0c-9a16-15d98fcdc6aa" +version = "1.0.2" + +[[deps.CommonEq]] +git-tree-sha1 = "6b0f0354b8eb954cdba708fb262ef00ee7274468" +uuid = "3709ef60-1bee-4518-9f2f-acd86f176c50" +version = "0.2.1" + +[[deps.CommonSolve]] +git-tree-sha1 = "0eee5eb66b1cf62cd6ad1b460238e60e4b09400c" +uuid = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2" +version = "0.2.4" + +[[deps.CommonSubexpressions]] +deps = ["MacroTools", "Test"] +git-tree-sha1 = "7b8a93dba8af7e3b42fecabf646260105ac373f7" +uuid = "bbf7d656-a473-5ed7-a52c-81e309532950" +version = "0.3.0" + +[[deps.Compat]] +deps = ["UUIDs"] +git-tree-sha1 = "8a62af3e248a8c4bad6b32cbbe663ae02275e32c" +uuid = "34da2185-b29b-5c13-b0c7-acf172513d20" +version = "4.10.0" +weakdeps = ["Dates", "LinearAlgebra"] + + [deps.Compat.extensions] + CompatLinearAlgebraExt = "LinearAlgebra" + +[[deps.CompilerSupportLibraries_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" +version = "1.0.5+1" + +[[deps.CompositeTypes]] +git-tree-sha1 = "02d2316b7ffceff992f3096ae48c7829a8aa0638" +uuid = "b152e2b5-7a66-4b01-a709-34e65c35f657" +version = "0.1.3" + +[[deps.CompositionsBase]] +git-tree-sha1 = "802bb88cd69dfd1509f6670416bd4434015693ad" +uuid = "a33af91c-f02d-484b-be07-31d278c5ca2b" +version = "0.1.2" +weakdeps = ["InverseFunctions"] + + [deps.CompositionsBase.extensions] + CompositionsBaseInverseFunctionsExt = "InverseFunctions" + +[[deps.ConcreteStructs]] +git-tree-sha1 = "f749037478283d372048690eb3b5f92a79432b34" +uuid = "2569d6c7-a4a2-43d3-a901-331e8e4be471" +version = "0.2.3" + +[[deps.ConcurrentUtilities]] +deps = ["Serialization", "Sockets"] +git-tree-sha1 = "8cfa272e8bdedfa88b6aefbbca7c19f1befac519" +uuid = "f0e56b4a-5159-44fe-b623-3e5288b988bb" +version = "2.3.0" + +[[deps.CondaPkg]] +deps = ["JSON3", "Markdown", "MicroMamba", "Pidfile", "Pkg", "Preferences", "TOML"] +git-tree-sha1 = "e81c4263c7ef4eca4d645ef612814d72e9255b41" +uuid = "992eb4ea-22a4-4c89-a5bb-47a3300528ab" +version = "0.2.22" + +[[deps.ConstructionBase]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "c53fc348ca4d40d7b371e71fd52251839080cbc9" +uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9" +version = "1.5.4" +weakdeps = ["IntervalSets", "StaticArrays"] + + [deps.ConstructionBase.extensions] + ConstructionBaseIntervalSetsExt = "IntervalSets" + ConstructionBaseStaticArraysExt = "StaticArrays" + +[[deps.Contour]] +git-tree-sha1 = "d05d9e7b7aedff4e5b51a029dced05cfb6125781" +uuid = "d38c429a-6771-53c6-b99e-75d170b6e991" +version = "0.6.2" + +[[deps.CovarianceEstimation]] +deps = ["LinearAlgebra", "Statistics", "StatsBase"] +git-tree-sha1 = "6711ad240bb8861dda376bad332d3f89e2ac5f30" +uuid = "587fd27a-f159-11e8-2dae-1979310e6154" +version = "0.2.9" + +[[deps.Coverage]] +deps = ["CoverageTools", "HTTP", "JSON", "LibGit2", "MbedTLS"] +git-tree-sha1 = "4fb5effc927fddc76a213dc4b1871dc41b666686" +uuid = "a2441757-f6aa-5fb2-8edb-039e3f45d037" +version = "1.6.0" + +[[deps.CoverageTools]] +git-tree-sha1 = "cc5595feb314d3b226ed765a001a40ca451ad687" +uuid = "c36e975a-824b-4404-a568-ef97ca766997" +version = "1.3.0" + +[[deps.CpuId]] +deps = ["Markdown"] +git-tree-sha1 = "fcbb72b032692610bfbdb15018ac16a36cf2e406" +uuid = "adafc99b-e345-5852-983c-f28acb93d879" +version = "0.3.1" + +[[deps.DataAPI]] +git-tree-sha1 = "8da84edb865b0b5b0100c0666a9bc9a0b71c553c" +uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a" +version = "1.15.0" + +[[deps.DataStructures]] +deps = ["Compat", "InteractiveUtils", "OrderedCollections"] +git-tree-sha1 = "3dbd312d370723b6bb43ba9d02fc36abade4518d" +uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" +version = "0.18.15" + +[[deps.DataValueInterfaces]] +git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6" +uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464" +version = "1.0.0" + +[[deps.Dates]] +deps = ["Printf"] +uuid = "ade2ca70-3891-5945-98fb-dc099432e06a" + +[[deps.DelimitedFiles]] +deps = ["Mmap"] +git-tree-sha1 = "9e2f36d3c96a820c678f2f1f1782582fcf685bae" +uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab" +version = "1.9.1" + +[[deps.DiffResults]] +deps = ["StaticArraysCore"] +git-tree-sha1 = "782dd5f4561f5d267313f23853baaaa4c52ea621" +uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5" +version = "1.1.0" + +[[deps.DiffRules]] +deps = ["IrrationalConstants", "LogExpFunctions", "NaNMath", "Random", "SpecialFunctions"] +git-tree-sha1 = "23163d55f885173722d1e4cf0f6110cdbaf7e272" +uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" +version = "1.15.1" + +[[deps.Distances]] +deps = ["LinearAlgebra", "Statistics", "StatsAPI"] +git-tree-sha1 = "5225c965635d8c21168e32a12954675e7bea1151" +uuid = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7" +version = "0.10.10" +weakdeps = ["ChainRulesCore", "SparseArrays"] + + [deps.Distances.extensions] + DistancesChainRulesCoreExt = "ChainRulesCore" + DistancesSparseArraysExt = "SparseArrays" + +[[deps.Distributed]] +deps = ["Random", "Serialization", "Sockets"] +uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" + +[[deps.Distributions]] +deps = ["FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SpecialFunctions", "Statistics", "StatsAPI", "StatsBase", "StatsFuns"] +git-tree-sha1 = "a6c00f894f24460379cb7136633cef54ac9f6f4a" +uuid = "31c24e10-a181-5473-b8eb-7969acd0382f" +version = "0.25.103" + + [deps.Distributions.extensions] + DistributionsChainRulesCoreExt = "ChainRulesCore" + DistributionsDensityInterfaceExt = "DensityInterface" + DistributionsTestExt = "Test" + + [deps.Distributions.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + DensityInterface = "b429d917-457f-4dbc-8f4c-0cc954292b1d" + Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[[deps.DocStringExtensions]] +deps = ["LibGit2"] +git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" +uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" +version = "0.9.3" + +[[deps.Documenter]] +deps = ["ANSIColoredPrinters", "AbstractTrees", "Base64", "Dates", "DocStringExtensions", "Downloads", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "MarkdownAST", "Pkg", "PrecompileTools", "REPL", "RegistryInstances", "SHA", "Test", "Unicode"] +git-tree-sha1 = "662fb21ae7fad33e044c2b59ece832fdce32c171" +uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +version = "1.1.2" + +[[deps.DocumenterTools]] +deps = ["AbstractTrees", "Base64", "DocStringExtensions", "Documenter", "FileWatching", "Gumbo", "LibGit2", "OpenSSH_jll", "Sass"] +git-tree-sha1 = "37402c74604d89c94593bc74b3e1ca597494a804" +uuid = "35a29f4d-8980-5a13-9543-d66fff28ecb8" +version = "0.1.18" + +[[deps.DomainSets]] +deps = ["CompositeTypes", "IntervalSets", "LinearAlgebra", "Random", "StaticArrays", "Statistics"] +git-tree-sha1 = "51b4b84d33ec5e0955b55ff4b748b99ce2c3faa9" +uuid = "5b8099bc-c8ec-5219-889f-1d9e522a28bf" +version = "0.6.7" + +[[deps.Downloads]] +deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] +uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" +version = "1.6.0" + +[[deps.DualNumbers]] +deps = ["Calculus", "NaNMath", "SpecialFunctions"] +git-tree-sha1 = "5837a837389fccf076445fce071c8ddaea35a566" +uuid = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74" +version = "0.6.8" + +[[deps.DynamicPolynomials]] +deps = ["Future", "LinearAlgebra", "MultivariatePolynomials", "MutableArithmetics", "Pkg", "Reexport", "Test"] +git-tree-sha1 = "fea68c84ba262b121754539e6ea0546146515d4f" +uuid = "7c1d4256-1411-5781-91ec-d7bc3513ac07" +version = "0.5.3" + +[[deps.DynarePreprocessor_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "dc0e7282f378cf98ccad07ae209ccb3d36d235b6" +uuid = "23afba7c-24e5-5ee2-bc2c-b42e07f0492a" +version = "6.3.0+0" + +[[deps.EnumX]] +git-tree-sha1 = "bdb1942cd4c45e3c678fd11569d5cccd80976237" +uuid = "4e289a0a-7415-4d19-859d-a7e5c4648b56" +version = "1.0.4" + +[[deps.EpollShim_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "8e9441ee83492030ace98f9789a654a6d0b1f643" +uuid = "2702e6a9-849d-5ed8-8c21-79e8b8f9ee43" +version = "0.0.20230411+0" + +[[deps.ExceptionUnwrapping]] +deps = ["Test"] +git-tree-sha1 = "e90caa41f5a86296e014e148ee061bd6c3edec96" +uuid = "460bff9d-24e4-43bc-9d9f-a8973cb893f4" +version = "0.1.9" + +[[deps.Expat_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "4558ab818dcceaab612d1bb8c19cee87eda2b83c" +uuid = "2e619515-83b5-522b-bb60-26c02a35a201" +version = "2.5.0+0" + +[[deps.ExprTools]] +git-tree-sha1 = "27415f162e6028e81c72b82ef756bf321213b6ec" +uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04" +version = "0.1.10" + +[[deps.FFMPEG]] +deps = ["FFMPEG_jll"] +git-tree-sha1 = "b57e3acbe22f8484b4b5ff66a7499717fe1a9cc8" +uuid = "c87230d0-a227-11e9-1b43-d7ebe4e7570a" +version = "0.4.1" + +[[deps.FFMPEG_jll]] +deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "JLLWrappers", "LAME_jll", "Libdl", "Ogg_jll", "OpenSSL_jll", "Opus_jll", "PCRE2_jll", "Pkg", "Zlib_jll", "libaom_jll", "libass_jll", "libfdk_aac_jll", "libvorbis_jll", "x264_jll", "x265_jll"] +git-tree-sha1 = "74faea50c1d007c85837327f6775bea60b5492dd" +uuid = "b22a6f82-2f65-5046-a5b2-351ab43fb4e5" +version = "4.4.2+2" + +[[deps.FFTW]] +deps = ["AbstractFFTs", "FFTW_jll", "LinearAlgebra", "MKL_jll", "Preferences", "Reexport"] +git-tree-sha1 = "b4fbdd20c889804969571cc589900803edda16b7" +uuid = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341" +version = "1.7.1" + +[[deps.FFTW_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "c6033cc3892d0ef5bb9cd29b7f2f0331ea5184ea" +uuid = "f5851436-0d7a-5f13-b9de-f02708fd171a" +version = "3.3.10+0" + +[[deps.FastClosures]] +git-tree-sha1 = "acebe244d53ee1b461970f8910c235b259e772ef" +uuid = "9aa1b823-49e4-5ca5-8b0f-3971ec8bab6a" +version = "0.3.2" + +[[deps.FileWatching]] +uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" + +[[deps.FillArrays]] +deps = ["LinearAlgebra", "Random"] +git-tree-sha1 = "35f0c0f345bff2c6d636f95fdb136323b5a796ef" +uuid = "1a297f60-69ca-5386-bcde-b61e274b549b" +version = "1.7.0" +weakdeps = ["SparseArrays", "Statistics"] + + [deps.FillArrays.extensions] + FillArraysSparseArraysExt = "SparseArrays" + FillArraysStatisticsExt = "Statistics" + +[[deps.FixedPointNumbers]] +deps = ["Statistics"] +git-tree-sha1 = "335bfdceacc84c5cdf16aadc768aa5ddfc5383cc" +uuid = "53c48c17-4a7d-5ca2-90c5-79b7896eea93" +version = "0.8.4" + +[[deps.Fontconfig_jll]] +deps = ["Artifacts", "Bzip2_jll", "Expat_jll", "FreeType2_jll", "JLLWrappers", "Libdl", "Libuuid_jll", "Pkg", "Zlib_jll"] +git-tree-sha1 = "21efd19106a55620a188615da6d3d06cd7f6ee03" +uuid = "a3f928ae-7b40-5064-980b-68af3947d34b" +version = "2.13.93+0" + +[[deps.Formatting]] +deps = ["Printf"] +git-tree-sha1 = "8339d61043228fdd3eb658d86c926cb282ae72a8" +uuid = "59287772-0a20-5a39-b81b-1366585eb4c0" +version = "0.4.2" + +[[deps.ForwardDiff]] +deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "LinearAlgebra", "LogExpFunctions", "NaNMath", "Preferences", "Printf", "Random", "SpecialFunctions"] +git-tree-sha1 = "cf0fe81336da9fb90944683b8c41984b08793dad" +uuid = "f6369f11-7733-5829-9624-2563aa707210" +version = "0.10.36" +weakdeps = ["StaticArrays"] + + [deps.ForwardDiff.extensions] + ForwardDiffStaticArraysExt = "StaticArrays" + +[[deps.FreeType2_jll]] +deps = ["Artifacts", "Bzip2_jll", "JLLWrappers", "Libdl", "Zlib_jll"] +git-tree-sha1 = "d8db6a5a2fe1381c1ea4ef2cab7c69c2de7f9ea0" +uuid = "d7e528f0-a631-5988-bf34-fe36492bcfd7" +version = "2.13.1+0" + +[[deps.FriBidi_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "aa31987c2ba8704e23c6c8ba8a4f769d5d7e4f91" +uuid = "559328eb-81f9-559d-9380-de523a88c83c" +version = "1.0.10+0" + +[[deps.FunctionWrappers]] +git-tree-sha1 = "d62485945ce5ae9c0c48f124a84998d755bae00e" +uuid = "069b7b12-0de2-55c6-9aab-29f3d0a68a2e" +version = "1.1.3" + +[[deps.FunctionWrappersWrappers]] +deps = ["FunctionWrappers"] +git-tree-sha1 = "b104d487b34566608f8b4e1c39fb0b10aa279ff8" +uuid = "77dc65aa-8811-40c2-897b-53d922fa7daf" +version = "0.1.3" + +[[deps.Future]] +deps = ["Random"] +uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820" + +[[deps.GLFW_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libglvnd_jll", "Pkg", "Xorg_libXcursor_jll", "Xorg_libXi_jll", "Xorg_libXinerama_jll", "Xorg_libXrandr_jll"] +git-tree-sha1 = "d972031d28c8c8d9d7b41a536ad7bb0c2579caca" +uuid = "0656b61e-2033-5cc2-a64a-77c0f6c09b89" +version = "3.3.8+0" + +[[deps.GPUArraysCore]] +deps = ["Adapt"] +git-tree-sha1 = "2d6ca471a6c7b536127afccfa7564b5b39227fe0" +uuid = "46192b85-c4d5-4398-a991-12ede77f4527" +version = "0.1.5" + +[[deps.GR]] +deps = ["Artifacts", "Base64", "DelimitedFiles", "Downloads", "GR_jll", "HTTP", "JSON", "Libdl", "LinearAlgebra", "Pkg", "Preferences", "Printf", "Random", "Serialization", "Sockets", "TOML", "Tar", "Test", "UUIDs", "p7zip_jll"] +git-tree-sha1 = "27442171f28c952804dede8ff72828a96f2bfc1f" +uuid = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71" +version = "0.72.10" + +[[deps.GR_jll]] +deps = ["Artifacts", "Bzip2_jll", "Cairo_jll", "FFMPEG_jll", "Fontconfig_jll", "FreeType2_jll", "GLFW_jll", "JLLWrappers", "JpegTurbo_jll", "Libdl", "Libtiff_jll", "Pixman_jll", "Qt6Base_jll", "Zlib_jll", "libpng_jll"] +git-tree-sha1 = "025d171a2847f616becc0f84c8dc62fe18f0f6dd" +uuid = "d2c73de3-f751-5644-a686-071e5b155ba9" +version = "0.72.10+0" + +[[deps.Gettext_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "XML2_jll"] +git-tree-sha1 = "9b02998aba7bf074d14de89f9d37ca24a1a0b046" +uuid = "78b55507-aeef-58d4-861c-77aaff3498b1" +version = "0.21.0+0" + +[[deps.Glib_jll]] +deps = ["Artifacts", "Gettext_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Libiconv_jll", "Libmount_jll", "PCRE2_jll", "Zlib_jll"] +git-tree-sha1 = "e94c92c7bf4819685eb80186d51c43e71d4afa17" +uuid = "7746bdde-850d-59dc-9ae8-88ece973131d" +version = "2.76.5+0" + +[[deps.Graphite2_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "344bf40dcab1073aca04aa0df4fb092f920e4011" +uuid = "3b182d85-2403-5c21-9c21-1e1f0cc25472" +version = "1.3.14+0" + +[[deps.Grisu]] +git-tree-sha1 = "53bb909d1151e57e2484c3d1b53e19552b887fb2" +uuid = "42e2da0e-8278-4e71-bc24-59509adca0fe" +version = "1.0.2" + +[[deps.Groebner]] +deps = ["AbstractAlgebra", "Combinatorics", "ExprTools", "Logging", "MultivariatePolynomials", "Primes", "Random", "SIMD", "SnoopPrecompile"] +git-tree-sha1 = "44f595de4f6485ab5ba71fe257b5eadaa3cf161e" +uuid = "0b43b601-686d-58a3-8a1c-6623616c7cd4" +version = "0.4.4" + +[[deps.GroupsCore]] +deps = ["Markdown", "Random"] +git-tree-sha1 = "9e1a5e9f3b81ad6a5c613d181664a0efc6fe6dd7" +uuid = "d5909c97-4eac-4ecc-a3dc-fdd0858a4120" +version = "0.4.0" + +[[deps.Gumbo]] +deps = ["AbstractTrees", "Gumbo_jll", "Libdl"] +git-tree-sha1 = "a1a138dfbf9df5bace489c7a9d5196d6afdfa140" +uuid = "708ec375-b3d6-5a57-a7ce-8257bf98657a" +version = "0.8.2" + +[[deps.Gumbo_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "29070dee9df18d9565276d68a596854b1764aa38" +uuid = "528830af-5a63-567c-a44a-034ed33b8444" +version = "0.10.2+0" + +[[deps.HTTP]] +deps = ["Base64", "CodecZlib", "ConcurrentUtilities", "Dates", "ExceptionUnwrapping", "Logging", "LoggingExtras", "MbedTLS", "NetworkOptions", "OpenSSL", "Random", "SimpleBufferStream", "Sockets", "URIs", "UUIDs"] +git-tree-sha1 = "5eab648309e2e060198b45820af1a37182de3cce" +uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" +version = "1.10.0" + +[[deps.HarfBuzz_jll]] +deps = ["Artifacts", "Cairo_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "Graphite2_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Pkg"] +git-tree-sha1 = "129acf094d168394e80ee1dc4bc06ec835e510a3" +uuid = "2e76f6c2-a576-52d4-95c1-20adfe4de566" +version = "2.8.1+1" + +[[deps.HostCPUFeatures]] +deps = ["BitTwiddlingConvenienceFunctions", "IfElse", "Libdl", "Static"] +git-tree-sha1 = "eb8fed28f4994600e29beef49744639d985a04b2" +uuid = "3e5b6fbb-0976-4d2c-9146-d79de83f2fb0" +version = "0.1.16" + +[[deps.HypergeometricFunctions]] +deps = ["DualNumbers", "LinearAlgebra", "OpenLibm_jll", "SpecialFunctions"] +git-tree-sha1 = "f218fe3736ddf977e0e772bc9a586b2383da2685" +uuid = "34004b35-14d8-5ef3-9330-4cdb6864b03a" +version = "0.3.23" + +[[deps.Hyperscript]] +deps = ["Test"] +git-tree-sha1 = "8d511d5b81240fc8e6802386302675bdf47737b9" +uuid = "47d2ed2b-36de-50cf-bf87-49c2cf4b8b91" +version = "0.0.4" + +[[deps.HypertextLiteral]] +deps = ["Tricks"] +git-tree-sha1 = "7134810b1afce04bbc1045ca1985fbe81ce17653" +uuid = "ac1192a8-f4b3-4bfe-ba22-af5b92cd3ab2" +version = "0.9.5" + +[[deps.IOCapture]] +deps = ["Logging", "Random"] +git-tree-sha1 = "d75853a0bdbfb1ac815478bacd89cd27b550ace6" +uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89" +version = "0.2.3" + +[[deps.IfElse]] +git-tree-sha1 = "debdd00ffef04665ccbb3e150747a77560e8fad1" +uuid = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173" +version = "0.1.1" + +[[deps.ImplicitDifferentiation]] +deps = ["AbstractDifferentiation", "Krylov", "LinearAlgebra", "LinearOperators", "PrecompileTools", "Requires", "SimpleUnPack"] +git-tree-sha1 = "d9f3708b9ccac5a9bf3dd99d010a6ac0b537eb83" +uuid = "57b37032-215b-411a-8a7c-41a003a55207" +version = "0.5.2" + + [deps.ImplicitDifferentiation.extensions] + ImplicitDifferentiationChainRulesCoreExt = "ChainRulesCore" + ImplicitDifferentiationForwardDiffExt = "ForwardDiff" + ImplicitDifferentiationStaticArraysExt = "StaticArrays" + ImplicitDifferentiationZygoteExt = "Zygote" + + [deps.ImplicitDifferentiation.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" + StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" + Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" + +[[deps.IntegerMathUtils]] +git-tree-sha1 = "b8ffb903da9f7b8cf695a8bead8e01814aa24b30" +uuid = "18e54dd8-cb9d-406c-a71d-865a43cbb235" +version = "0.1.2" + +[[deps.IntelOpenMP_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "ad37c091f7d7daf900963171600d7c1c5c3ede32" +uuid = "1d5cc7b8-4909-519e-a0f8-d0f5ad9712d0" +version = "2023.2.0+0" + +[[deps.InteractiveUtils]] +deps = ["Markdown"] +uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" + +[[deps.Interpolations]] +deps = ["Adapt", "AxisAlgorithms", "ChainRulesCore", "LinearAlgebra", "OffsetArrays", "Random", "Ratios", "Requires", "SharedArrays", "SparseArrays", "StaticArrays", "WoodburyMatrices"] +git-tree-sha1 = "721ec2cf720536ad005cb38f50dbba7b02419a15" +uuid = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59" +version = "0.14.7" + +[[deps.IntervalSets]] +deps = ["Dates", "Random"] +git-tree-sha1 = "3d8866c029dd6b16e69e0d4a939c4dfcb98fac47" +uuid = "8197267c-284f-5f27-9208-e0e47529a953" +version = "0.7.8" +weakdeps = ["Statistics"] + + [deps.IntervalSets.extensions] + IntervalSetsStatisticsExt = "Statistics" + +[[deps.InverseFunctions]] +deps = ["Test"] +git-tree-sha1 = "68772f49f54b479fa88ace904f6127f0a3bb2e46" +uuid = "3587e190-3f89-42d0-90ee-14403ec27112" +version = "0.1.12" + +[[deps.InvertedIndices]] +git-tree-sha1 = "0dc7b50b8d436461be01300fd8cd45aa0274b038" +uuid = "41ab1584-1d38-5bbf-9106-f11c6c58b48f" +version = "1.3.0" + +[[deps.IrrationalConstants]] +git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2" +uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" +version = "0.2.2" + +[[deps.IteratorInterfaceExtensions]] +git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856" +uuid = "82899510-4779-5014-852e-03e436cf321d" +version = "1.0.0" + +[[deps.JLFzf]] +deps = ["Pipe", "REPL", "Random", "fzf_jll"] +git-tree-sha1 = "9fb0b890adab1c0a4a475d4210d51f228bfc250d" +uuid = "1019f520-868f-41f5-a6de-eb00f4b6a39c" +version = "0.1.6" + +[[deps.JLLWrappers]] +deps = ["Artifacts", "Preferences"] +git-tree-sha1 = "7e5d6779a1e09a36db2a7b6cff50942a0a7d0fca" +uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" +version = "1.5.0" + +[[deps.JSON]] +deps = ["Dates", "Mmap", "Parsers", "Unicode"] +git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a" +uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" +version = "0.21.4" + +[[deps.JSON3]] +deps = ["Dates", "Mmap", "Parsers", "PrecompileTools", "StructTypes", "UUIDs"] +git-tree-sha1 = "95220473901735a0f4df9d1ca5b171b568b2daa3" +uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" +version = "1.13.2" + +[[deps.JpegTurbo_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "6f2675ef130a300a112286de91973805fcc5ffbc" +uuid = "aacddb02-875f-59d6-b918-886e6ef4fbf8" +version = "2.1.91+0" + +[[deps.JuMP]] +deps = ["LinearAlgebra", "MacroTools", "MathOptInterface", "MutableArithmetics", "OrderedCollections", "Printf", "SnoopPrecompile", "SparseArrays"] +git-tree-sha1 = "25b2fcda4d455b6f93ac753730d741340ba4a4fe" +uuid = "4076af6c-e467-56ae-b986-b466b2749572" +version = "1.16.0" + + [deps.JuMP.extensions] + JuMPDimensionalDataExt = "DimensionalData" + + [deps.JuMP.weakdeps] + DimensionalData = "0703355e-b756-11e9-17c0-8b28908087d0" + +[[deps.KernelDensity]] +deps = ["Distributions", "DocStringExtensions", "FFTW", "Interpolations", "StatsBase"] +git-tree-sha1 = "90442c50e202a5cdf21a7899c66b240fdef14035" +uuid = "5ab0869b-81aa-558d-bb23-cbf5423bbe9b" +version = "0.6.7" + +[[deps.Krylov]] +deps = ["LinearAlgebra", "Printf", "SparseArrays"] +git-tree-sha1 = "17e462054b42dcdda73e9a9ba0c67754170c88ae" +uuid = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7" +version = "0.9.4" + +[[deps.LAME_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "f6250b16881adf048549549fba48b1161acdac8c" +uuid = "c1c5ebd0-6772-5130-a774-d5fcae4a789d" +version = "3.100.1+0" + +[[deps.LDLFactorizations]] +deps = ["AMD", "LinearAlgebra", "SparseArrays", "Test"] +git-tree-sha1 = "70f582b446a1c3ad82cf87e62b878668beef9d13" +uuid = "40e66cde-538c-5869-a4ad-c39174c6795b" +version = "0.10.1" + +[[deps.LERC_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "bf36f528eec6634efc60d7ec062008f171071434" +uuid = "88015f11-f218-50d7-93a8-a6af411a945d" +version = "3.0.0+1" + +[[deps.LLVMOpenMP_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "f689897ccbe049adb19a065c495e75f372ecd42b" +uuid = "1d63c593-3942-5779-bab2-d838dc0a180e" +version = "15.0.4+0" + +[[deps.LZO_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "e5b909bcf985c5e2605737d2ce278ed791b89be6" +uuid = "dd4b983a-f0e5-5f8d-a1b7-129d4a5fb1ac" +version = "2.10.1+0" + +[[deps.LaTeXStrings]] +git-tree-sha1 = "50901ebc375ed41dbf8058da26f9de442febbbec" +uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" +version = "1.3.1" + +[[deps.LabelledArrays]] +deps = ["ArrayInterface", "ChainRulesCore", "ForwardDiff", "LinearAlgebra", "MacroTools", "PreallocationTools", "RecursiveArrayTools", "StaticArrays"] +git-tree-sha1 = "cd04158424635efd05ff38d5f55843397b7416a9" +uuid = "2ee39098-c373-598a-b85f-a56591580800" +version = "1.14.0" + +[[deps.LambertW]] +git-tree-sha1 = "c5ffc834de5d61d00d2b0e18c96267cffc21f648" +uuid = "984bce1d-4616-540c-a9ee-88d1112d94c9" +version = "0.4.6" + +[[deps.Latexify]] +deps = ["Formatting", "InteractiveUtils", "LaTeXStrings", "MacroTools", "Markdown", "OrderedCollections", "Printf", "Requires"] +git-tree-sha1 = "f428ae552340899a935973270b8d98e5a31c49fe" +uuid = "23fbe1c1-3f47-55db-b15f-69d7ec21a316" +version = "0.16.1" + + [deps.Latexify.extensions] + DataFramesExt = "DataFrames" + SymEngineExt = "SymEngine" + + [deps.Latexify.weakdeps] + DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" + SymEngine = "123dc426-2d89-5057-bbad-38513e3affd8" + +[[deps.LatticeRules]] +deps = ["Random"] +git-tree-sha1 = "7f5b02258a3ca0221a6a9710b0a0a2e8fb4957fe" +uuid = "73f95e8e-ec14-4e6a-8b18-0d2e271c4e55" +version = "0.0.1" + +[[deps.LayoutPointers]] +deps = ["ArrayInterface", "LinearAlgebra", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface"] +git-tree-sha1 = "62edfee3211981241b57ff1cedf4d74d79519277" +uuid = "10f19ff3-798f-405d-979b-55457f8fc047" +version = "0.1.15" + +[[deps.LazilyInitializedFields]] +git-tree-sha1 = "8f7f3cabab0fd1800699663533b6d5cb3fc0e612" +uuid = "0e77f7df-68c5-4e49-93ce-4cd80f5598bf" +version = "1.2.2" + +[[deps.Lazy]] +deps = ["MacroTools"] +git-tree-sha1 = "1370f8202dac30758f3c345f9909b97f53d87d3f" +uuid = "50d2b5c4-7a5e-59d5-8109-a42b560f39c0" +version = "0.15.1" + +[[deps.LazyArtifacts]] +deps = ["Artifacts", "Pkg"] +uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" + +[[deps.LazyStack]] +deps = ["ChainRulesCore", "LinearAlgebra", "NamedDims", "OffsetArrays"] +git-tree-sha1 = "2eb4a5bf2eb0519ebf40c797ba5637d327863637" +uuid = "1fad7336-0346-5a1a-a56f-a06ba010965b" +version = "0.0.8" + +[[deps.LibCURL]] +deps = ["LibCURL_jll", "MozillaCACerts_jll"] +uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21" +version = "0.6.4" + +[[deps.LibCURL_jll]] +deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"] +uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0" +version = "8.4.0+0" + +[[deps.LibGit2]] +deps = ["Base64", "LibGit2_jll", "NetworkOptions", "Printf", "SHA"] +uuid = "76f85450-5226-5b5a-8eaa-529ad045b433" + +[[deps.LibGit2_jll]] +deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll"] +uuid = "e37daf67-58a4-590a-8e99-b0245dd2ffc5" +version = "1.6.4+0" + +[[deps.LibSSH2_jll]] +deps = ["Artifacts", "Libdl", "MbedTLS_jll"] +uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8" +version = "1.11.0+1" + +[[deps.Libdl]] +uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb" + +[[deps.Libffi_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "0b4a5d71f3e5200a7dff793393e09dfc2d874290" +uuid = "e9f186c6-92d2-5b65-8a66-fee21dc1b490" +version = "3.2.2+1" + +[[deps.Libgcrypt_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgpg_error_jll", "Pkg"] +git-tree-sha1 = "64613c82a59c120435c067c2b809fc61cf5166ae" +uuid = "d4300ac3-e22c-5743-9152-c294e39db1e4" +version = "1.8.7+0" + +[[deps.Libglvnd_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll", "Xorg_libXext_jll"] +git-tree-sha1 = "6f73d1dd803986947b2c750138528a999a6c7733" +uuid = "7e76a0d4-f3c7-5321-8279-8d96eeed0f29" +version = "1.6.0+0" + +[[deps.Libgpg_error_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "c333716e46366857753e273ce6a69ee0945a6db9" +uuid = "7add5ba3-2f88-524e-9cd5-f83b8a55f7b8" +version = "1.42.0+0" + +[[deps.Libiconv_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "f9557a255370125b405568f9767d6d195822a175" +uuid = "94ce4f54-9a6c-5748-9c1c-f9c7231a4531" +version = "1.17.0+0" + +[[deps.Libmount_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "9c30530bf0effd46e15e0fdcf2b8636e78cbbd73" +uuid = "4b2f31a3-9ecc-558c-b454-b3730dcb73e9" +version = "2.35.0+0" + +[[deps.Libtiff_jll]] +deps = ["Artifacts", "JLLWrappers", "JpegTurbo_jll", "LERC_jll", "Libdl", "XZ_jll", "Zlib_jll", "Zstd_jll"] +git-tree-sha1 = "2da088d113af58221c52828a80378e16be7d037a" +uuid = "89763e89-9b03-5906-acba-b20f662cd828" +version = "4.5.1+1" + +[[deps.Libuuid_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "7f3efec06033682db852f8b3bc3c1d2b0a0ab066" +uuid = "38a345b3-de98-5d2b-a5d3-14cd9215e700" +version = "2.36.0+0" + +[[deps.LinearAlgebra]] +deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"] +uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" + +[[deps.LinearMaps]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "9df2ab050ffefe870a09c7b6afdb0cde381703f2" +uuid = "7a12625a-238d-50fd-b39a-03d52299707e" +version = "3.11.1" +weakdeps = ["ChainRulesCore", "SparseArrays", "Statistics"] + + [deps.LinearMaps.extensions] + LinearMapsChainRulesCoreExt = "ChainRulesCore" + LinearMapsSparseArraysExt = "SparseArrays" + LinearMapsStatisticsExt = "Statistics" + +[[deps.LinearOperators]] +deps = ["FastClosures", "LDLFactorizations", "LinearAlgebra", "Printf", "SparseArrays", "TimerOutputs"] +git-tree-sha1 = "a58ab1d18efa0bcf9f0868c6d387e4126dad3e72" +uuid = "5c8ed15e-5a4c-59e4-a42b-c7e8811fb125" +version = "2.5.2" + +[[deps.LogExpFunctions]] +deps = ["DocStringExtensions", "IrrationalConstants", "LinearAlgebra"] +git-tree-sha1 = "7d6dd4e9212aebaeed356de34ccf262a3cd415aa" +uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" +version = "0.3.26" + + [deps.LogExpFunctions.extensions] + LogExpFunctionsChainRulesCoreExt = "ChainRulesCore" + LogExpFunctionsChangesOfVariablesExt = "ChangesOfVariables" + LogExpFunctionsInverseFunctionsExt = "InverseFunctions" + + [deps.LogExpFunctions.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + ChangesOfVariables = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0" + InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112" + +[[deps.Logging]] +uuid = "56ddb016-857b-54e1-b83d-db4d58db5568" + +[[deps.LoggingExtras]] +deps = ["Dates", "Logging"] +git-tree-sha1 = "c1dd6d7978c12545b4179fb6153b9250c96b0075" +uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36" +version = "1.0.3" + +[[deps.LoopVectorization]] +deps = ["ArrayInterface", "CPUSummary", "CloseOpenIntervals", "DocStringExtensions", "HostCPUFeatures", "IfElse", "LayoutPointers", "LinearAlgebra", "OffsetArrays", "PolyesterWeave", "PrecompileTools", "SIMDTypes", "SLEEFPirates", "Static", "StaticArrayInterface", "ThreadingUtilities", "UnPack", "VectorizationBase"] +git-tree-sha1 = "0f5648fbae0d015e3abe5867bca2b362f67a5894" +uuid = "bdcacae8-1622-11e9-2a5c-532679323890" +version = "0.12.166" +weakdeps = ["ChainRulesCore", "ForwardDiff", "SpecialFunctions"] + + [deps.LoopVectorization.extensions] + ForwardDiffExt = ["ChainRulesCore", "ForwardDiff"] + SpecialFunctionsExt = "SpecialFunctions" + +[[deps.MIMEs]] +git-tree-sha1 = "65f28ad4b594aebe22157d6fac869786a255b7eb" +uuid = "6c6e2e6c-3030-632d-7369-2d6c69616d65" +version = "0.1.4" + +[[deps.MKL_jll]] +deps = ["Artifacts", "IntelOpenMP_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "Pkg"] +git-tree-sha1 = "eb006abbd7041c28e0d16260e50a24f8f9104913" +uuid = "856f044c-d86e-5d09-b602-aeab76dc8ba7" +version = "2023.2.0+0" + +[[deps.MacroModelling]] +deps = ["AbstractDifferentiation", "AxisKeys", "BlockTriangularForm", "ChainRulesCore", "DataStructures", "DocStringExtensions", "DynarePreprocessor_jll", "ForwardDiff", "ImplicitDifferentiation", "JSON", "JuMP", "Krylov", "LaTeXStrings", "LinearAlgebra", "LinearOperators", "MacroTools", "MadNLP", "MatrixEquations", "NLopt", "PrecompileTools", "REPL", "Random", "RecursiveFactorization", "Reexport", "Requires", "RuntimeGeneratedFunctions", "SparseArrays", "SpecialFunctions", "SpeedMapping", "Subscripts", "SymPyPythonCall", "Symbolics", "Unicode"] +git-tree-sha1 = "ed0c476fd865de68718f3cc14886288eca3d297b" +uuid = "687ffad2-3618-405e-ac50-e0f7b9c75e44" +version = "0.1.31" + + [deps.MacroModelling.weakdeps] + StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd" + Turing = "fce5fe82-541a-59a6-adf8-730c64b5f9a0" + +[[deps.MacroTools]] +deps = ["Markdown", "Random"] +git-tree-sha1 = "9ee1618cbf5240e6d4e0371d6f24065083f60c48" +uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" +version = "0.5.11" + +[[deps.MadNLP]] +deps = ["Libdl", "LinearAlgebra", "Logging", "MathOptInterface", "NLPModels", "Pkg", "Printf", "SolverCore", "SparseArrays", "SuiteSparse"] +git-tree-sha1 = "65d1edba975973dfe3d08f06dde3b95847f8f233" +uuid = "2621e9c9-9eb4-46b1-8089-e8c72242dfb6" +version = "0.7.0" + +[[deps.ManualMemory]] +git-tree-sha1 = "bcaef4fc7a0cfe2cba636d84cda54b5e4e4ca3cd" +uuid = "d125e4d3-2237-4719-b19c-fa641b8a4667" +version = "0.1.8" + +[[deps.Markdown]] +deps = ["Base64"] +uuid = "d6f4376e-aef5-505a-96c1-9c027394607a" + +[[deps.MarkdownAST]] +deps = ["AbstractTrees", "Markdown"] +git-tree-sha1 = "465a70f0fc7d443a00dcdc3267a497397b8a3899" +uuid = "d0879d2d-cac2-40c8-9cee-1863dc0c7391" +version = "0.1.2" + +[[deps.MathOptInterface]] +deps = ["BenchmarkTools", "CodecBzip2", "CodecZlib", "DataStructures", "ForwardDiff", "JSON", "LinearAlgebra", "MutableArithmetics", "NaNMath", "OrderedCollections", "PrecompileTools", "Printf", "SparseArrays", "SpecialFunctions", "Test", "Unicode"] +git-tree-sha1 = "70ea2892b8bfffecc0387ba1a6a21192814f120c" +uuid = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" +version = "1.22.0" + +[[deps.MatrixEquations]] +deps = ["LinearAlgebra", "LinearMaps"] +git-tree-sha1 = "23d650690c95537893d7a666854362c0024a6c99" +uuid = "99c1a7ee-ab34-5fd5-8076-27c950a045f4" +version = "2.3.1" + +[[deps.MbedTLS]] +deps = ["Dates", "MbedTLS_jll", "MozillaCACerts_jll", "NetworkOptions", "Random", "Sockets"] +git-tree-sha1 = "c067a280ddc25f196b5e7df3877c6b226d390aaf" +uuid = "739be429-bea8-5141-9913-cc70e7f3736d" +version = "1.1.9" + +[[deps.MbedTLS_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1" +version = "2.28.2+1" + +[[deps.Measures]] +git-tree-sha1 = "c13304c81eec1ed3af7fc20e75fb6b26092a1102" +uuid = "442fdcdd-2543-5da2-b0f3-8c86c306513e" +version = "0.3.2" + +[[deps.MicroMamba]] +deps = ["Pkg", "Scratch", "micromamba_jll"] +git-tree-sha1 = "011cab361eae7bcd7d278f0a7a00ff9c69000c51" +uuid = "0b3b1443-0f03-428d-bdfb-f27f9c1191ea" +version = "0.1.14" + +[[deps.Missings]] +deps = ["DataAPI"] +git-tree-sha1 = "f66bdc5de519e8f8ae43bdc598782d35a25b1272" +uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28" +version = "1.1.0" + +[[deps.Mmap]] +uuid = "a63ad114-7e13-5084-954f-fe012c677804" + +[[deps.MozillaCACerts_jll]] +uuid = "14a3606d-f60d-562e-9121-12d972cd8159" +version = "2023.1.10" + +[[deps.MuladdMacro]] +git-tree-sha1 = "cac9cc5499c25554cba55cd3c30543cff5ca4fab" +uuid = "46d2c3a1-f734-5fdb-9937-b9b9aeba4221" +version = "0.2.4" + +[[deps.MultivariatePolynomials]] +deps = ["ChainRulesCore", "DataStructures", "LinearAlgebra", "MutableArithmetics"] +git-tree-sha1 = "6ffb234d6d7c866a75c1879d2099049d3a35a83a" +uuid = "102ac46a-7ee4-5c85-9060-abc95bfdeaa3" +version = "0.5.3" + +[[deps.MultivariateStats]] +deps = ["Arpack", "LinearAlgebra", "SparseArrays", "Statistics", "StatsAPI", "StatsBase"] +git-tree-sha1 = "68bf5103e002c44adfd71fea6bd770b3f0586843" +uuid = "6f286f6a-111f-5878-ab1e-185364afe411" +version = "0.10.2" + +[[deps.MutableArithmetics]] +deps = ["LinearAlgebra", "SparseArrays", "Test"] +git-tree-sha1 = "6985021d02ab8c509c841bb8b2becd3145a7b490" +uuid = "d8a4904e-b15c-11e9-3269-09a3773c0cb0" +version = "1.3.3" + +[[deps.NLPModels]] +deps = ["FastClosures", "LinearAlgebra", "LinearOperators", "Printf", "SparseArrays"] +git-tree-sha1 = "51b458add76a938917772ee661ffb9d59b4c7e5d" +uuid = "a4795742-8479-5a88-8948-cc11e1c8c1a6" +version = "0.20.0" + +[[deps.NLopt]] +deps = ["NLopt_jll"] +git-tree-sha1 = "19d2a1c8a3c5b5a459f54a10e54de630c4a05701" +uuid = "76087f3c-5699-56af-9a33-bf431cd00edd" +version = "1.0.0" +weakdeps = ["MathOptInterface"] + + [deps.NLopt.extensions] + NLoptMathOptInterfaceExt = ["MathOptInterface"] + +[[deps.NLopt_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "9b1f15a08f9d00cdb2761dcfa6f453f5d0d6f973" +uuid = "079eb43e-fd8e-5478-9966-2cf3e3edb778" +version = "2.7.1+0" + +[[deps.NaNMath]] +deps = ["OpenLibm_jll"] +git-tree-sha1 = "0877504529a3e5c3343c6f8b4c0381e57e4387e4" +uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" +version = "1.0.2" + +[[deps.NamedDims]] +deps = ["AbstractFFTs", "ChainRulesCore", "CovarianceEstimation", "LinearAlgebra", "Pkg", "Requires", "Statistics"] +git-tree-sha1 = "dc9144f80a79b302b48c282ad29b1dc2f10a9792" +uuid = "356022a1-0364-5f58-8944-0da4b18d706f" +version = "1.2.1" + +[[deps.NearestNeighbors]] +deps = ["Distances", "StaticArrays"] +git-tree-sha1 = "2c3726ceb3388917602169bed973dbc97f1b51a8" +uuid = "b8a86587-4115-5ab1-83bc-aa920d37bbce" +version = "0.4.13" + +[[deps.NetworkOptions]] +uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" +version = "1.2.0" + +[[deps.Observables]] +git-tree-sha1 = "7438a59546cf62428fc9d1bc94729146d37a7225" +uuid = "510215fc-4207-5dde-b226-833fc4488ee2" +version = "0.5.5" + +[[deps.OffsetArrays]] +deps = ["Adapt"] +git-tree-sha1 = "2ac17d29c523ce1cd38e27785a7d23024853a4bb" +uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" +version = "1.12.10" + +[[deps.Ogg_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "887579a3eb005446d514ab7aeac5d1d027658b8f" +uuid = "e7412a2a-1a6e-54c0-be00-318e2571c051" +version = "1.3.5+1" + +[[deps.OpenBLAS_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"] +uuid = "4536629a-c528-5b80-bd46-f80d51c5b363" +version = "0.3.23+2" + +[[deps.OpenLibm_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "05823500-19ac-5b8b-9628-191a04bc5112" +version = "0.8.1+2" + +[[deps.OpenSSH_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "OpenSSL_jll", "Pkg", "Zlib_jll"] +git-tree-sha1 = "1b2f042897343a9dfdcc9366e4ecbd3d00780c49" +uuid = "9bd350c2-7e96-507f-8002-3f2e150b4e1b" +version = "8.9.0+1" + +[[deps.OpenSSL]] +deps = ["BitFlags", "Dates", "MozillaCACerts_jll", "OpenSSL_jll", "Sockets"] +git-tree-sha1 = "51901a49222b09e3743c65b8847687ae5fc78eb2" +uuid = "4d8831e6-92b7-49fb-bdf8-b643e874388c" +version = "1.4.1" + +[[deps.OpenSSL_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "a12e56c72edee3ce6b96667745e6cbbe5498f200" +uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" +version = "1.1.23+0" + +[[deps.OpenSpecFun_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1" +uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e" +version = "0.5.5+0" + +[[deps.Opus_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "51a08fb14ec28da2ec7a927c4337e4332c2a4720" +uuid = "91d4177d-7536-5919-b921-800302f37372" +version = "1.3.2+0" + +[[deps.OrderedCollections]] +git-tree-sha1 = "dfdf5519f235516220579f949664f1bf44e741c5" +uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" +version = "1.6.3" + +[[deps.PCRE2_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "efcefdf7-47ab-520b-bdef-62a2eaa19f15" +version = "10.42.0+1" + +[[deps.PDMats]] +deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse"] +git-tree-sha1 = "4e5be6bb265d33669f98eb55d2a57addd1eeb72c" +uuid = "90014a1f-27ba-587c-ab20-58faa44d9150" +version = "0.11.30" + +[[deps.Parsers]] +deps = ["Dates", "PrecompileTools", "UUIDs"] +git-tree-sha1 = "a935806434c9d4c506ba941871b327b96d41f2bf" +uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0" +version = "2.8.0" + +[[deps.Pidfile]] +deps = ["FileWatching", "Test"] +git-tree-sha1 = "2d8aaf8ee10df53d0dfb9b8ee44ae7c04ced2b03" +uuid = "fa939f87-e72e-5be4-a000-7fc836dbe307" +version = "1.3.0" + +[[deps.Pipe]] +git-tree-sha1 = "6842804e7867b115ca9de748a0cf6b364523c16d" +uuid = "b98c9c47-44ae-5843-9183-064241ee97a0" +version = "1.3.0" + +[[deps.Pixman_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl"] +git-tree-sha1 = "64779bc4c9784fee475689a1752ef4d5747c5e87" +uuid = "30392449-352a-5448-841d-b1acce4e97dc" +version = "0.42.2+0" + +[[deps.Pkg]] +deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] +uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +version = "1.10.0" + +[[deps.PlotThemes]] +deps = ["PlotUtils", "Statistics"] +git-tree-sha1 = "1f03a2d339f42dca4a4da149c7e15e9b896ad899" +uuid = "ccf2f8ad-2431-5c83-bf29-c5338b663b6a" +version = "3.1.0" + +[[deps.PlotUtils]] +deps = ["ColorSchemes", "Colors", "Dates", "PrecompileTools", "Printf", "Random", "Reexport", "Statistics"] +git-tree-sha1 = "f92e1315dadf8c46561fb9396e525f7200cdc227" +uuid = "995b91a9-d308-5afd-9ec6-746e21dbc043" +version = "1.3.5" + +[[deps.Plots]] +deps = ["Base64", "Contour", "Dates", "Downloads", "FFMPEG", "FixedPointNumbers", "GR", "JLFzf", "JSON", "LaTeXStrings", "Latexify", "LinearAlgebra", "Measures", "NaNMath", "Pkg", "PlotThemes", "PlotUtils", "PrecompileTools", "Preferences", "Printf", "REPL", "Random", "RecipesBase", "RecipesPipeline", "Reexport", "RelocatableFolders", "Requires", "Scratch", "Showoff", "SparseArrays", "Statistics", "StatsBase", "UUIDs", "UnicodeFun", "UnitfulLatexify", "Unzip"] +git-tree-sha1 = "ccee59c6e48e6f2edf8a5b64dc817b6729f99eb5" +uuid = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" +version = "1.39.0" + + [deps.Plots.extensions] + FileIOExt = "FileIO" + GeometryBasicsExt = "GeometryBasics" + IJuliaExt = "IJulia" + ImageInTerminalExt = "ImageInTerminal" + UnitfulExt = "Unitful" + + [deps.Plots.weakdeps] + FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" + GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326" + IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a" + ImageInTerminal = "d8c32880-2388-543b-8c61-d9f865259254" + Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" + +[[deps.PlutoUI]] +deps = ["AbstractPlutoDingetjes", "Base64", "ColorTypes", "Dates", "FixedPointNumbers", "Hyperscript", "HypertextLiteral", "IOCapture", "InteractiveUtils", "JSON", "Logging", "MIMEs", "Markdown", "Random", "Reexport", "URIs", "UUIDs"] +git-tree-sha1 = "bd7c69c7f7173097e7b5e1be07cee2b8b7447f51" +uuid = "7f904dfe-b85e-4ff6-b463-dae2292396a8" +version = "0.7.54" + +[[deps.Polyester]] +deps = ["ArrayInterface", "BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "ManualMemory", "PolyesterWeave", "Requires", "Static", "StaticArrayInterface", "StrideArraysCore", "ThreadingUtilities"] +git-tree-sha1 = "fca25670784a1ae44546bcb17288218310af2778" +uuid = "f517fe37-dbe3-4b94-8317-1923a5111588" +version = "0.7.9" + +[[deps.PolyesterWeave]] +deps = ["BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "Static", "ThreadingUtilities"] +git-tree-sha1 = "240d7170f5ffdb285f9427b92333c3463bf65bf6" +uuid = "1d0040c9-8b98-4ee7-8388-3f51789ca0ad" +version = "0.2.1" + +[[deps.PreallocationTools]] +deps = ["Adapt", "ArrayInterface", "ForwardDiff", "Requires"] +git-tree-sha1 = "f739b1b3cc7b9949af3b35089931f2b58c289163" +uuid = "d236fae5-4411-538c-8e31-a6e3d9e00b46" +version = "0.4.12" + + [deps.PreallocationTools.extensions] + PreallocationToolsReverseDiffExt = "ReverseDiff" + + [deps.PreallocationTools.weakdeps] + ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" + +[[deps.PrecompileTools]] +deps = ["Preferences"] +git-tree-sha1 = "03b4c25b43cb84cee5c90aa9b5ea0a78fd848d2f" +uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a" +version = "1.2.0" + +[[deps.Preferences]] +deps = ["TOML"] +git-tree-sha1 = "00805cd429dcb4870060ff49ef443486c262e38e" +uuid = "21216c6a-2e73-6563-6e65-726566657250" +version = "1.4.1" + +[[deps.Primes]] +deps = ["IntegerMathUtils"] +git-tree-sha1 = "1d05623b5952aed1307bf8b43bec8b8d1ef94b6e" +uuid = "27ebfcd6-29c5-5fa9-bf4b-fb8fc14df3ae" +version = "0.5.5" + +[[deps.Printf]] +deps = ["Unicode"] +uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" + +[[deps.Profile]] +deps = ["Printf"] +uuid = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79" + +[[deps.PythonCall]] +deps = ["CondaPkg", "Dates", "Libdl", "MacroTools", "Markdown", "Pkg", "REPL", "Requires", "Serialization", "Tables", "UnsafePointers"] +git-tree-sha1 = "4999b3e4e9bdeba0b61ede19cc45a2128db21cdc" +uuid = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d" +version = "0.9.15" + +[[deps.Qt6Base_jll]] +deps = ["Artifacts", "CompilerSupportLibraries_jll", "Fontconfig_jll", "Glib_jll", "JLLWrappers", "Libdl", "Libglvnd_jll", "OpenSSL_jll", "Vulkan_Loader_jll", "Xorg_libSM_jll", "Xorg_libXext_jll", "Xorg_libXrender_jll", "Xorg_libxcb_jll", "Xorg_xcb_util_cursor_jll", "Xorg_xcb_util_image_jll", "Xorg_xcb_util_keysyms_jll", "Xorg_xcb_util_renderutil_jll", "Xorg_xcb_util_wm_jll", "Zlib_jll", "libinput_jll", "xkbcommon_jll"] +git-tree-sha1 = "7c29f0e8c575428bd84dc3c72ece5178caa67336" +uuid = "c0090381-4147-56d7-9ebc-da0b1113ec56" +version = "6.5.2+2" + +[[deps.QuadGK]] +deps = ["DataStructures", "LinearAlgebra"] +git-tree-sha1 = "9ebcd48c498668c7fa0e97a9cae873fbee7bfee1" +uuid = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" +version = "2.9.1" + +[[deps.QuasiMonteCarlo]] +deps = ["Accessors", "ConcreteStructs", "LatticeRules", "LinearAlgebra", "Primes", "Random", "Requires", "Sobol", "StatsBase"] +git-tree-sha1 = "cc086f8485bce77b6187141e1413c3b55f9a4341" +uuid = "8a4e6c94-4038-4cdc-81c3-7e6ffdb2a71b" +version = "0.3.3" +weakdeps = ["Distributions"] + + [deps.QuasiMonteCarlo.extensions] + QuasiMonteCarloDistributionsExt = "Distributions" + +[[deps.REPL]] +deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"] +uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" + +[[deps.Random]] +deps = ["SHA"] +uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" + +[[deps.RandomExtensions]] +deps = ["Random", "SparseArrays"] +git-tree-sha1 = "b8a399e95663485820000f26b6a43c794e166a49" +uuid = "fb686558-2515-59ef-acaa-46db3789a887" +version = "0.4.4" + +[[deps.Ratios]] +deps = ["Requires"] +git-tree-sha1 = "1342a47bf3260ee108163042310d26f2be5ec90b" +uuid = "c84ed2f1-dad5-54f0-aa8e-dbefe2724439" +version = "0.4.5" +weakdeps = ["FixedPointNumbers"] + + [deps.Ratios.extensions] + RatiosFixedPointNumbersExt = "FixedPointNumbers" + +[[deps.RecipesBase]] +deps = ["PrecompileTools"] +git-tree-sha1 = "5c3d09cc4f31f5fc6af001c250bf1278733100ff" +uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" +version = "1.3.4" + +[[deps.RecipesPipeline]] +deps = ["Dates", "NaNMath", "PlotUtils", "PrecompileTools", "RecipesBase"] +git-tree-sha1 = "45cf9fd0ca5839d06ef333c8201714e888486342" +uuid = "01d81517-befc-4cb6-b9ec-a95719d0359c" +version = "0.6.12" + +[[deps.RecursiveArrayTools]] +deps = ["Adapt", "ArrayInterface", "DocStringExtensions", "GPUArraysCore", "IteratorInterfaceExtensions", "LinearAlgebra", "RecipesBase", "Requires", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables"] +git-tree-sha1 = "d7087c013e8a496ff396bae843b1e16d9a30ede8" +uuid = "731186ca-8d62-57ce-b412-fbd966d074cd" +version = "2.38.10" + + [deps.RecursiveArrayTools.extensions] + RecursiveArrayToolsMeasurementsExt = "Measurements" + RecursiveArrayToolsMonteCarloMeasurementsExt = "MonteCarloMeasurements" + RecursiveArrayToolsTrackerExt = "Tracker" + RecursiveArrayToolsZygoteExt = "Zygote" + + [deps.RecursiveArrayTools.weakdeps] + Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7" + MonteCarloMeasurements = "0987c9cc-fe09-11e8-30f0-b96dd679fdca" + Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" + Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" + +[[deps.RecursiveFactorization]] +deps = ["LinearAlgebra", "LoopVectorization", "Polyester", "PrecompileTools", "StrideArraysCore", "TriangularSolve"] +git-tree-sha1 = "8bc86c78c7d8e2a5fe559e3721c0f9c9e303b2ed" +uuid = "f2c3362d-daeb-58d1-803e-2bc74f2840b4" +version = "0.2.21" + +[[deps.Reexport]] +git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b" +uuid = "189a3867-3050-52da-a836-e630ba90ab69" +version = "1.2.2" + +[[deps.RegistryInstances]] +deps = ["LazilyInitializedFields", "Pkg", "TOML", "Tar"] +git-tree-sha1 = "ffd19052caf598b8653b99404058fce14828be51" +uuid = "2792f1a3-b283-48e8-9a74-f99dce5104f3" +version = "0.1.0" + +[[deps.RelocatableFolders]] +deps = ["SHA", "Scratch"] +git-tree-sha1 = "ffdaf70d81cf6ff22c2b6e733c900c3321cab864" +uuid = "05181044-ff0b-4ac5-8273-598c1e38db00" +version = "1.0.1" + +[[deps.Requires]] +deps = ["UUIDs"] +git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7" +uuid = "ae029012-a4dd-5104-9daa-d747884805df" +version = "1.3.0" + +[[deps.Rmath]] +deps = ["Random", "Rmath_jll"] +git-tree-sha1 = "f65dcb5fa46aee0cf9ed6274ccbd597adc49aa7b" +uuid = "79098fc4-a85e-5d69-aa6a-4863f24498fa" +version = "0.7.1" + +[[deps.Rmath_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "6ed52fdd3382cf21947b15e8870ac0ddbff736da" +uuid = "f50d1b31-88e8-58de-be2c-1cc44531875f" +version = "0.4.0+0" + +[[deps.RuntimeGeneratedFunctions]] +deps = ["ExprTools", "SHA", "Serialization"] +git-tree-sha1 = "6aacc5eefe8415f47b3e34214c1d79d2674a0ba2" +uuid = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47" +version = "0.5.12" + +[[deps.SHA]] +uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" +version = "0.7.0" + +[[deps.SIMD]] +deps = ["PrecompileTools"] +git-tree-sha1 = "d8911cc125da009051fb35322415641d02d9e37f" +uuid = "fdea26ae-647d-5447-a871-4b548cad5224" +version = "3.4.6" + +[[deps.SIMDTypes]] +git-tree-sha1 = "330289636fb8107c5f32088d2741e9fd7a061a5c" +uuid = "94e857df-77ce-4151-89e5-788b33177be4" +version = "0.1.0" + +[[deps.SLEEFPirates]] +deps = ["IfElse", "Static", "VectorizationBase"] +git-tree-sha1 = "3aac6d68c5e57449f5b9b865c9ba50ac2970c4cf" +uuid = "476501e8-09a2-5ece-8869-fb82de89a1fa" +version = "0.6.42" + +[[deps.Sass]] +deps = ["libsass_jll"] +git-tree-sha1 = "aa841c3738cec78b5dbccd56dda332710f35f6a5" +uuid = "322a6be2-4ae8-5d68-aaf1-3e960788d1d9" +version = "0.2.0" + +[[deps.SciMLBase]] +deps = ["ADTypes", "ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "FillArrays", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "PrecompileTools", "Preferences", "Printf", "QuasiMonteCarlo", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables", "TruncatedStacktraces"] +git-tree-sha1 = "164773badb9ee8c62af2ff1a7778fd4867142a07" +uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" +version = "2.9.0" + + [deps.SciMLBase.extensions] + SciMLBaseChainRulesCoreExt = "ChainRulesCore" + SciMLBasePartialFunctionsExt = "PartialFunctions" + SciMLBasePyCallExt = "PyCall" + SciMLBasePythonCallExt = "PythonCall" + SciMLBaseRCallExt = "RCall" + SciMLBaseZygoteExt = "Zygote" + + [deps.SciMLBase.weakdeps] + ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2" + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + PartialFunctions = "570af359-4316-4cb7-8c74-252c00c2016b" + PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0" + PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d" + RCall = "6f49c342-dc21-5d91-9882-a32aef131414" + Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" + +[[deps.SciMLOperators]] +deps = ["ArrayInterface", "DocStringExtensions", "Lazy", "LinearAlgebra", "Setfield", "SparseArrays", "StaticArraysCore", "Tricks"] +git-tree-sha1 = "51ae235ff058a64815e0a2c34b1db7578a06813d" +uuid = "c0aeaf25-5076-4817-a8d5-81caf7dfa961" +version = "0.3.7" + +[[deps.Scratch]] +deps = ["Dates"] +git-tree-sha1 = "3bac05bc7e74a75fd9cba4295cde4045d9fe2386" +uuid = "6c6a2e73-6563-6170-7368-637461726353" +version = "1.2.1" + +[[deps.SentinelArrays]] +deps = ["Dates", "Random"] +git-tree-sha1 = "0e7508ff27ba32f26cd459474ca2ede1bc10991f" +uuid = "91c51154-3ec4-41a3-a24f-3f23e20d615c" +version = "1.4.1" + +[[deps.Serialization]] +uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" + +[[deps.Setfield]] +deps = ["ConstructionBase", "Future", "MacroTools", "StaticArraysCore"] +git-tree-sha1 = "e2cc6d8c88613c05e1defb55170bf5ff211fbeac" +uuid = "efcf1570-3423-57d1-acb7-fd33fddbac46" +version = "1.1.1" + +[[deps.SharedArrays]] +deps = ["Distributed", "Mmap", "Random", "Serialization"] +uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383" + +[[deps.Showoff]] +deps = ["Dates", "Grisu"] +git-tree-sha1 = "91eddf657aca81df9ae6ceb20b959ae5653ad1de" +uuid = "992d4aef-0814-514b-bc4d-f2e9a6c4116f" +version = "1.0.3" + +[[deps.SimpleBufferStream]] +git-tree-sha1 = "874e8867b33a00e784c8a7e4b60afe9e037b74e1" +uuid = "777ac1f9-54b0-4bf8-805c-2214025038e7" +version = "1.1.0" + +[[deps.SimpleUnPack]] +git-tree-sha1 = "58e6353e72cde29b90a69527e56df1b5c3d8c437" +uuid = "ce78b400-467f-4804-87d8-8f486da07d0a" +version = "1.1.0" + +[[deps.SnoopPrecompile]] +deps = ["Preferences"] +git-tree-sha1 = "e760a70afdcd461cf01a575947738d359234665c" +uuid = "66db9d55-30c0-4569-8b51-7e840670fc0c" +version = "1.0.3" + +[[deps.Sobol]] +deps = ["DelimitedFiles", "Random"] +git-tree-sha1 = "5a74ac22a9daef23705f010f72c81d6925b19df8" +uuid = "ed01d8cd-4d21-5b2a-85b4-cc3bdc58bad4" +version = "1.5.0" + +[[deps.Sockets]] +uuid = "6462fe0b-24de-5631-8697-dd941f90decc" + +[[deps.SolverCore]] +deps = ["LinearAlgebra", "NLPModels", "Printf"] +git-tree-sha1 = "9fb0712d597d6598857ae50b7744df17b1137b38" +uuid = "ff4d7338-4cf1-434d-91df-b86cb86fb843" +version = "0.3.7" + +[[deps.SortingAlgorithms]] +deps = ["DataStructures"] +git-tree-sha1 = "5165dfb9fd131cf0c6957a3a7605dede376e7b63" +uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c" +version = "1.2.0" + +[[deps.SparseArrays]] +deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] +uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" +version = "1.10.0" + +[[deps.SpecialFunctions]] +deps = ["IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] +git-tree-sha1 = "e2cfc4012a19088254b3950b85c3c1d8882d864d" +uuid = "276daf66-3868-5448-9aa4-cd146d93841b" +version = "2.3.1" +weakdeps = ["ChainRulesCore"] + + [deps.SpecialFunctions.extensions] + SpecialFunctionsChainRulesCoreExt = "ChainRulesCore" + +[[deps.SpeedMapping]] +deps = ["AccurateArithmetic", "BenchmarkTools", "Coverage", "DocumenterTools", "ForwardDiff", "LinearAlgebra", "MuladdMacro", "SparseArrays"] +git-tree-sha1 = "f90e5469bcdb5d8c0c367b2bf7db0807fe670691" +uuid = "f1835b91-879b-4a3f-a438-e4baacf14412" +version = "0.3.0" + +[[deps.Static]] +deps = ["IfElse"] +git-tree-sha1 = "f295e0a1da4ca425659c57441bcb59abb035a4bc" +uuid = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" +version = "0.8.8" + +[[deps.StaticArrayInterface]] +deps = ["ArrayInterface", "Compat", "IfElse", "LinearAlgebra", "PrecompileTools", "Requires", "SparseArrays", "Static", "SuiteSparse"] +git-tree-sha1 = "03fec6800a986d191f64f5c0996b59ed526eda25" +uuid = "0d7ed370-da01-4f52-bd93-41d350b8b718" +version = "1.4.1" +weakdeps = ["OffsetArrays", "StaticArrays"] + + [deps.StaticArrayInterface.extensions] + StaticArrayInterfaceOffsetArraysExt = "OffsetArrays" + StaticArrayInterfaceStaticArraysExt = "StaticArrays" + +[[deps.StaticArrays]] +deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore"] +git-tree-sha1 = "5ef59aea6f18c25168842bded46b16662141ab87" +uuid = "90137ffa-7385-5640-81b9-e52037218182" +version = "1.7.0" +weakdeps = ["Statistics"] + + [deps.StaticArrays.extensions] + StaticArraysStatisticsExt = "Statistics" + +[[deps.StaticArraysCore]] +git-tree-sha1 = "36b3d696ce6366023a0ea192b4cd442268995a0d" +uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" +version = "1.4.2" + +[[deps.Statistics]] +deps = ["LinearAlgebra", "SparseArrays"] +uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" +version = "1.10.0" + +[[deps.StatsAPI]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "1ff449ad350c9c4cbc756624d6f8a8c3ef56d3ed" +uuid = "82ae8749-77ed-4fe6-ae5f-f523153014b0" +version = "1.7.0" + +[[deps.StatsBase]] +deps = ["DataAPI", "DataStructures", "LinearAlgebra", "LogExpFunctions", "Missings", "Printf", "Random", "SortingAlgorithms", "SparseArrays", "Statistics", "StatsAPI"] +git-tree-sha1 = "1d77abd07f617c4868c33d4f5b9e1dbb2643c9cf" +uuid = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" +version = "0.34.2" + +[[deps.StatsFuns]] +deps = ["HypergeometricFunctions", "IrrationalConstants", "LogExpFunctions", "Reexport", "Rmath", "SpecialFunctions"] +git-tree-sha1 = "f625d686d5a88bcd2b15cd81f18f98186fdc0c9a" +uuid = "4c63d2b9-4356-54db-8cca-17b64c39e42c" +version = "1.3.0" +weakdeps = ["ChainRulesCore", "InverseFunctions"] + + [deps.StatsFuns.extensions] + StatsFunsChainRulesCoreExt = "ChainRulesCore" + StatsFunsInverseFunctionsExt = "InverseFunctions" + +[[deps.StatsPlots]] +deps = ["AbstractFFTs", "Clustering", "DataStructures", "Distributions", "Interpolations", "KernelDensity", "LinearAlgebra", "MultivariateStats", "NaNMath", "Observables", "Plots", "RecipesBase", "RecipesPipeline", "Reexport", "StatsBase", "TableOperations", "Tables", "Widgets"] +git-tree-sha1 = "9115a29e6c2cf66cf213ccc17ffd61e27e743b24" +uuid = "f3b207a7-027a-5e70-b257-86293d7955fd" +version = "0.15.6" + +[[deps.StrideArraysCore]] +deps = ["ArrayInterface", "CloseOpenIntervals", "IfElse", "LayoutPointers", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface", "ThreadingUtilities"] +git-tree-sha1 = "e7dd250422df290cee14960c1ee144b44ac3dd77" +uuid = "7792a7ef-975c-4747-a70f-980b88e8d1da" +version = "0.5.1" + +[[deps.StructTypes]] +deps = ["Dates", "UUIDs"] +git-tree-sha1 = "ca4bccb03acf9faaf4137a9abc1881ed1841aa70" +uuid = "856f2bd8-1eba-4b0a-8007-ebc267875bd4" +version = "1.10.0" + +[[deps.Subscripts]] +git-tree-sha1 = "1a7e74e19e1a430e8407902fd0a384b90f8415d3" +uuid = "2b7f82d5-8785-4f63-971e-f18ddbeb808e" +version = "0.1.2" + +[[deps.SuiteSparse]] +deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"] +uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" + +[[deps.SuiteSparse_jll]] +deps = ["Artifacts", "Libdl", "Pkg", "libblastrampoline_jll"] +uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" +version = "7.2.1+1" + +[[deps.SymPyCore]] +deps = ["CommonEq", "CommonSolve", "Latexify", "LinearAlgebra", "Markdown", "RecipesBase", "SpecialFunctions"] +git-tree-sha1 = "fa24a1be876b01aca1a47beff39a9648dbca38d2" +uuid = "458b697b-88f0-4a86-b56b-78b75cfb3531" +version = "0.1.7" +weakdeps = ["SymbolicUtils"] + + [deps.SymPyCore.extensions] + SymPyCoreSymbolicUtilsExt = "SymbolicUtils" + +[[deps.SymPyPythonCall]] +deps = ["CommonEq", "CommonSolve", "CondaPkg", "LinearAlgebra", "PythonCall", "SpecialFunctions", "SymPyCore"] +git-tree-sha1 = "1005d659221ce8dcf11061c7a37788d5bbd1f80f" +uuid = "bc8888f7-b21e-4b7c-a06a-5d9c9496438c" +version = "0.2.4" +weakdeps = ["Symbolics"] + + [deps.SymPyPythonCall.extensions] + SymPyPythonCallSymbolicsExt = "Symbolics" + +[[deps.SymbolicIndexingInterface]] +deps = ["DocStringExtensions"] +git-tree-sha1 = "f8ab052bfcbdb9b48fad2c80c873aa0d0344dfe5" +uuid = "2efcf032-c050-4f8e-a9bb-153293bab1f5" +version = "0.2.2" + +[[deps.SymbolicUtils]] +deps = ["AbstractTrees", "Bijections", "ChainRulesCore", "Combinatorics", "ConstructionBase", "DataStructures", "DocStringExtensions", "DynamicPolynomials", "IfElse", "LabelledArrays", "LinearAlgebra", "MultivariatePolynomials", "NaNMath", "Setfield", "SparseArrays", "SpecialFunctions", "StaticArrays", "TimerOutputs", "Unityper"] +git-tree-sha1 = "2f3fa844bcd33e40d8c29de5ee8dded7a0a70422" +uuid = "d1185830-fcd6-423d-90d6-eec64667417b" +version = "1.4.0" + +[[deps.Symbolics]] +deps = ["ArrayInterface", "Bijections", "ConstructionBase", "DataStructures", "DiffRules", "Distributions", "DocStringExtensions", "DomainSets", "DynamicPolynomials", "Groebner", "IfElse", "LaTeXStrings", "LambertW", "Latexify", "Libdl", "LinearAlgebra", "LogExpFunctions", "MacroTools", "Markdown", "NaNMath", "PrecompileTools", "RecipesBase", "RecursiveArrayTools", "Reexport", "Requires", "RuntimeGeneratedFunctions", "SciMLBase", "Setfield", "SparseArrays", "SpecialFunctions", "StaticArrays", "SymbolicUtils", "TreeViews"] +git-tree-sha1 = "4d4e922e160827388c003a9a088a4c63f339f6c0" +uuid = "0c5d862f-8b57-4792-8d23-62f2024744c7" +version = "5.10.0" + + [deps.Symbolics.extensions] + SymbolicsSymPyExt = "SymPy" + + [deps.Symbolics.weakdeps] + SymPy = "24249f21-da20-56a4-8eb1-6a02cf4ae2e6" + +[[deps.TOML]] +deps = ["Dates"] +uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" +version = "1.0.3" + +[[deps.TableOperations]] +deps = ["SentinelArrays", "Tables", "Test"] +git-tree-sha1 = "e383c87cf2a1dc41fa30c093b2a19877c83e1bc1" +uuid = "ab02a1b2-a7df-11e8-156e-fb1833f50b87" +version = "1.2.0" + +[[deps.TableTraits]] +deps = ["IteratorInterfaceExtensions"] +git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39" +uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c" +version = "1.0.1" + +[[deps.Tables]] +deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "OrderedCollections", "TableTraits"] +git-tree-sha1 = "cb76cf677714c095e535e3501ac7954732aeea2d" +uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" +version = "1.11.1" + +[[deps.Tar]] +deps = ["ArgTools", "SHA"] +uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e" +version = "1.10.0" + +[[deps.TensorCore]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "1feb45f88d133a655e001435632f019a9a1bcdb6" +uuid = "62fd8b95-f654-4bbd-a8a5-9c27f68ccd50" +version = "0.1.1" + +[[deps.Test]] +deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] +uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[[deps.ThreadingUtilities]] +deps = ["ManualMemory"] +git-tree-sha1 = "eda08f7e9818eb53661b3deb74e3159460dfbc27" +uuid = "8290d209-cae3-49c0-8002-c8c24d57dab5" +version = "0.5.2" + +[[deps.TimerOutputs]] +deps = ["ExprTools", "Printf"] +git-tree-sha1 = "f548a9e9c490030e545f72074a41edfd0e5bcdd7" +uuid = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f" +version = "0.5.23" + +[[deps.TranscodingStreams]] +git-tree-sha1 = "1fbeaaca45801b4ba17c251dd8603ef24801dd84" +uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" +version = "0.10.2" +weakdeps = ["Random", "Test"] + + [deps.TranscodingStreams.extensions] + TestExt = ["Test", "Random"] + +[[deps.TreeViews]] +deps = ["Test"] +git-tree-sha1 = "8d0d7a3fe2f30d6a7f833a5f19f7c7a5b396eae6" +uuid = "a2a6695c-b41b-5b7d-aed9-dbfdeacea5d7" +version = "0.3.0" + +[[deps.TriangularSolve]] +deps = ["CloseOpenIntervals", "IfElse", "LayoutPointers", "LinearAlgebra", "LoopVectorization", "Polyester", "Static", "VectorizationBase"] +git-tree-sha1 = "fadebab77bf3ae041f77346dd1c290173da5a443" +uuid = "d5829a12-d9aa-46ab-831f-fb7c9ab06edf" +version = "0.1.20" + +[[deps.Tricks]] +git-tree-sha1 = "eae1bb484cd63b36999ee58be2de6c178105112f" +uuid = "410a4b4d-49e4-4fbc-ab6d-cb71b17b3775" +version = "0.1.8" + +[[deps.TruncatedStacktraces]] +deps = ["InteractiveUtils", "MacroTools", "Preferences"] +git-tree-sha1 = "ea3e54c2bdde39062abf5a9758a23735558705e1" +uuid = "781d530d-4396-4725-bb49-402e4bee1e77" +version = "1.4.0" + +[[deps.URIs]] +git-tree-sha1 = "67db6cc7b3821e19ebe75791a9dd19c9b1188f2b" +uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4" +version = "1.5.1" + +[[deps.UUIDs]] +deps = ["Random", "SHA"] +uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" + +[[deps.UnPack]] +git-tree-sha1 = "387c1f73762231e86e0c9c5443ce3b4a0a9a0c2b" +uuid = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" +version = "1.0.2" + +[[deps.Unicode]] +uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" + +[[deps.UnicodeFun]] +deps = ["REPL"] +git-tree-sha1 = "53915e50200959667e78a92a418594b428dffddf" +uuid = "1cfade01-22cf-5700-b092-accc4b62d6e1" +version = "0.4.1" + +[[deps.Unitful]] +deps = ["Dates", "LinearAlgebra", "Random"] +git-tree-sha1 = "242982d62ff0d1671e9029b52743062739255c7e" +uuid = "1986cc42-f94f-5a68-af5c-568840ba703d" +version = "1.18.0" +weakdeps = ["ConstructionBase", "InverseFunctions"] + + [deps.Unitful.extensions] + ConstructionBaseUnitfulExt = "ConstructionBase" + InverseFunctionsUnitfulExt = "InverseFunctions" + +[[deps.UnitfulLatexify]] +deps = ["LaTeXStrings", "Latexify", "Unitful"] +git-tree-sha1 = "e2d817cc500e960fdbafcf988ac8436ba3208bfd" +uuid = "45397f5d-5981-4c77-b2b3-fc36d6e9b728" +version = "1.6.3" + +[[deps.Unityper]] +deps = ["ConstructionBase"] +git-tree-sha1 = "21c8fc7cd598ef49f11bc9e94871f5d7740e34b9" +uuid = "a7c27f48-0311-42f6-a7f8-2c11e75eb415" +version = "0.1.5" + +[[deps.UnsafePointers]] +git-tree-sha1 = "c81331b3b2e60a982be57c046ec91f599ede674a" +uuid = "e17b2a0c-0bdf-430a-bd0c-3a23cae4ff39" +version = "1.0.0" + +[[deps.Unzip]] +git-tree-sha1 = "ca0969166a028236229f63514992fc073799bb78" +uuid = "41fe7b60-77ed-43a1-b4f0-825fd5a5650d" +version = "0.2.0" + +[[deps.VectorizationBase]] +deps = ["ArrayInterface", "CPUSummary", "HostCPUFeatures", "IfElse", "LayoutPointers", "Libdl", "LinearAlgebra", "SIMDTypes", "Static", "StaticArrayInterface"] +git-tree-sha1 = "b182207d4af54ac64cbc71797765068fdeff475d" +uuid = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f" +version = "0.21.64" + +[[deps.Vulkan_Loader_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Wayland_jll", "Xorg_libX11_jll", "Xorg_libXrandr_jll", "xkbcommon_jll"] +git-tree-sha1 = "2f0486047a07670caad3a81a075d2e518acc5c59" +uuid = "a44049a8-05dd-5a78-86c9-5fde0876e88c" +version = "1.3.243+0" + +[[deps.Wayland_jll]] +deps = ["Artifacts", "EpollShim_jll", "Expat_jll", "JLLWrappers", "Libdl", "Libffi_jll", "Pkg", "XML2_jll"] +git-tree-sha1 = "7558e29847e99bc3f04d6569e82d0f5c54460703" +uuid = "a2964d1f-97da-50d4-b82a-358c7fce9d89" +version = "1.21.0+1" + +[[deps.Wayland_protocols_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "4528479aa01ee1b3b4cd0e6faef0e04cf16466da" +uuid = "2381bf8a-dfd0-557d-9999-79630e7b1b91" +version = "1.25.0+0" + +[[deps.Widgets]] +deps = ["Colors", "Dates", "Observables", "OrderedCollections"] +git-tree-sha1 = "fcdae142c1cfc7d89de2d11e08721d0f2f86c98a" +uuid = "cc8bc4a8-27d6-5769-a93b-9d913e69aa62" +version = "0.6.6" + +[[deps.WoodburyMatrices]] +deps = ["LinearAlgebra", "SparseArrays"] +git-tree-sha1 = "5f24e158cf4cee437052371455fe361f526da062" +uuid = "efce3f68-66dc-5838-9240-27a6d6f5f9b6" +version = "0.5.6" + +[[deps.XML2_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Zlib_jll"] +git-tree-sha1 = "da69178aacc095066bad1f69d2f59a60a1dd8ad1" +uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a" +version = "2.12.0+0" + +[[deps.XSLT_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgcrypt_jll", "Libgpg_error_jll", "Libiconv_jll", "Pkg", "XML2_jll", "Zlib_jll"] +git-tree-sha1 = "91844873c4085240b95e795f692c4cec4d805f8a" +uuid = "aed1982a-8fda-507f-9586-7b0439959a61" +version = "1.1.34+0" + +[[deps.XZ_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "522b8414d40c4cbbab8dee346ac3a09f9768f25d" +uuid = "ffd25f8a-64ca-5728-b0f7-c24cf3aae800" +version = "5.4.5+0" + +[[deps.Xorg_libICE_jll]] +deps = ["Libdl", "Pkg"] +git-tree-sha1 = "e5becd4411063bdcac16be8b66fc2f9f6f1e8fe5" +uuid = "f67eecfb-183a-506d-b269-f58e52b52d7c" +version = "1.0.10+1" + +[[deps.Xorg_libSM_jll]] +deps = ["Libdl", "Pkg", "Xorg_libICE_jll"] +git-tree-sha1 = "4a9d9e4c180e1e8119b5ffc224a7b59d3a7f7e18" +uuid = "c834827a-8449-5923-a945-d239c165b7dd" +version = "1.2.3+0" + +[[deps.Xorg_libX11_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_libxcb_jll", "Xorg_xtrans_jll"] +git-tree-sha1 = "afead5aba5aa507ad5a3bf01f58f82c8d1403495" +uuid = "4f6342f7-b3d2-589e-9d20-edeb45f2b2bc" +version = "1.8.6+0" + +[[deps.Xorg_libXau_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "6035850dcc70518ca32f012e46015b9beeda49d8" +uuid = "0c0b7dd1-d40b-584c-a123-a41640f87eec" +version = "1.0.11+0" + +[[deps.Xorg_libXcursor_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXfixes_jll", "Xorg_libXrender_jll"] +git-tree-sha1 = "12e0eb3bc634fa2080c1c37fccf56f7c22989afd" +uuid = "935fb764-8cf2-53bf-bb30-45bb1f8bf724" +version = "1.2.0+4" + +[[deps.Xorg_libXdmcp_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "34d526d318358a859d7de23da945578e8e8727b7" +uuid = "a3789734-cfe1-5b06-b2d0-1dd0d9d62d05" +version = "1.1.4+0" + +[[deps.Xorg_libXext_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] +git-tree-sha1 = "b7c0aa8c376b31e4852b360222848637f481f8c3" +uuid = "1082639a-0dae-5f34-9b06-72781eeb8cb3" +version = "1.3.4+4" + +[[deps.Xorg_libXfixes_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] +git-tree-sha1 = "0e0dc7431e7a0587559f9294aeec269471c991a4" +uuid = "d091e8ba-531a-589c-9de9-94069b037ed8" +version = "5.0.3+4" + +[[deps.Xorg_libXi_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll", "Xorg_libXfixes_jll"] +git-tree-sha1 = "89b52bc2160aadc84d707093930ef0bffa641246" +uuid = "a51aa0fd-4e3c-5386-b890-e753decda492" +version = "1.7.10+4" + +[[deps.Xorg_libXinerama_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll"] +git-tree-sha1 = "26be8b1c342929259317d8b9f7b53bf2bb73b123" +uuid = "d1454406-59df-5ea1-beac-c340f2130bc3" +version = "1.1.4+4" + +[[deps.Xorg_libXrandr_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libXext_jll", "Xorg_libXrender_jll"] +git-tree-sha1 = "34cea83cb726fb58f325887bf0612c6b3fb17631" +uuid = "ec84b674-ba8e-5d96-8ba1-2a689ba10484" +version = "1.5.2+4" + +[[deps.Xorg_libXrender_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libX11_jll"] +git-tree-sha1 = "19560f30fd49f4d4efbe7002a1037f8c43d43b96" +uuid = "ea2f1a96-1ddc-540d-b46f-429655e07cfa" +version = "0.9.10+4" + +[[deps.Xorg_libpthread_stubs_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "8fdda4c692503d44d04a0603d9ac0982054635f9" +uuid = "14d82f49-176c-5ed1-bb49-ad3f5cbd8c74" +version = "0.1.1+0" + +[[deps.Xorg_libxcb_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "XSLT_jll", "Xorg_libXau_jll", "Xorg_libXdmcp_jll", "Xorg_libpthread_stubs_jll"] +git-tree-sha1 = "b4bfde5d5b652e22b9c790ad00af08b6d042b97d" +uuid = "c7cfdc94-dc32-55de-ac96-5a1b8d977c5b" +version = "1.15.0+0" + +[[deps.Xorg_libxkbfile_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_libX11_jll"] +git-tree-sha1 = "730eeca102434283c50ccf7d1ecdadf521a765a4" +uuid = "cc61e674-0454-545c-8b26-ed2c68acab7a" +version = "1.1.2+0" + +[[deps.Xorg_xcb_util_cursor_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_xcb_util_image_jll", "Xorg_xcb_util_jll", "Xorg_xcb_util_renderutil_jll"] +git-tree-sha1 = "04341cb870f29dcd5e39055f895c39d016e18ccd" +uuid = "e920d4aa-a673-5f3a-b3d7-f755a4d47c43" +version = "0.1.4+0" + +[[deps.Xorg_xcb_util_image_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] +git-tree-sha1 = "0fab0a40349ba1cba2c1da699243396ff8e94b97" +uuid = "12413925-8142-5f55-bb0e-6d7ca50bb09b" +version = "0.4.0+1" + +[[deps.Xorg_xcb_util_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_libxcb_jll"] +git-tree-sha1 = "e7fd7b2881fa2eaa72717420894d3938177862d1" +uuid = "2def613f-5ad1-5310-b15b-b15d46f528f5" +version = "0.4.0+1" + +[[deps.Xorg_xcb_util_keysyms_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] +git-tree-sha1 = "d1151e2c45a544f32441a567d1690e701ec89b00" +uuid = "975044d2-76e6-5fbe-bf08-97ce7c6574c7" +version = "0.4.0+1" + +[[deps.Xorg_xcb_util_renderutil_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] +git-tree-sha1 = "dfd7a8f38d4613b6a575253b3174dd991ca6183e" +uuid = "0d47668e-0667-5a69-a72c-f761630bfb7e" +version = "0.3.9+1" + +[[deps.Xorg_xcb_util_wm_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Xorg_xcb_util_jll"] +git-tree-sha1 = "e78d10aab01a4a154142c5006ed44fd9e8e31b67" +uuid = "c22f9ab0-d5fe-5066-847c-f4bb1cd4e361" +version = "0.4.1+1" + +[[deps.Xorg_xkbcomp_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_libxkbfile_jll"] +git-tree-sha1 = "330f955bc41bb8f5270a369c473fc4a5a4e4d3cb" +uuid = "35661453-b289-5fab-8a00-3d9160c6a3a4" +version = "1.4.6+0" + +[[deps.Xorg_xkeyboard_config_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Xorg_xkbcomp_jll"] +git-tree-sha1 = "691634e5453ad362044e2ad653e79f3ee3bb98c3" +uuid = "33bec58e-1273-512f-9401-5d533626f822" +version = "2.39.0+0" + +[[deps.Xorg_xtrans_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "e92a1a012a10506618f10b7047e478403a046c77" +uuid = "c5fb5394-a638-5e4d-96e5-b29de1b5cf10" +version = "1.5.0+0" + +[[deps.Zlib_jll]] +deps = ["Libdl"] +uuid = "83775a58-1f1d-513f-b197-d71354ab007a" +version = "1.2.13+1" + +[[deps.Zstd_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "49ce682769cd5de6c72dcf1b94ed7790cd08974c" +uuid = "3161d3a3-bdf6-5164-811a-617609db77b4" +version = "1.5.5+0" + +[[deps.eudev_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "gperf_jll"] +git-tree-sha1 = "431b678a28ebb559d224c0b6b6d01afce87c51ba" +uuid = "35ca27e7-8b34-5b7f-bca9-bdc33f59eb06" +version = "3.2.9+0" + +[[deps.fzf_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "47cf33e62e138b920039e8ff9f9841aafe1b733e" +uuid = "214eeab7-80f7-51ab-84ad-2988db7cef09" +version = "0.35.1+0" + +[[deps.gperf_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "3516a5630f741c9eecb3720b1ec9d8edc3ecc033" +uuid = "1a1c6b14-54f6-533d-8383-74cd7377aa70" +version = "3.1.1+0" + +[[deps.libaom_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "3a2ea60308f0996d26f1e5354e10c24e9ef905d4" +uuid = "a4ae2306-e953-59d6-aa16-d00cac43593b" +version = "3.4.0+0" + +[[deps.libass_jll]] +deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "HarfBuzz_jll", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] +git-tree-sha1 = "5982a94fcba20f02f42ace44b9894ee2b140fe47" +uuid = "0ac62f75-1d6f-5e53-bd7c-93b484bb37c0" +version = "0.15.1+0" + +[[deps.libblastrampoline_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" +version = "5.8.0+1" + +[[deps.libevdev_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "141fe65dc3efabb0b1d5ba74e91f6ad26f84cc22" +uuid = "2db6ffa8-e38f-5e21-84af-90c45d0032cc" +version = "1.11.0+0" + +[[deps.libfdk_aac_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "daacc84a041563f965be61859a36e17c4e4fcd55" +uuid = "f638f0a6-7fb0-5443-88ba-1cc74229b280" +version = "2.0.2+0" + +[[deps.libinput_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "eudev_jll", "libevdev_jll", "mtdev_jll"] +git-tree-sha1 = "ad50e5b90f222cfe78aa3d5183a20a12de1322ce" +uuid = "36db933b-70db-51c0-b978-0f229ee0e533" +version = "1.18.0+0" + +[[deps.libpng_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Zlib_jll"] +git-tree-sha1 = "94d180a6d2b5e55e447e2d27a29ed04fe79eb30c" +uuid = "b53b4c65-9356-5827-b1ea-8c7a1a84506f" +version = "1.6.38+0" + +[[deps.libsass_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "941afb93587dcec07f89e511057f5efc0bec6f0d" +uuid = "47bcb7c8-5119-555a-9eeb-0afcc36cd728" +version = "3.6.4+0" + +[[deps.libvorbis_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Ogg_jll", "Pkg"] +git-tree-sha1 = "b910cb81ef3fe6e78bf6acee440bda86fd6ae00c" +uuid = "f27f6e37-5d2b-51aa-960f-b287f2bc3b7a" +version = "1.3.7+1" + +[[deps.micromamba_jll]] +deps = ["Artifacts", "JLLWrappers", "LazyArtifacts", "Libdl"] +git-tree-sha1 = "66d07957bcf7e4930d933195aed484078dd8cbb5" +uuid = "f8abcde7-e9b7-5caa-b8af-a437887ae8e4" +version = "1.4.9+0" + +[[deps.mtdev_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "814e154bdb7be91d78b6802843f76b6ece642f11" +uuid = "009596ad-96f7-51b1-9f1b-5ce2d5e8a71e" +version = "1.1.6+0" + +[[deps.nghttp2_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d" +version = "1.52.0+1" + +[[deps.p7zip_jll]] +deps = ["Artifacts", "Libdl"] +uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0" +version = "17.4.0+2" + +[[deps.x264_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "4fea590b89e6ec504593146bf8b988b2c00922b2" +uuid = "1270edf5-f2f9-52d2-97e9-ab00b5d0237a" +version = "2021.5.5+0" + +[[deps.x265_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] +git-tree-sha1 = "ee567a171cce03570d77ad3a43e90218e38937a9" +uuid = "dfaa095f-4041-5dcd-9319-2fabd8486b76" +version = "3.5.0+0" + +[[deps.xkbcommon_jll]] +deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "Wayland_jll", "Wayland_protocols_jll", "Xorg_libxcb_jll", "Xorg_xkeyboard_config_jll"] +git-tree-sha1 = "9c304562909ab2bab0262639bd4f444d7bc2be37" +uuid = "d8fb68d0-12a3-5cfd-a85a-d49703b185fd" +version = "1.4.1+1" +""" + +# ╔═╡ Cell order: +# ╟─8fc6e932-6d22-46c3-8ad6-b26684c38fa1 +# ╠═1989ec7e-8d47-11ee-13a7-87c968f56766 +# ╠═97ff64bd-961f-43c3-b46d-f3b17e1aabd2 +# ╠═d450c895-1433-4fcc-9905-1c18879e49ec +# ╠═ea44d30c-2591-43b5-9cbf-ee301bb14020 +# ╟─1c646fb3-8f43-440f-834e-9c4e239bd5ad +# ╠═2bdbbaf9-03dd-4492-abf4-ff7aca63e19e +# ╠═f5983385-9164-4509-bc44-ab3043d379cf +# ╟─d61dd34b-7765-4cac-b610-4e7e1031a9e8 +# ╠═534226bf-cfef-4fd0-b40a-f9a3db201e64 +# ╟─c365b37a-bef3-4a0d-96aa-3af2db6180ca +# ╠═dc224752-f3e2-489a-992d-101925299105 +# ╟─4199411e-38ef-4f8e-95ff-8d10cb0a909f +# ╠═92c019c2-8540-431c-9972-93a6be2fdd38 +# ╟─42a61485-e3ba-4a37-8c50-18381c2dbd95 +# ╠═c2f25861-5fff-47d1-bf4b-5671d61c0f45 +# ╟─1508faa7-3e2e-4f3a-90e1-6616b1544610 +# ╠═1a4c7a8a-2f33-4958-a719-439848fbfdfe +# ╟─ac41c574-c53e-4127-918b-5be4040cc601 +# ╠═383372a0-dc81-4343-bff8-74fe688e96e1 +# ╠═180918d3-ebc8-4200-8a21-a9b926797368 +# ╟─d51f5759-ee26-4d1a-a455-6f2f523e7f1b +# ╠═ad88b4bf-c614-4e0e-a6b2-dc485a7fe3b1 +# ╟─5c17241c-0a5e-44ab-a71b-b77d0ad63e11 +# ╠═d3db2e0a-bea3-4314-82a7-9267aabed3de +# ╟─7259ca28-58b7-4447-8e33-1a1d1bcecafd +# ╠═47901235-dc5d-45a2-908a-b1c00648727c +# ╠═f13e7256-b624-41ee-bf4d-aa912875c949 +# ╠═c0f45cf7-0a8e-42e8-8050-41861da51baf +# ╟─7e802bf1-e543-4f57-83ab-ad7f0e6655dc +# ╠═f9bc2196-7075-4334-981d-cb0d197a3292 +# ╠═5718c81a-0fa2-49d6-94c3-8e8227daad12 +# ╠═45fdbb11-893a-4051-b8b0-257c45c16cdc +# ╠═8dd7cfbd-cb54-4de3-a5b6-2b39960e55ef +# ╠═1477de09-4e50-4339-a624-7c4e84b42b53 +# ╠═25ba4aab-5195-4e74-be10-b498194498d1 +# ╠═290651f9-2315-4a3d-aa92-a115bea6b25a +# ╟─78402155-bcbd-47b3-9dc3-47a8a4f494ff +# ╠═9422fe5b-8912-418f-941f-3fb8c51e62c0 +# ╟─1ff50a53-9a6e-4dc6-9979-3d8b859e3152 +# ╟─74b8daa2-b731-4217-ba9f-84b3f95e0693 +# ╠═6df7f697-a6dc-45ac-aa6a-b453572bda8d +# ╟─1c84bf1d-01ee-4653-841e-df8a7ad67615 +# ╟─c867d3bc-cef7-478c-815b-d8877c3ab49a +# ╠═afbf827a-01ae-4c46-86d9-5f75abf97bde +# ╠═2e16b9fd-67ca-4b0e-912f-e0e296b5b0b0 +# ╟─38a6a4c3-2c22-4326-9fd7-0f9bdb5962f0 +# ╠═0b941d86-bc37-49b2-95d5-7cad0b8d7902 +# ╠═e14b5d73-69d5-47dc-a540-5daef9e00211 +# ╟─7db069fb-d14a-4293-a761-f876f5eb33c2 +# ╠═da83e580-15c2-43dd-962e-6269cbc36796 +# ╠═b77e6ae0-ace5-4a3c-b4a2-8d2f3bff7a04 +# ╠═12ce5865-1e12-45be-84bb-7fe016f17397 +# ╟─73362a28-37ad-43fb-a257-348fa29fba77 +# ╠═0df34990-2cbb-421d-b28b-9de3c6b7289c +# ╟─9fceddc8-c0ab-475c-a6db-f75ab935788e +# ╠═67002428-4110-4d2c-9c7a-a9d7380ab810 +# ╠═0ea8167b-0bec-4a1a-8d57-ebea2f84d154 +# ╠═2d1ba40e-29ca-4383-898a-24c58d0b9507 +# ╠═0dac68c2-878f-4cc4-a1dc-567c1cbb097c +# ╠═9ab2da58-7e9c-4bcd-91ed-248fb13a3f04 +# ╠═ca75e3c5-f47e-409e-ad82-d17a89d15957 +# ╟─2b7f586f-c502-4aa0-891f-db44bba58f37 +# ╠═dd09252b-b25e-4bbe-993e-16f022bd1b7a +# ╟─db7990ab-3c16-4ab4-8120-9cb8f5da0e63 +# ╟─729dfccc-1d4e-467e-8674-20bef581dd8e +# ╠═dcfde53e-0579-4cbe-ba57-90c67f73ac93 +# ╠═bdc4a3bb-2873-4904-8211-82b4ef0af094 +# ╠═4cbce23f-32b5-4df3-a183-f296c8e693e1 +# ╟─7444738c-7afd-4162-8b6b-7a65e1d5daf2 +# ╠═271b2da3-d268-4d7b-81a3-606af4bf4cbe +# ╟─6874f079-be63-4f9a-bbc5-67ca2c41671b +# ╠═ada42dd0-a210-45a9-850b-46c721dd8ae6 +# ╟─1497fafd-a303-4c0a-a90a-1b78838644f7 +# ╠═ec2f323a-6df4-4fdb-92e5-78beba0f7354 +# ╟─4596f77c-60bd-48cc-8732-ef6e58d951d9 +# ╟─00000000-0000-0000-0000-000000000001 +# ╟─00000000-0000-0000-0000-000000000002 From 95b82f14ae3f8f828f9bd691669517d067fff6dd Mon Sep 17 00:00:00 2001 From: Thore Kockerols Date: Mon, 8 Jan 2024 15:18:55 +0100 Subject: [PATCH 07/34] fix precompile --- src/MacroModelling.jl | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/MacroModelling.jl b/src/MacroModelling.jl index d09098fc..71f4e07c 100644 --- a/src/MacroModelling.jl +++ b/src/MacroModelling.jl @@ -6801,30 +6801,7 @@ function filter_and_smooth(𝓂::ℳ, data_in_deviations::AbstractArray{Float64} end -if VERSION >= v"1.9" - @setup_workload begin - # Putting some things in `setup` can reduce the size of the - # precompile file and potentially make loading faster. - @model FS2000 precompile = true begin - dA[0] = exp(gam + z_e_a * e_a[x]) - log(m[0]) = (1 - rho) * log(mst) + rho * log(m[-1]) + z_e_m * e_m[x] - - P[0] / (c[1] * P[1] * m[0]) + bet * P[1] * (alp * exp( - alp * (gam + log(e[1]))) * k[0] ^ (alp - 1) * n[1] ^ (1 - alp) + (1 - del) * exp( - (gam + log(e[1])))) / (c[2] * P[2] * m[1])=0 - W[0] = l[0] / n[0] - - (psi / (1 - psi)) * (c[0] * P[0] / (1 - n[0])) + l[0] / n[0] = 0 - R[0] = P[0] * (1 - alp) * exp( - alp * (gam + z_e_a * e_a[x])) * k[-1] ^ alp * n[0] ^ ( - alp) / W[0] - 1 / (c[0] * P[0]) - bet * P[0] * (1 - alp) * exp( - alp * (gam + z_e_a * e_a[x])) * k[-1] ^ alp * n[0] ^ (1 - alp) / (m[0] * l[0] * c[1] * P[1]) = 0 - c[0] + k[0] = exp( - alp * (gam + z_e_a * e_a[x])) * k[-1] ^ alp * n[0] ^ (1 - alp) + (1 - del) * exp( - (gam + z_e_a * e_a[x])) * k[-1] - P[0] * c[0] = m[0] - m[0] - 1 + d[0] = l[0] - e[0] = exp(z_e_a * e_a[x]) - y[0] = k[-1] ^ alp * n[0] ^ (1 - alp) * exp( - alp * (gam + z_e_a * e_a[x])) - gy_obs[0] = dA[0] * y[0] / y[-1] - gp_obs[0] = (P[0] / P[-1]) * m[-1] / dA[0] - log_gy_obs[0] = log(gy_obs[0]) - log_gp_obs[0] = log(gp_obs[0]) - end - - +# if VERSION >= v"1.9" # @setup_workload begin # # Putting some things in `setup` can reduce the size of the # # precompile file and potentially make loading faster. From 290c208f3c70873ba14166df58a8183689a75ea1 Mon Sep 17 00:00:00 2001 From: thorek1 Date: Mon, 8 Jan 2024 23:20:51 +0100 Subject: [PATCH 08/34] write get_eigenvalues --- src/get_functions.jl | 47 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/get_functions.jl b/src/get_functions.jl index e587abb8..3360a7f7 100644 --- a/src/get_functions.jl +++ b/src/get_functions.jl @@ -1215,6 +1215,53 @@ get_girf(args...; kwargs...) = get_irf(args...; kwargs..., generalised_irf = tr +function get_eigenvalues(𝓂::ℳ; + parameters::ParameterType = nothing, + verbose::Bool = false, + tol::AbstractFloat = eps()) + solve!(𝓂, parameters = parameters, verbose = verbose, dynamics = true) + + SS_and_pars, (solution_error, iters) = 𝓂.SS_solve_func(𝓂.parameter_values, 𝓂, verbose, false, 𝓂.solver_parameters) + + if solution_error > tol + @warn "Could not find non-stochastic steady state." + end + + ∇₁ = calculate_jacobian(𝓂.parameter_values, SS_and_pars, 𝓂) |> Matrix + + T = 𝓂.timings + + ∇₊ = @view ∇₁[:,1:T.nFuture_not_past_and_mixed] + ∇₀ = @view ∇₁[:,T.nFuture_not_past_and_mixed .+ range(1, T.nVars)] + ∇₋ = @view ∇₁[:,T.nFuture_not_past_and_mixed + T.nVars .+ range(1, T.nPast_not_future_and_mixed)] + + Q = ℒ.qr(collect(∇₀[:,T.present_only_idx])) + Qinv = Q.Q' + + A₊ = Qinv * ∇₊ + A₀ = Qinv * ∇₀ + A₋ = Qinv * ∇₋ + + dynIndex = T.nPresent_only+1:T.nVars + + Ã₊ = @view A₊[dynIndex,:] + Ã₋ = @view A₋[dynIndex,:] + Ã₀₊ = @view A₀[dynIndex, T.future_not_past_and_mixed_idx] + Ã₀₋ = @views A₀[dynIndex, T.past_not_future_idx] * ℒ.diagm(ones(T.nPast_not_future_and_mixed))[T.not_mixed_in_past_idx,:] + + Z₊ = zeros(T.nMixed,T.nFuture_not_past_and_mixed) + I₊ = @view ℒ.diagm(ones(T.nFuture_not_past_and_mixed))[T.mixed_in_future_idx,:] + + Z₋ = zeros(T.nMixed,T.nPast_not_future_and_mixed) + I₋ = @view ℒ.diagm(ones(T.nPast_not_future_and_mixed))[T.mixed_in_past_idx,:] + + D = vcat(hcat(Ã₀₋, Ã₊), hcat(I₋, Z₊)) + E = vcat(hcat(-Ã₋,-Ã₀₊), hcat(Z₋, I₊)) + + eigvals = ℒ.eigen(E,D).values + + return KeyedArray(hcat(reim(eigvals)...); Eigenvalue = 1:length(eigs[1]), Parts = [:Real,:Imaginary]) +end From 3b75c5ca1903be4f5ea3e6d87896b608e9a22a36 Mon Sep 17 00:00:00 2001 From: thorek1 Date: Tue, 9 Jan 2024 10:06:14 +0100 Subject: [PATCH 09/34] fix wrappers --- src/get_functions.jl | 189 +++++++++++++++++++++++++++++++++++-------- src/plotting.jl | 35 ++++++-- 2 files changed, 186 insertions(+), 38 deletions(-) diff --git a/src/get_functions.jl b/src/get_functions.jl index 3360a7f7..de97ce81 100644 --- a/src/get_functions.jl +++ b/src/get_functions.jl @@ -1190,26 +1190,47 @@ get_IRF = get_irf # See [`get_irf`](@ref) # """ # IRF = get_irf - """ -Wrapper for [`get_irf`](@ref) with `shocks = :simulate`. Function returns values in levels by default. +Wrapper for [`get_irf`](@ref) which overrides and sets `shocks = :simulate` and sets the default `levels = true`. """ -simulate(args...; kwargs...) = get_irf(args...; levels = true, kwargs..., shocks = :simulate)#[:,:,1] +function get_simulations(args...; levels::Bool = true, kwargs...) + # Check if 'shocks' is manually set + if haskey(kwargs, :shocks) + @warn "Warning: `shocks` keyword is overridden in `plot_simulations`. Defaulting to `shocks = :simulate`." + end + + # Set 'shocks' to :simulate + kwargs = Base.merge(kwargs, Dict(:shocks => :simulate)) + + # Call plot_irf with the modified arguments + get_irf(args...; levels=levels, kwargs...) +end """ -Wrapper for [`get_irf`](@ref) with `shocks = :simulate`. Function returns values in levels by default. +Wrapper for [`get_irf`](@ref) which overrides and sets `shocks = :simulate` and sets the default `levels = true`. """ -get_simulation(args...; kwargs...) = get_irf(args...; levels = true, kwargs..., shocks = :simulate)#[:,:,1] +simulate = get_simulations """ -Wrapper for [`get_irf`](@ref) with `shocks = :simulate`. Function returns values in levels by default. +Wrapper for [`get_irf`](@ref) which overrides and sets `shocks = :simulate` and sets the default `levels = true`. """ -get_simulations(args...; kwargs...) = get_irf(args...; levels = true, kwargs..., shocks = :simulate)#[:,:,1] +get_simulation = get_simulations """ -Wrapper for [`get_irf`](@ref) with `shocks = :simulate`. +Wrapper for [`get_irf`](@ref) which overrides and sets `generalised_irf = true`. """ -get_girf(args...; kwargs...) = get_irf(args...; kwargs..., generalised_irf = true) +function get_girf(args...; kwargs...) + # Check if 'generalised_irf' is manually set + if haskey(kwargs, :generalised_irf) + @warn "Warning: `generalised_irf` keyword is overridden in `plot_girf`. Defaulting to `generalised_irf = true`." + end + + # Set 'generalised_irf' to :simulate + kwargs = Base.merge(kwargs, Dict(:generalised_irf => true)) + + # Call plot_irf with the modified arguments + get_irf(args...; kwargs...) +end @@ -1466,33 +1487,49 @@ end """ -Wrapper for [`get_steady_state`](@ref) with `stochastic = false`. +Wrapper for [`get_steady_state`](@ref) which overrides and sets `stochastic = false`. """ -get_non_stochastic_steady_state(args...; kwargs...) = get_steady_state(args...; kwargs..., stochastic = false) +function get_non_stochastic_steady_state(args...; kwargs...) + # Check if 'shocks' is manually set + if haskey(kwargs, :stochastic) @warn "Warning: `stochastic` keyword is overridden in `get_steady_state`. Defaulting to `stochastic = false`." end + + # Set 'shocks' to :simulate + kwargs = Base.merge(kwargs, Dict(:stochastic => false)) + # Call plot_irf with the modified arguments + get_steady_state(args...; kwargs...) +end """ -Wrapper for [`get_steady_state`](@ref) with `stochastic = true`. +Wrapper for [`get_steady_state`](@ref) which overrides and sets `stochastic = true`. """ -get_stochastic_steady_state(args...; kwargs...) = get_steady_state(args...; kwargs..., stochastic = true) +function get_stochastic_steady_state(args...; kwargs...) + # Check if 'shocks' is manually set + if haskey(kwargs, :stochastic) @warn "Warning: `stochastic` keyword is overridden in `get_steady_state`. Defaulting to `stochastic = true`." end + # Set 'shocks' to :simulate + kwargs = Base.merge(kwargs, Dict(:stochastic => true)) + + # Call plot_irf with the modified arguments + get_steady_state(args...; kwargs...) +end """ Wrapper for [`get_steady_state`](@ref) with `stochastic = true`. """ -get_SSS(args...; kwargs...) = get_steady_state(args...; kwargs..., stochastic = true) +get_SSS = get_stochastic_steady_state """ Wrapper for [`get_steady_state`](@ref) with `stochastic = true`. """ -SSS(args...; kwargs...) = get_steady_state(args...; kwargs..., stochastic = true) +SSS = get_stochastic_steady_state """ Wrapper for [`get_steady_state`](@ref) with `stochastic = true`. """ -sss(args...; kwargs...) = get_steady_state(args...; kwargs..., stochastic = true) +sss = get_stochastic_steady_state @@ -1519,7 +1556,7 @@ get_ss = get_steady_state """ See [`get_steady_state`](@ref) """ -ss(args...; kwargs...) = get_steady_state(args...; kwargs...) +ss = get_steady_state @@ -1665,24 +1702,53 @@ end """ -Wrapper for [`get_solution`](@ref) with `algorithm = :first_order`. +Wrapper for [`get_solution`](@ref) which overrides and sets `algorithm = :first_order`. """ -get_first_order_solution(args...; kwargs...) = get_solution(args...; kwargs..., algorithm = :first_order) +function get_first_order_solution(args...; kwargs...) + # Check if 'shocks' is manually set + if haskey(kwargs, :algorithm) @warn "Warning: `algorithm` keyword is overridden in `get_solution`. Defaulting to `algorithm = :first_order`." end + + # Set 'shocks' to :simulate + kwargs = Base.merge(kwargs, Dict(:algorithm => :first_order)) + + # Call plot_irf with the modified arguments + get_solution(args...; kwargs...) +end + """ -Wrapper for [`get_solution`](@ref) with `algorithm = :second_order`. +Wrapper for [`get_solution`](@ref) which overrides and sets `algorithm = :second_order`. """ -get_second_order_solution(args...; kwargs...) = get_solution(args...; kwargs..., algorithm = :second_order) +function get_second_order_solution(args...; kwargs...) + # Check if 'shocks' is manually set + if haskey(kwargs, :algorithm) @warn "Warning: `algorithm` keyword is overridden in `get_solution`. Defaulting to `algorithm = :second_order`." end + + # Set 'shocks' to :simulate + kwargs = Base.merge(kwargs, Dict(:algorithm => :second_order)) + + # Call plot_irf with the modified arguments + get_solution(args...; kwargs...) +end + """ -Wrapper for [`get_solution`](@ref) with `algorithm = :third_order`. +Wrapper for [`get_solution`](@ref) which overrides and sets `algorithm = :third_order`. """ -get_third_order_solution(args...; kwargs...) = get_solution(args...; kwargs..., algorithm = :third_order) +function get_third_order_solution(args...; kwargs...) + # Check if 'shocks' is manually set + if haskey(kwargs, :algorithm) @warn "Warning: `algorithm` keyword is overridden in `get_solution`. Defaulting to `algorithm = :third_order`." end + + # Set 'shocks' to :simulate + kwargs = Base.merge(kwargs, Dict(:algorithm => :third_order)) + + # Call plot_irf with the modified arguments + get_solution(args...; kwargs...) +end """ See [`get_solution`](@ref) """ -get_perturbation_solution(args...; kwargs...) = get_solution(args...; kwargs...) +get_perturbation_solution = get_solution @@ -2630,10 +2696,24 @@ function get_moments(𝓂::ℳ; end """ -Wrapper for [`get_moments`](@ref) with `variance = true` and `non_stochastic_steady_state = false, standard_deviation = false, covariance = false`. +Wrapper for [`get_moments`](@ref) which overrides and sets `variance = true` and `non_stochastic_steady_state = false, standard_deviation = false, covariance = false`. """ -get_variance(args...; kwargs...) = get_moments(args...; kwargs..., variance = true, non_stochastic_steady_state = false, standard_deviation = false, covariance = false)[1] +function get_variance(args...; kwargs...) + # Check if 'shocks' is manually set + if haskey(kwargs, :variance) @warn "Warning: `variance` keyword is overridden in `get_moments`. Defaulting to `variance = true`." end + if haskey(kwargs, :non_stochastic_steady_state) @warn "Warning: `non_stochastic_steady_state` keyword is overridden in `get_moments`. Defaulting to `non_stochastic_steady_state = false`." end + if haskey(kwargs, :standard_deviation) @warn "Warning: `standard_deviation` keyword is overridden in `get_moments`. Defaulting to `standard_deviation = false`." end + if haskey(kwargs, :covariance) @warn "Warning: `covariance` keyword is overridden in `get_moments`. Defaulting to `covariance = false`." end + # Set 'shocks' to :simulate + kwargs = Base.merge(kwargs, Dict(:variance => true)) + kwargs = Base.merge(kwargs, Dict(:non_stochastic_steady_state => false)) + kwargs = Base.merge(kwargs, Dict(:standard_deviation => false)) + kwargs = Base.merge(kwargs, Dict(:covariance => false)) + + # Call plot_irf with the modified arguments + get_moments(args...; kwargs...)[1] +end """ Wrapper for [`get_moments`](@ref) with `variance = true` and `non_stochastic_steady_state = false, standard_deviation = false, covariance = false`. @@ -2648,10 +2728,24 @@ var = get_variance """ -Wrapper for [`get_moments`](@ref) with `standard_deviation = true` and `non_stochastic_steady_state = false, variance = false, covariance = false`. +Wrapper for [`get_moments`](@ref) which overrides and sets `standard_deviation = true` and `non_stochastic_steady_state = false, variance = false, covariance = false`. """ -get_standard_deviation(args...; kwargs...) = get_moments(args...; kwargs..., variance = false, non_stochastic_steady_state = false, standard_deviation = true, covariance = false)[1] +function get_standard_deviation(args...; kwargs...) + # Check if 'shocks' is manually set + if haskey(kwargs, :variance) @warn "Warning: `variance` keyword is overridden in `get_moments`. Defaulting to `variance = false`." end + if haskey(kwargs, :non_stochastic_steady_state) @warn "Warning: `non_stochastic_steady_state` keyword is overridden in `get_moments`. Defaulting to `non_stochastic_steady_state = false`." end + if haskey(kwargs, :standard_deviation) @warn "Warning: `standard_deviation` keyword is overridden in `get_moments`. Defaulting to `standard_deviation = true`." end + if haskey(kwargs, :covariance) @warn "Warning: `covariance` keyword is overridden in `get_moments`. Defaulting to `covariance = false`." end + + # Set 'shocks' to :simulate + kwargs = Base.merge(kwargs, Dict(:variance => false)) + kwargs = Base.merge(kwargs, Dict(:non_stochastic_steady_state => false)) + kwargs = Base.merge(kwargs, Dict(:standard_deviation => true)) + kwargs = Base.merge(kwargs, Dict(:covariance => false)) + # Call plot_irf with the modified arguments + get_moments(args...; kwargs...)[1] +end """ Wrapper for [`get_moments`](@ref) with `standard_deviation = true` and `non_stochastic_steady_state = false, variance = false, covariance = false`. @@ -2675,11 +2769,26 @@ Wrapper for [`get_moments`](@ref) with `standard_deviation = true` and `non_stoc """ std = get_standard_deviation + """ -Wrapper for [`get_moments`](@ref) with `covariance = true` and `non_stochastic_steady_state = false, variance = false, standard_deviation = false`. +Wrapper for [`get_moments`](@ref) which overrides and sets `covariance = true` and `non_stochastic_steady_state = false, standard_deviation = false, variance = false`. """ -get_covariance(args...; kwargs...) = get_moments(args...; kwargs..., variance = false, non_stochastic_steady_state = false, standard_deviation = false, covariance = true)[1] +function get_standard_deviation(args...; kwargs...) + # Check if 'shocks' is manually set + if haskey(kwargs, :variance) @warn "Warning: `variance` keyword is overridden in `get_moments`. Defaulting to `variance = false`." end + if haskey(kwargs, :non_stochastic_steady_state) @warn "Warning: `non_stochastic_steady_state` keyword is overridden in `get_moments`. Defaulting to `non_stochastic_steady_state = false`." end + if haskey(kwargs, :standard_deviation) @warn "Warning: `standard_deviation` keyword is overridden in `get_moments`. Defaulting to `standard_deviation = fa;lse`." end + if haskey(kwargs, :covariance) @warn "Warning: `covariance` keyword is overridden in `get_moments`. Defaulting to `covariance = true`." end + # Set 'shocks' to :simulate + kwargs = Base.merge(kwargs, Dict(:variance => false)) + kwargs = Base.merge(kwargs, Dict(:non_stochastic_steady_state => false)) + kwargs = Base.merge(kwargs, Dict(:standard_deviation => false)) + kwargs = Base.merge(kwargs, Dict(:covariance => true)) + + # Call plot_irf with the modified arguments + get_moments(args...; kwargs...)[1] +end """ Wrapper for [`get_moments`](@ref) with `covariance = true` and `non_stochastic_steady_state = false, variance = false, standard_deviation = false`. @@ -2694,10 +2803,26 @@ cov = get_covariance """ -Wrapper for [`get_moments`](@ref) with `mean = true`, and `non_stochastic_steady_state = false, variance = false, standard_deviation = false, covariance = false` +Wrapper for [`get_moments`](@ref) which overrides and sets `mean = true` and `non_stochastic_steady_state = false, standard_deviation = false, variance = false, covariance = false`. """ -get_mean(args...; kwargs...) = get_moments(args...; kwargs..., variance = false, non_stochastic_steady_state = false, standard_deviation = false, covariance = false, mean = true)[1] +function get_standard_deviation(args...; kwargs...) + # Check if 'shocks' is manually set + if haskey(kwargs, :mean) @warn "Warning: `mean` keyword is overridden in `get_moments`. Defaulting to `mean = true`." end + if haskey(kwargs, :variance) @warn "Warning: `variance` keyword is overridden in `get_moments`. Defaulting to `variance = false`." end + if haskey(kwargs, :non_stochastic_steady_state) @warn "Warning: `non_stochastic_steady_state` keyword is overridden in `get_moments`. Defaulting to `non_stochastic_steady_state = false`." end + if haskey(kwargs, :standard_deviation) @warn "Warning: `standard_deviation` keyword is overridden in `get_moments`. Defaulting to `standard_deviation = fa;lse`." end + if haskey(kwargs, :covariance) @warn "Warning: `covariance` keyword is overridden in `get_moments`. Defaulting to `covariance = false`." end + # Set 'shocks' to :simulate + kwargs = Base.merge(kwargs, Dict(:variance => false)) + kwargs = Base.merge(kwargs, Dict(:non_stochastic_steady_state => false)) + kwargs = Base.merge(kwargs, Dict(:standard_deviation => false)) + kwargs = Base.merge(kwargs, Dict(:covariance => false)) + kwargs = Base.merge(kwargs, Dict(:mean => false)) + + # Call plot_irf with the modified arguments + get_moments(args...; kwargs...)[1] +end # """ # Wrapper for [`get_moments`](@ref) with `mean = true`, the default algorithm being `:pruned_second_order`, and `non_stochastic_steady_state = false, variance = false, standard_deviation = false, covariance = false` diff --git a/src/plotting.jl b/src/plotting.jl index 528bd370..8aca950b 100644 --- a/src/plotting.jl +++ b/src/plotting.jl @@ -762,20 +762,43 @@ plot_irfs = plot_irf """ -Wrapper for [`plot_irf`](@ref) with `shocks = :simulate` and `periods = 100`. +Wrapper for [`plot_irf`](@ref) which overrides and sets `shocks = :simulate` and sets the default `periods = 100`. """ -plot_simulations(args...; kwargs...) = plot_irf(args...; kwargs..., shocks = :simulate, periods = 100) +function plot_simulations(args...; periods::Int = 100, kwargs...) + # Check if 'shocks' is manually set + if haskey(kwargs, :shocks) + @warn "Warning: `shocks` keyword is overridden in `plot_simulations`. Defaulting to `shocks = :simulate`." + end + + # Set 'shocks' to :simulate + kwargs = Base.merge(kwargs, Dict(:shocks => :simulate)) + + # Call plot_irf with the modified arguments + plot_irf(args...; periods=periods, kwargs...) +end + """ -Wrapper for [`plot_irf`](@ref) with `shocks = :simulate` and `periods = 100`. +Wrapper for [`plot_irf`](@ref) which overrides and sets `shocks = :simulate` and sets the default `periods = 100`. """ -plot_simulation(args...; kwargs...) = plot_irf(args...; kwargs..., shocks = :simulate, periods = 100) +plot_simulation = plot_simulation """ -Wrapper for [`plot_irf`](@ref) with `generalised_irf = true`. +Wrapper for [`plot_irf`](@ref) which overrides and sets `generalised_irf = true`. """ -plot_girf(args...; kwargs...) = plot_irf(args...; kwargs..., generalised_irf = true) +function plot_girf(args...; kwargs...) + # Check if 'shocks' is manually set + if haskey(kwargs, :generalised_irf) + @warn "Warning: `generalised_irf` keyword is overridden in `plot_girf`. Defaulting to `generalised_irf = true`." + end + + # Set 'shocks' to :simulate + kwargs = Base.merge(kwargs, Dict(:generalised_irf => true)) + + # Call plot_irf with the modified arguments + plot_irf(args...; kwargs...) +end From f0106cc1c1c2eb07a2c6597108368644e88a8460 Mon Sep 17 00:00:00 2001 From: Thore Kockerols Date: Tue, 9 Jan 2024 11:06:58 +0100 Subject: [PATCH 10/34] Update get_functions.jl --- src/get_functions.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/get_functions.jl b/src/get_functions.jl index de97ce81..822a7521 100644 --- a/src/get_functions.jl +++ b/src/get_functions.jl @@ -1281,7 +1281,7 @@ function get_eigenvalues(𝓂::ℳ; eigvals = ℒ.eigen(E,D).values - return KeyedArray(hcat(reim(eigvals)...); Eigenvalue = 1:length(eigs[1]), Parts = [:Real,:Imaginary]) + return KeyedArray(hcat(reim(eigvals)...); Eigenvalue = 1:length(eigvals[1]), Parts = [:Real,:Imaginary]) end From 642eb5140e7791bdc1fd0b6e93e8001f06f49352 Mon Sep 17 00:00:00 2001 From: Thore Kockerols Date: Tue, 9 Jan 2024 11:10:05 +0100 Subject: [PATCH 11/34] fix wrappers --- src/get_functions.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/get_functions.jl b/src/get_functions.jl index 822a7521..d106d762 100644 --- a/src/get_functions.jl +++ b/src/get_functions.jl @@ -2773,7 +2773,7 @@ std = get_standard_deviation """ Wrapper for [`get_moments`](@ref) which overrides and sets `covariance = true` and `non_stochastic_steady_state = false, standard_deviation = false, variance = false`. """ -function get_standard_deviation(args...; kwargs...) +function get_covariance(args...; kwargs...) # Check if 'shocks' is manually set if haskey(kwargs, :variance) @warn "Warning: `variance` keyword is overridden in `get_moments`. Defaulting to `variance = false`." end if haskey(kwargs, :non_stochastic_steady_state) @warn "Warning: `non_stochastic_steady_state` keyword is overridden in `get_moments`. Defaulting to `non_stochastic_steady_state = false`." end @@ -2805,7 +2805,7 @@ cov = get_covariance """ Wrapper for [`get_moments`](@ref) which overrides and sets `mean = true` and `non_stochastic_steady_state = false, standard_deviation = false, variance = false, covariance = false`. """ -function get_standard_deviation(args...; kwargs...) +function get_mean(args...; kwargs...) # Check if 'shocks' is manually set if haskey(kwargs, :mean) @warn "Warning: `mean` keyword is overridden in `get_moments`. Defaulting to `mean = true`." end if haskey(kwargs, :variance) @warn "Warning: `variance` keyword is overridden in `get_moments`. Defaulting to `variance = false`." end From 8e0c02565ae90768d906cc2f097653872e47d722 Mon Sep 17 00:00:00 2001 From: Thore Kockerols Date: Tue, 9 Jan 2024 11:48:08 +0100 Subject: [PATCH 12/34] Update get_functions.jl --- src/get_functions.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/get_functions.jl b/src/get_functions.jl index d106d762..3734e911 100644 --- a/src/get_functions.jl +++ b/src/get_functions.jl @@ -2818,7 +2818,7 @@ function get_mean(args...; kwargs...) kwargs = Base.merge(kwargs, Dict(:non_stochastic_steady_state => false)) kwargs = Base.merge(kwargs, Dict(:standard_deviation => false)) kwargs = Base.merge(kwargs, Dict(:covariance => false)) - kwargs = Base.merge(kwargs, Dict(:mean => false)) + kwargs = Base.merge(kwargs, Dict(:mean => true)) # Call plot_irf with the modified arguments get_moments(args...; kwargs...)[1] From 0238a9d8da8f255e14f5c00bff38babd936e8e1f Mon Sep 17 00:00:00 2001 From: Thore Kockerols Date: Tue, 9 Jan 2024 11:49:22 +0100 Subject: [PATCH 13/34] Update plotting.jl --- src/plotting.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plotting.jl b/src/plotting.jl index 8aca950b..337b69c2 100644 --- a/src/plotting.jl +++ b/src/plotting.jl @@ -781,7 +781,7 @@ end """ Wrapper for [`plot_irf`](@ref) which overrides and sets `shocks = :simulate` and sets the default `periods = 100`. """ -plot_simulation = plot_simulation +plot_simulation = plot_simulations """ @@ -1629,4 +1629,4 @@ function plot_conditional_forecast(𝓂::ℳ, return return_plots -end \ No newline at end of file +end From 5d2a74ede6fc169199c383ef5f9144656d886451 Mon Sep 17 00:00:00 2001 From: Thore Kockerols Date: Tue, 9 Jan 2024 12:07:08 +0100 Subject: [PATCH 14/34] Update get_functions.jl --- src/get_functions.jl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/get_functions.jl b/src/get_functions.jl index 3734e911..2dfeef0b 100644 --- a/src/get_functions.jl +++ b/src/get_functions.jl @@ -2696,16 +2696,18 @@ function get_moments(𝓂::ℳ; end """ -Wrapper for [`get_moments`](@ref) which overrides and sets `variance = true` and `non_stochastic_steady_state = false, standard_deviation = false, covariance = false`. +Wrapper for [`get_moments`](@ref) which overrides and sets `variance = true` and `non_stochastic_steady_state = false, standard_deviation = false, covariance = false, mean = false`. """ function get_variance(args...; kwargs...) # Check if 'shocks' is manually set + if haskey(kwargs, :mean) @warn "Warning: `mean` keyword is overridden in `get_moments`. Defaulting to `mean = false`." end if haskey(kwargs, :variance) @warn "Warning: `variance` keyword is overridden in `get_moments`. Defaulting to `variance = true`." end if haskey(kwargs, :non_stochastic_steady_state) @warn "Warning: `non_stochastic_steady_state` keyword is overridden in `get_moments`. Defaulting to `non_stochastic_steady_state = false`." end if haskey(kwargs, :standard_deviation) @warn "Warning: `standard_deviation` keyword is overridden in `get_moments`. Defaulting to `standard_deviation = false`." end if haskey(kwargs, :covariance) @warn "Warning: `covariance` keyword is overridden in `get_moments`. Defaulting to `covariance = false`." end # Set 'shocks' to :simulate + kwargs = Base.merge(kwargs, Dict(:mean => false)) kwargs = Base.merge(kwargs, Dict(:variance => true)) kwargs = Base.merge(kwargs, Dict(:non_stochastic_steady_state => false)) kwargs = Base.merge(kwargs, Dict(:standard_deviation => false)) @@ -2728,16 +2730,18 @@ var = get_variance """ -Wrapper for [`get_moments`](@ref) which overrides and sets `standard_deviation = true` and `non_stochastic_steady_state = false, variance = false, covariance = false`. +Wrapper for [`get_moments`](@ref) which overrides and sets `standard_deviation = true` and `non_stochastic_steady_state = false, variance = false, covariance = false, mean = false`. """ function get_standard_deviation(args...; kwargs...) # Check if 'shocks' is manually set + if haskey(kwargs, :variance) @warn "Warning: `mean` keyword is overridden in `get_moments`. Defaulting to `mean = false`." end if haskey(kwargs, :variance) @warn "Warning: `variance` keyword is overridden in `get_moments`. Defaulting to `variance = false`." end if haskey(kwargs, :non_stochastic_steady_state) @warn "Warning: `non_stochastic_steady_state` keyword is overridden in `get_moments`. Defaulting to `non_stochastic_steady_state = false`." end if haskey(kwargs, :standard_deviation) @warn "Warning: `standard_deviation` keyword is overridden in `get_moments`. Defaulting to `standard_deviation = true`." end if haskey(kwargs, :covariance) @warn "Warning: `covariance` keyword is overridden in `get_moments`. Defaulting to `covariance = false`." end # Set 'shocks' to :simulate + kwargs = Base.merge(kwargs, Dict(:mean => false)) kwargs = Base.merge(kwargs, Dict(:variance => false)) kwargs = Base.merge(kwargs, Dict(:non_stochastic_steady_state => false)) kwargs = Base.merge(kwargs, Dict(:standard_deviation => true)) @@ -2771,16 +2775,18 @@ std = get_standard_deviation """ -Wrapper for [`get_moments`](@ref) which overrides and sets `covariance = true` and `non_stochastic_steady_state = false, standard_deviation = false, variance = false`. +Wrapper for [`get_moments`](@ref) which overrides and sets `covariance = true` and `non_stochastic_steady_state = false, standard_deviation = false, variance = false, mean = false`. """ function get_covariance(args...; kwargs...) # Check if 'shocks' is manually set + if haskey(kwargs, :variance) @warn "Warning: `mean` keyword is overridden in `get_moments`. Defaulting to `mean = false`." end if haskey(kwargs, :variance) @warn "Warning: `variance` keyword is overridden in `get_moments`. Defaulting to `variance = false`." end if haskey(kwargs, :non_stochastic_steady_state) @warn "Warning: `non_stochastic_steady_state` keyword is overridden in `get_moments`. Defaulting to `non_stochastic_steady_state = false`." end if haskey(kwargs, :standard_deviation) @warn "Warning: `standard_deviation` keyword is overridden in `get_moments`. Defaulting to `standard_deviation = fa;lse`." end if haskey(kwargs, :covariance) @warn "Warning: `covariance` keyword is overridden in `get_moments`. Defaulting to `covariance = true`." end # Set 'shocks' to :simulate + kwargs = Base.merge(kwargs, Dict(:mean => false)) kwargs = Base.merge(kwargs, Dict(:variance => false)) kwargs = Base.merge(kwargs, Dict(:non_stochastic_steady_state => false)) kwargs = Base.merge(kwargs, Dict(:standard_deviation => false)) From 5158ca0127314ee82fbb15e7e29db916d7fc07b0 Mon Sep 17 00:00:00 2001 From: Thore Kockerols Date: Tue, 9 Jan 2024 14:50:19 +0100 Subject: [PATCH 15/34] Update get_functions.jl --- src/get_functions.jl | 48 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/src/get_functions.jl b/src/get_functions.jl index ef2fc8fc..d4fa2aad 100644 --- a/src/get_functions.jl +++ b/src/get_functions.jl @@ -1236,6 +1236,50 @@ end +""" +$(SIGNATURES) +Return the sorted modulus (absoulte), real, and imaginary part if the eigenvalues of the first order problem of the model in a 2-dimensional KeyedArray. + +# Arguments +- $MODEL +# Keyword Arguments +- $PARAMETERS +- $VERBOSE + +# Examples +```jldoctest +using MacroModelling + +@model RBC begin + 1 / c[0] = (β / c[1]) * (α * exp(z[1]) * k[0]^(α - 1) + (1 - δ)) + c[0] + k[0] = (1 - δ) * k[-1] + q[0] + q[0] = exp(z[0]) * k[-1]^α + z[0] = ρ * z[-1] + std_z * eps_z[x] +end + +@parameters RBC begin + std_z = 0.01 + ρ = 0.2 + δ = 0.02 + α = 0.5 + β = 0.95 +end + +get_eigenvalues(RBC) +# output +3-dimensional KeyedArray(NamedDimsArray(...)) with keys: +↓ Variables ∈ 4-element Vector{Symbol} +→ Periods ∈ 40-element UnitRange{Int64} +◪ Shocks ∈ 1-element Vector{Symbol} +And data, 4×40×1 Array{Float64, 3}: +[:, :, 1] ~ (:, :, :eps_z): + (1) (2) … (39) (40) + (:c) 0.00674687 0.00729773 0.00146962 0.00140619 + (:k) 0.0620937 0.0718322 0.0146789 0.0140453 + (:q) 0.0688406 0.0182781 0.00111425 0.00106615 + (:z) 0.01 0.002 2.74878e-29 5.49756e-30 +``` +""" function get_eigenvalues(𝓂::ℳ; parameters::ParameterType = nothing, verbose::Bool = false, @@ -1279,9 +1323,9 @@ function get_eigenvalues(𝓂::ℳ; D = vcat(hcat(Ã₀₋, Ã₊), hcat(I₋, Z₊)) E = vcat(hcat(-Ã₋,-Ã₀₊), hcat(Z₋, I₊)) - eigvals = ℒ.eigen(E,D).values + eigvals = ℒ.eigen(E,D, sortby = x-> -abs(x)).values - return KeyedArray(hcat(reim(eigvals)...); Eigenvalue = 1:length(eigvals[1]), Parts = [:Real,:Imaginary]) + return KeyedArray(hcat(abs.(eigvals), real.(eigvals), imag.(eigvals)); Eigenvalue = 1:length(eigvals), Parts = [:Modulus, :Real, :Imaginary]) end From 741baa861fd97f64d9455000d869c1e04f613505 Mon Sep 17 00:00:00 2001 From: Thore Kockerols Date: Tue, 9 Jan 2024 14:50:37 +0100 Subject: [PATCH 16/34] Update MacroModelling.jl --- src/MacroModelling.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MacroModelling.jl b/src/MacroModelling.jl index 71f4e07c..61a9c974 100644 --- a/src/MacroModelling.jl +++ b/src/MacroModelling.jl @@ -100,7 +100,7 @@ export plot_irfs, plot_irf, plot_IRF, plot_simulations, plot_solution, plot_simu export plot_conditional_variance_decomposition, plot_forecast_error_variance_decomposition, plot_fevd, plot_model_estimates, plot_shock_decomposition export get_irfs, get_irf, get_IRF, simulate, get_simulation, get_simulations export get_conditional_forecast, plot_conditional_forecast -export get_solution, get_first_order_solution, get_perturbation_solution, get_second_order_solution, get_third_order_solution +export get_solution, get_first_order_solution, get_perturbation_solution, get_second_order_solution, get_third_order_solution, get_eigenvalues export get_steady_state, get_SS, get_ss, get_non_stochastic_steady_state, get_stochastic_steady_state, get_SSS, steady_state, SS, SSS, ss, sss export get_moments, get_statistics, get_covariance, get_standard_deviation, get_variance, get_var, get_std, get_stdev, get_cov, var, std, stdev, cov, get_mean#, mean export get_autocorrelation, get_correlation, get_variance_decomposition, get_corr, get_autocorr, get_var_decomp, corr, autocorr From d1da62adc270bd25f72ca32afe5c486aee68053f Mon Sep 17 00:00:00 2001 From: Thore Kockerols Date: Tue, 9 Jan 2024 14:52:23 +0100 Subject: [PATCH 17/34] Update get_functions.jl --- src/get_functions.jl | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/get_functions.jl b/src/get_functions.jl index d4fa2aad..1b57b89f 100644 --- a/src/get_functions.jl +++ b/src/get_functions.jl @@ -1267,17 +1267,15 @@ end get_eigenvalues(RBC) # output -3-dimensional KeyedArray(NamedDimsArray(...)) with keys: -↓ Variables ∈ 4-element Vector{Symbol} -→ Periods ∈ 40-element UnitRange{Int64} -◪ Shocks ∈ 1-element Vector{Symbol} -And data, 4×40×1 Array{Float64, 3}: -[:, :, 1] ~ (:, :, :eps_z): - (1) (2) … (39) (40) - (:c) 0.00674687 0.00729773 0.00146962 0.00140619 - (:k) 0.0620937 0.0718322 0.0146789 0.0140453 - (:q) 0.0688406 0.0182781 0.00111425 0.00106615 - (:z) 0.01 0.002 2.74878e-29 5.49756e-30 +2-dimensional KeyedArray(NamedDimsArray(...)) with keys: +↓ Eigenvalue ∈ 4-element UnitRange{Int64} +→ Part ∈ 3-element Vector{Symbol} +And data, 4×3 Matrix{Float64}: + (:Modulus) (:Real) (:Imaginary) + (1) Inf Inf 0.0 + (2) 1.10012 1.10012 0.0 + (3) 0.956835 0.956835 0.0 + (4) 0.2 0.2 0.0 ``` """ function get_eigenvalues(𝓂::ℳ; @@ -1325,7 +1323,7 @@ function get_eigenvalues(𝓂::ℳ; eigvals = ℒ.eigen(E,D, sortby = x-> -abs(x)).values - return KeyedArray(hcat(abs.(eigvals), real.(eigvals), imag.(eigvals)); Eigenvalue = 1:length(eigvals), Parts = [:Modulus, :Real, :Imaginary]) + return KeyedArray(hcat(abs.(eigvals), real.(eigvals), imag.(eigvals)); Eigenvalue = 1:length(eigvals), Part = [:Modulus, :Real, :Imaginary]) end From 038bc08acda9c81c1176892d71fb43d061120edd Mon Sep 17 00:00:00 2001 From: thorek1 Date: Tue, 9 Jan 2024 20:45:42 +0100 Subject: [PATCH 18/34] consolidate wrapper code --- src/get_functions.jl | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/src/get_functions.jl b/src/get_functions.jl index 1b57b89f..eb7fda66 100644 --- a/src/get_functions.jl +++ b/src/get_functions.jl @@ -2749,11 +2749,7 @@ function get_variance(args...; kwargs...) if haskey(kwargs, :covariance) @warn "Warning: `covariance` keyword is overridden in `get_moments`. Defaulting to `covariance = false`." end # Set 'shocks' to :simulate - kwargs = Base.merge(kwargs, Dict(:mean => false)) - kwargs = Base.merge(kwargs, Dict(:variance => true)) - kwargs = Base.merge(kwargs, Dict(:non_stochastic_steady_state => false)) - kwargs = Base.merge(kwargs, Dict(:standard_deviation => false)) - kwargs = Base.merge(kwargs, Dict(:covariance => false)) + kwargs = Base.merge(kwargs, Dict(:mean => false, :variance => true, :non_stochastic_steady_state => false, :standard_deviation => false, :covariance => false)) # Call plot_irf with the modified arguments get_moments(args...; kwargs...)[1] @@ -2783,11 +2779,7 @@ function get_standard_deviation(args...; kwargs...) if haskey(kwargs, :covariance) @warn "Warning: `covariance` keyword is overridden in `get_moments`. Defaulting to `covariance = false`." end # Set 'shocks' to :simulate - kwargs = Base.merge(kwargs, Dict(:mean => false)) - kwargs = Base.merge(kwargs, Dict(:variance => false)) - kwargs = Base.merge(kwargs, Dict(:non_stochastic_steady_state => false)) - kwargs = Base.merge(kwargs, Dict(:standard_deviation => true)) - kwargs = Base.merge(kwargs, Dict(:covariance => false)) + kwargs = Base.merge(kwargs, Dict(:mean => false, :variance => false, :non_stochastic_steady_state => false, :standard_deviation => true, :covariance => false)) # Call plot_irf with the modified arguments get_moments(args...; kwargs...)[1] @@ -2828,11 +2820,7 @@ function get_covariance(args...; kwargs...) if haskey(kwargs, :covariance) @warn "Warning: `covariance` keyword is overridden in `get_moments`. Defaulting to `covariance = true`." end # Set 'shocks' to :simulate - kwargs = Base.merge(kwargs, Dict(:mean => false)) - kwargs = Base.merge(kwargs, Dict(:variance => false)) - kwargs = Base.merge(kwargs, Dict(:non_stochastic_steady_state => false)) - kwargs = Base.merge(kwargs, Dict(:standard_deviation => false)) - kwargs = Base.merge(kwargs, Dict(:covariance => true)) + kwargs = Base.merge(kwargs, Dict(:mean => false, :variance => false, :non_stochastic_steady_state => false, :standard_deviation => false, :covariance => true)) # Call plot_irf with the modified arguments get_moments(args...; kwargs...)[1] @@ -2862,11 +2850,7 @@ function get_mean(args...; kwargs...) if haskey(kwargs, :covariance) @warn "Warning: `covariance` keyword is overridden in `get_moments`. Defaulting to `covariance = false`." end # Set 'shocks' to :simulate - kwargs = Base.merge(kwargs, Dict(:variance => false)) - kwargs = Base.merge(kwargs, Dict(:non_stochastic_steady_state => false)) - kwargs = Base.merge(kwargs, Dict(:standard_deviation => false)) - kwargs = Base.merge(kwargs, Dict(:covariance => false)) - kwargs = Base.merge(kwargs, Dict(:mean => true)) + kwargs = Base.merge(kwargs, Dict(:variance => false, :non_stochastic_steady_state => false, :standard_deviation => false, :covariance => false, :mean => true)) # Call plot_irf with the modified arguments get_moments(args...; kwargs...)[1] From 344edfa2033c27918bab9f1f05ff0ea51de3a278 Mon Sep 17 00:00:00 2001 From: thorek1 Date: Tue, 9 Jan 2024 21:01:26 +0100 Subject: [PATCH 19/34] bundle initial state handling in a function --- src/MacroModelling.jl | 30 +++++++++++++++++++++++ src/get_functions.jl | 56 ++++--------------------------------------- src/plotting.jl | 27 ++------------------- 3 files changed, 36 insertions(+), 77 deletions(-) diff --git a/src/MacroModelling.jl b/src/MacroModelling.jl index 61a9c974..1c05b43e 100644 --- a/src/MacroModelling.jl +++ b/src/MacroModelling.jl @@ -1640,6 +1640,36 @@ function expand_indices(compressed_inputs::Vector{Symbol}, compressed_values::Ve end +function get_and_check_initial_state(𝓂::ℳ, initial_state::Union{Vector{Vector{Float64}}, Vector{Float64}, Symbol}, reference_steady_state::Vector{Float64}, NSSS::Vector{Float64}, SSS_delta::Vector{Float64}, algorithm::Symbol) + unspecified_initial_state = initial_state == [0.0] + + if unspecified_initial_state + if algorithm == :pruned_second_order + initial_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars) - SSS_delta] + elseif algorithm == :pruned_third_order + initial_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars) - SSS_delta, zeros(𝓂.timings.nVars)] + else + initial_state = zeros(𝓂.timings.nVars) - SSS_delta + end + else + if initial_state isa Vector{Float64} + if algorithm == :pruned_second_order + initial_state = [initial_state - reference_steady_state[1:𝓂.timings.nVars], zeros(𝓂.timings.nVars) - SSS_delta] + elseif algorithm == :pruned_third_order + initial_state = [initial_state - reference_steady_state[1:𝓂.timings.nVars], zeros(𝓂.timings.nVars) - SSS_delta, zeros(𝓂.timings.nVars)] + else + initial_state = initial_state - NSSS + end + else + if algorithm ∉ [:pruned_second_order, :pruned_third_order] + @assert initial_state isa Vector{Float64} "The solution algorithm has one state vector: initial_state must be a Vector{Float64}." + end + end + end + + return initial_state +end + function minmax!(x::Vector{Float64},lb::Vector{Float64},ub::Vector{Float64}) @inbounds for i in eachindex(x) x[i] = max(lb[i], min(x[i], ub[i])) diff --git a/src/get_functions.jl b/src/get_functions.jl index eb7fda66..7dd3496b 100644 --- a/src/get_functions.jl +++ b/src/get_functions.jl @@ -506,7 +506,7 @@ And data, 9×42 Matrix{Float64}: function get_conditional_forecast(𝓂::ℳ, conditions::Union{Matrix{Union{Nothing,Float64}}, SparseMatrixCSC{Float64}, KeyedArray{Union{Nothing,Float64}}, KeyedArray{Float64}}; shocks::Union{Matrix{Union{Nothing,Float64}}, SparseMatrixCSC{Float64}, KeyedArray{Union{Nothing,Float64}}, KeyedArray{Float64}, Nothing} = nothing, - initial_state::Union{Vector{Vector{Float64}},Vector{Float64}} = [0.0], + initial_state::Union{Vector{Vector{Float64}}, Vector{Float64}, Symbol} = [0.0], periods::Int = 40, parameters::ParameterType = nothing, variables::Union{Symbol_input,String_input} = :all_excluding_obc, @@ -579,31 +579,7 @@ function get_conditional_forecast(𝓂::ℳ, reference_steady_state, NSSS, SSS_delta = get_relevant_steady_states(𝓂, algorithm) - unspecified_initial_state = initial_state == [0.0] - - if unspecified_initial_state - if algorithm == :pruned_second_order - initial_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars) - SSS_delta] - elseif algorithm == :pruned_third_order - initial_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars) - SSS_delta, zeros(𝓂.timings.nVars)] - else - initial_state = zeros(𝓂.timings.nVars) - SSS_delta - end - else - if initial_state isa Vector{Float64} - if algorithm == :pruned_second_order - initial_state = [initial_state - reference_steady_state[1:𝓂.timings.nVars], zeros(𝓂.timings.nVars) - SSS_delta] - elseif algorithm == :pruned_third_order - initial_state = [initial_state - reference_steady_state[1:𝓂.timings.nVars], zeros(𝓂.timings.nVars) - SSS_delta, zeros(𝓂.timings.nVars)] - else - initial_state = initial_state - NSSS - end - else - if algorithm ∉ [:pruned_second_order, :pruned_third_order] - @assert initial_state isa Vector{Float64} "The solution algorithm has one state vector: initial_state must be a Vector{Float64}." - end - end - end + initial_state = get_and_check_initial_state(𝓂, initial_state, reference_steady_state, NSSS, SSS_delta, algorithm) var_idx = parse_variables_input_to_index(variables, 𝓂.timings) @@ -1023,34 +999,10 @@ function get_irf(𝓂::ℳ; end solve!(𝓂, parameters = parameters, verbose = verbose, dynamics = true, algorithm = algorithm, obc = occasionally_binding_constraints || obc_shocks_included) - + reference_steady_state, NSSS, SSS_delta = get_relevant_steady_states(𝓂, algorithm) - - unspecified_initial_state = initial_state == [0.0] - if unspecified_initial_state - if algorithm == :pruned_second_order - initial_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars) - SSS_delta] - elseif algorithm == :pruned_third_order - initial_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars) - SSS_delta, zeros(𝓂.timings.nVars)] - else - initial_state = zeros(𝓂.timings.nVars) - SSS_delta - end - else - if initial_state isa Vector{Float64} - if algorithm == :pruned_second_order - initial_state = [initial_state - reference_steady_state[1:𝓂.timings.nVars], zeros(𝓂.timings.nVars) - SSS_delta] - elseif algorithm == :pruned_third_order - initial_state = [initial_state - reference_steady_state[1:𝓂.timings.nVars], zeros(𝓂.timings.nVars) - SSS_delta, zeros(𝓂.timings.nVars)] - else - initial_state = initial_state - NSSS - end - else - if algorithm ∉ [:pruned_second_order, :pruned_third_order] - @assert initial_state isa Vector{Float64} "The solution algorithm has one state vector: initial_state must be a Vector{Float64}." - end - end - end + initial_state = get_and_check_initial_state(𝓂, initial_state, reference_steady_state, NSSS, SSS_delta, algorithm) if occasionally_binding_constraints state_update, pruning = parse_algorithm_to_state_update(algorithm, 𝓂, true) diff --git a/src/plotting.jl b/src/plotting.jl index 337b69c2..a494e7db 100644 --- a/src/plotting.jl +++ b/src/plotting.jl @@ -387,7 +387,7 @@ function plot_irf(𝓂::ℳ; algorithm::Symbol = :first_order, negative_shock::Bool = false, generalised_irf::Bool = false, - initial_state::Union{Vector{Vector{Float64}},Vector{Float64}} = [0.0], + initial_state::Union{Vector{Vector{Float64}}, Vector{Float64}, Symbol} = [0.0], ignore_obc::Bool = false, verbose::Bool = false) @@ -440,31 +440,8 @@ function plot_irf(𝓂::ℳ; solve!(𝓂, parameters = parameters, verbose = verbose, dynamics = true, algorithm = algorithm, obc = occasionally_binding_constraints || obc_shocks_included) reference_steady_state, NSSS, SSS_delta = get_relevant_steady_states(𝓂, algorithm) - - unspecified_initial_state = initial_state == [0.0] - if unspecified_initial_state - if algorithm == :pruned_second_order - initial_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars) - SSS_delta] - elseif algorithm == :pruned_third_order - initial_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars) - SSS_delta, zeros(𝓂.timings.nVars)] - else - initial_state = zeros(𝓂.timings.nVars) - SSS_delta - end - else - if initial_state isa Vector{Float64} - if algorithm == :pruned_second_order - initial_state = [initial_state - reference_steady_state[1:𝓂.timings.nVars], zeros(𝓂.timings.nVars) - SSS_delta] - elseif algorithm == :pruned_third_order - initial_state = [initial_state - reference_steady_state[1:𝓂.timings.nVars], zeros(𝓂.timings.nVars) - SSS_delta, zeros(𝓂.timings.nVars)] - else - initial_state = initial_state - reference_steady_state[1:𝓂.timings.nVars] - end - else - @assert algorithm ∉ [:pruned_second_order, :pruned_third_order] && initial_state isa Vector{Float64} "The solution algorithm has one state vector: initial_state must be a Vector{Float64}." - end - end - + initial_state = get_and_check_initial_state(𝓂, initial_state, reference_steady_state, NSSS, SSS_delta, algorithm) if occasionally_binding_constraints state_update, pruning = parse_algorithm_to_state_update(algorithm, 𝓂, true) From cd4cfe1bd6e9f1f6a5131016dd94433383893a09 Mon Sep 17 00:00:00 2001 From: thorek1 Date: Tue, 9 Jan 2024 21:40:30 +0100 Subject: [PATCH 20/34] fix docstring, types, defaults --- src/MacroModelling.jl | 44 ++++++++++++++++++++++++---------------- src/common_docstrings.jl | 2 +- src/get_functions.jl | 10 ++++----- src/plotting.jl | 4 ++-- 4 files changed, 35 insertions(+), 25 deletions(-) diff --git a/src/MacroModelling.jl b/src/MacroModelling.jl index 1c05b43e..48cfaca1 100644 --- a/src/MacroModelling.jl +++ b/src/MacroModelling.jl @@ -1640,10 +1640,8 @@ function expand_indices(compressed_inputs::Vector{Symbol}, compressed_values::Ve end -function get_and_check_initial_state(𝓂::ℳ, initial_state::Union{Vector{Vector{Float64}}, Vector{Float64}, Symbol}, reference_steady_state::Vector{Float64}, NSSS::Vector{Float64}, SSS_delta::Vector{Float64}, algorithm::Symbol) - unspecified_initial_state = initial_state == [0.0] - - if unspecified_initial_state +function get_and_check_initial_state(𝓂::ℳ, initial_state::Union{Vector{Vector{Float64}}, Vector{Float64}, Symbol}, reference_steady_state::Vector{Float64}, NSSS::Vector{Float64}, SSS_delta::Vector{Float64}, algorithm::Symbol)::Union{Vector{Vector{Float64}}, Vector{Float64}} + if initial_state ∈ [:relevant_SS, :relevant_ss, :relevant_steady_state] if algorithm == :pruned_second_order initial_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars) - SSS_delta] elseif algorithm == :pruned_third_order @@ -1651,19 +1649,32 @@ function get_and_check_initial_state(𝓂::ℳ, initial_state::Union{Vector{Vect else initial_state = zeros(𝓂.timings.nVars) - SSS_delta end - else - if initial_state isa Vector{Float64} - if algorithm == :pruned_second_order - initial_state = [initial_state - reference_steady_state[1:𝓂.timings.nVars], zeros(𝓂.timings.nVars) - SSS_delta] - elseif algorithm == :pruned_third_order - initial_state = [initial_state - reference_steady_state[1:𝓂.timings.nVars], zeros(𝓂.timings.nVars) - SSS_delta, zeros(𝓂.timings.nVars)] - else - initial_state = initial_state - NSSS - end + end + + if initial_state ∈ [:SSS, :stochastic_steady_state] + if algorithm ∈ [:second_order, :pruned_second_order, :third_order, :pruned_third_order] + initial_state = zeros(𝓂.timings.nVars) - SSS_delta else - if algorithm ∉ [:pruned_second_order, :pruned_third_order] - @assert initial_state isa Vector{Float64} "The solution algorithm has one state vector: initial_state must be a Vector{Float64}." - end + @warn "Algorithm: $algorithm has no stochastic steady state. Continuing with the non stochastic steady state as the initial state." + initial_state = zeros(𝓂.timings.nVars) + end + end + + if initial_state ∈ [:NSSS, :non_stochastic_steady_state] + initial_state = zeros(𝓂.timings.nVars) + end + + if initial_state isa Vector{Float64} + if algorithm == :pruned_second_order + initial_state = [initial_state - reference_steady_state[1:𝓂.timings.nVars], zeros(𝓂.timings.nVars) - SSS_delta] + elseif algorithm == :pruned_third_order + initial_state = [initial_state - reference_steady_state[1:𝓂.timings.nVars], zeros(𝓂.timings.nVars) - SSS_delta, zeros(𝓂.timings.nVars)] + else + initial_state = initial_state - NSSS + end + else + if algorithm ∉ [:pruned_second_order, :pruned_third_order] + @assert initial_state isa Vector{Float64} "The solution algorithm has one state vector: initial_state must be a Vector{Float64}." end end @@ -1677,7 +1688,6 @@ function minmax!(x::Vector{Float64},lb::Vector{Float64},ub::Vector{Float64}) end - # transformation of NSSS problem function transform(x::Vector{T}, option::Int, shift::AbstractFloat) where T <: Real if option == 4 diff --git a/src/common_docstrings.jl b/src/common_docstrings.jl index e8b0e527..5804efdb 100644 --- a/src/common_docstrings.jl +++ b/src/common_docstrings.jl @@ -9,7 +9,6 @@ const DERIVATIVES = "`derivatives` [Default: `true`, Type: `Bool`]: calculate de const PERIODS = "`periods` [Default: `40`, Type: `Int`]: number of periods for which to calculate the IRFs. In case a matrix of shocks was provided, periods defines how many periods after the series of shocks the simulation continues." const NEGATIVE_SHOCK = "`negative_shock` [Default: `false`, Type: `Bool`]: calculate a negative shock. Relevant for generalised IRFs." const GENERALISED_IRF = "`generalised_irf` [Default: `false`, Type: `Bool`]: calculate generalised IRFs. Relevant for nonlinear solutions. Reference steady state for deviations is the stochastic steady state." -const INITIAL_STATE = "`initial_state` [Default: `[0.0]`, Type: `Vector{Float64}`]: provide state (in levels, not deviations) from which to start IRFs. Relevant for normal IRFs. The state includes all variables as well as exogenous variables in leads or lags if present." const ALGORITHM = "`algorithm` [Default: `:first_order`, Type: `Symbol`]: algorithm to solve for the dynamics of the model." const FILTER = "`filter` [Default: `:kalman`, Type: `Symbol`]: filter used to compute the shocks given the data, model, and parameters. The Kalman filter only works for linear problems, whereas the inversion filter (`:inversion`) works for linear and nonlinear models. If a nonlinear solution algorithm is selected, the inversion filter is used." const LEVELS = "`levels` [Default: `false`, Type: `Bool`]: return levels or absolute deviations from steady state corresponding to the solution algorithm (e.g. stochastic steady state for higher order solution algorithms)." @@ -19,3 +18,4 @@ const PARAMETER_DERIVATIVES = "`parameter_derivatives` [Default: :all]: paramete const DATA = "`data` [Type: `KeyedArray`]: data matrix with variables (`String` or `Symbol`) in rows and time in columns" const SMOOTH = "`smooth` [Default: `true`, Type: `Bool`]: whether to return smoothed (`true`) or filtered (`false`) shocks. Only works for the Kalman filter. The inversion filter only returns filtered shocks." const DATA_IN_LEVELS = "`data_in_levels` [Default: `true`, Type: `Bool`]: indicator whether the data is provided in levels. If `true` the input to the data argument will have the non stochastic steady state substracted." +const INITIAL_STATE = "`initial_state` [Default: `:relevant_steady_state`, Type: `Union{Vector{Vector{Float64}}, Vector{Float64}, Symbol}`]: The initial state defines the starting point for the model and is relevant for normal IRFs. The default is the relevant steady state (stochastic steady state in case of a nonlinear solution, otherwise the non stochastic steady state). You can use any of `:relevant_SS`, `:relevant_ss`, `:relevant_steady_state` to use the relevant steady state, any of `:SSS`, `:stochastic_steady_state` to use the stochastic steady state (falls back to the non stochastic steady state in case the model is solution deifned in `algorithm` is linear), or any of `:NSSS`, `:non_stochastic_steady_state` to use the non stochastic steady state. In the case of pruned solution algorithms the initial state can be given as multiple state vectors (`Vector{Vector{Float64}}`). In this case the initial state must be given in devations from the non-stochastic steady state. In all other cases the initial state must be given in levels. If a pruned solution algorithm is selected and initial state is a `Vector{Float64}` then it impacts the first order initial state vector only. The state includes all variables as well as exogenous variables in leads or lags if present." \ No newline at end of file diff --git a/src/get_functions.jl b/src/get_functions.jl index 7dd3496b..bc824669 100644 --- a/src/get_functions.jl +++ b/src/get_functions.jl @@ -422,7 +422,7 @@ Return the conditional forecast given restrictions on endogenous variables and s - $CONDITIONS # Keyword Arguments - $SHOCK_CONDITIONS -- `initial_state` [Default: `[0.0]`, Type: `Union{Vector{Vector{Float64}},Vector{Float64}}`]: The initial state defines the starting point for the model and is relevant for normal IRFs. In the case of pruned solution algorithms the initial state can be given as multiple state vectors (`Vector{Vector{Float64}}`). In this case the initial state must be given in devations from the non-stochastic steady state. In all other cases the initial state must be given in levels. If a pruned solution algorithm is selected and initial state is a `Vector{Float64}` then it impacts the first order initial state vector only. The state includes all variables as well as exogenous variables in leads or lags if present. +- $INITIAL_STATE - `periods` [Default: `40`, Type: `Int`]: the total number of periods is the sum of the argument provided here and the maximum of periods of the shocks or conditions argument. - $PARAMETERS - $VARIABLES @@ -506,7 +506,7 @@ And data, 9×42 Matrix{Float64}: function get_conditional_forecast(𝓂::ℳ, conditions::Union{Matrix{Union{Nothing,Float64}}, SparseMatrixCSC{Float64}, KeyedArray{Union{Nothing,Float64}}, KeyedArray{Float64}}; shocks::Union{Matrix{Union{Nothing,Float64}}, SparseMatrixCSC{Float64}, KeyedArray{Union{Nothing,Float64}}, KeyedArray{Float64}, Nothing} = nothing, - initial_state::Union{Vector{Vector{Float64}}, Vector{Float64}, Symbol} = [0.0], + initial_state::Union{Vector{Vector{Float64}}, Vector{Float64}, Symbol} = :relevant_ss, periods::Int = 40, parameters::ParameterType = nothing, variables::Union{Symbol_input,String_input} = :all_excluding_obc, @@ -752,7 +752,7 @@ Function to use when differentiating IRFs with repect to parameters. - $VARIABLES - $SHOCKS - $NEGATIVE_SHOCK -- $INITIAL_STATE +- "`initial_state` [Default: `[0.0]`, Type: `Vector{Float64}`]: provide state (in levels, not deviations) from which to start IRFs. Relevant for normal IRFs. The state includes all variables as well as exogenous variables in leads or lags if present." - $LEVELS - $VERBOSE @@ -896,7 +896,7 @@ Return impulse response functions (IRFs) of the model in a 3-dimensional KeyedAr - $SHOCKS - $NEGATIVE_SHOCK - $GENERALISED_IRF -- `initial_state` [Default: `[0.0]`, Type: `Union{Vector{Vector{Float64}},Vector{Float64}}`]: The initial state defines the starting point for the model and is relevant for normal IRFs. In the case of pruned solution algorithms the initial state can be given as multiple state vectors (`Vector{Vector{Float64}}`). In this case the initial state must be given in devations from the non-stochastic steady state. In all other cases the initial state must be given in levels. If a pruned solution algorithm is selected and initial state is a `Vector{Float64}` then it impacts the first order initial state vector only. The state includes all variables as well as exogenous variables in leads or lags if present. +- $INITIAL_STATE - $LEVELS - `ignore_obc` [Default: `false`, Type: `Bool`]: solve the model ignoring the occasionally binding constraints. - $VERBOSE @@ -943,7 +943,7 @@ function get_irf(𝓂::ℳ; shocks::Union{Symbol_input,String_input,Matrix{Float64},KeyedArray{Float64}} = :all_excluding_obc, negative_shock::Bool = false, generalised_irf::Bool = false, - initial_state::Union{Vector{Vector{Float64}},Vector{Float64}} = [0.0], + initial_state::Union{Vector{Vector{Float64}}, Vector{Float64}, Symbol} = :relevant_ss, levels::Bool = false, ignore_obc::Bool = false, verbose::Bool = false) diff --git a/src/plotting.jl b/src/plotting.jl index a494e7db..c6484977 100644 --- a/src/plotting.jl +++ b/src/plotting.jl @@ -348,7 +348,7 @@ The left axis shows the level, and the right the deviation from the reference st - $ALGORITHM - $NEGATIVE_SHOCK - $GENERALISED_IRF -- `initial_state` [Default: `[0.0]`, Type: `Union{Vector{Vector{Float64}},Vector{Float64}}`]: The initial state defines the starting point for the model and is relevant for normal IRFs. In the case of pruned solution algorithms the initial state can be given as multiple state vectors (`Vector{Vector{Float64}}`). In this case the initial state must be given in devations from the non-stochastic steady state. In all other cases the initial state must be given in levels. If a pruned solution algorithm is selected and initial state is a `Vector{Float64}` then it impacts the first order initial state vector only. The state includes all variables as well as exogenous variables in leads or lags if present. +- $INITIAL_STATE - `ignore_obc` [Default: `false`, Type: `Bool`]: solve the model ignoring the occasionally binding constraints. - $VERBOSE @@ -387,7 +387,7 @@ function plot_irf(𝓂::ℳ; algorithm::Symbol = :first_order, negative_shock::Bool = false, generalised_irf::Bool = false, - initial_state::Union{Vector{Vector{Float64}}, Vector{Float64}, Symbol} = [0.0], + initial_state::Union{Vector{Vector{Float64}}, Vector{Float64}, Symbol} = :relevant_ss, ignore_obc::Bool = false, verbose::Bool = false) From 7d80db31d9c70c392d24c407100301c7145ac13d Mon Sep 17 00:00:00 2001 From: thorek1 Date: Wed, 10 Jan 2024 09:05:59 +0100 Subject: [PATCH 21/34] fix steady states --- src/MacroModelling.jl | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/MacroModelling.jl b/src/MacroModelling.jl index 48cfaca1..a0f36bc1 100644 --- a/src/MacroModelling.jl +++ b/src/MacroModelling.jl @@ -1649,22 +1649,16 @@ function get_and_check_initial_state(𝓂::ℳ, initial_state::Union{Vector{Vect else initial_state = zeros(𝓂.timings.nVars) - SSS_delta end - end - - if initial_state ∈ [:SSS, :stochastic_steady_state] + elseif initial_state ∈ [:SSS, :stochastic_steady_state] if algorithm ∈ [:second_order, :pruned_second_order, :third_order, :pruned_third_order] initial_state = zeros(𝓂.timings.nVars) - SSS_delta else @warn "Algorithm: $algorithm has no stochastic steady state. Continuing with the non stochastic steady state as the initial state." initial_state = zeros(𝓂.timings.nVars) end - end - - if initial_state ∈ [:NSSS, :non_stochastic_steady_state] + elseif initial_state ∈ [:NSSS, :non_stochastic_steady_state] initial_state = zeros(𝓂.timings.nVars) - end - - if initial_state isa Vector{Float64} + elseif initial_state isa Vector{Float64} if algorithm == :pruned_second_order initial_state = [initial_state - reference_steady_state[1:𝓂.timings.nVars], zeros(𝓂.timings.nVars) - SSS_delta] elseif algorithm == :pruned_third_order @@ -1672,7 +1666,7 @@ function get_and_check_initial_state(𝓂::ℳ, initial_state::Union{Vector{Vect else initial_state = initial_state - NSSS end - else + elseif initial_state isa Vector{Vector{Float64}} if algorithm ∉ [:pruned_second_order, :pruned_third_order] @assert initial_state isa Vector{Float64} "The solution algorithm has one state vector: initial_state must be a Vector{Float64}." end From a38eca082d80a72f8c571745b2814df5b0c25436 Mon Sep 17 00:00:00 2001 From: thorek1 Date: Wed, 10 Jan 2024 09:10:08 +0100 Subject: [PATCH 22/34] allows small caps --- src/MacroModelling.jl | 4 ++-- src/common_docstrings.jl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MacroModelling.jl b/src/MacroModelling.jl index a0f36bc1..d7dad358 100644 --- a/src/MacroModelling.jl +++ b/src/MacroModelling.jl @@ -1649,14 +1649,14 @@ function get_and_check_initial_state(𝓂::ℳ, initial_state::Union{Vector{Vect else initial_state = zeros(𝓂.timings.nVars) - SSS_delta end - elseif initial_state ∈ [:SSS, :stochastic_steady_state] + elseif initial_state ∈ [:SSS, :sss, :stochastic_steady_state] if algorithm ∈ [:second_order, :pruned_second_order, :third_order, :pruned_third_order] initial_state = zeros(𝓂.timings.nVars) - SSS_delta else @warn "Algorithm: $algorithm has no stochastic steady state. Continuing with the non stochastic steady state as the initial state." initial_state = zeros(𝓂.timings.nVars) end - elseif initial_state ∈ [:NSSS, :non_stochastic_steady_state] + elseif initial_state ∈ [:NSSS, :nsss, :non_stochastic_steady_state] initial_state = zeros(𝓂.timings.nVars) elseif initial_state isa Vector{Float64} if algorithm == :pruned_second_order diff --git a/src/common_docstrings.jl b/src/common_docstrings.jl index 5804efdb..f85971cd 100644 --- a/src/common_docstrings.jl +++ b/src/common_docstrings.jl @@ -18,4 +18,4 @@ const PARAMETER_DERIVATIVES = "`parameter_derivatives` [Default: :all]: paramete const DATA = "`data` [Type: `KeyedArray`]: data matrix with variables (`String` or `Symbol`) in rows and time in columns" const SMOOTH = "`smooth` [Default: `true`, Type: `Bool`]: whether to return smoothed (`true`) or filtered (`false`) shocks. Only works for the Kalman filter. The inversion filter only returns filtered shocks." const DATA_IN_LEVELS = "`data_in_levels` [Default: `true`, Type: `Bool`]: indicator whether the data is provided in levels. If `true` the input to the data argument will have the non stochastic steady state substracted." -const INITIAL_STATE = "`initial_state` [Default: `:relevant_steady_state`, Type: `Union{Vector{Vector{Float64}}, Vector{Float64}, Symbol}`]: The initial state defines the starting point for the model and is relevant for normal IRFs. The default is the relevant steady state (stochastic steady state in case of a nonlinear solution, otherwise the non stochastic steady state). You can use any of `:relevant_SS`, `:relevant_ss`, `:relevant_steady_state` to use the relevant steady state, any of `:SSS`, `:stochastic_steady_state` to use the stochastic steady state (falls back to the non stochastic steady state in case the model is solution deifned in `algorithm` is linear), or any of `:NSSS`, `:non_stochastic_steady_state` to use the non stochastic steady state. In the case of pruned solution algorithms the initial state can be given as multiple state vectors (`Vector{Vector{Float64}}`). In this case the initial state must be given in devations from the non-stochastic steady state. In all other cases the initial state must be given in levels. If a pruned solution algorithm is selected and initial state is a `Vector{Float64}` then it impacts the first order initial state vector only. The state includes all variables as well as exogenous variables in leads or lags if present." \ No newline at end of file +const INITIAL_STATE = "`initial_state` [Default: `:relevant_steady_state`, Type: `Union{Vector{Vector{Float64}}, Vector{Float64}, Symbol}`]: The initial state defines the starting point for the model and is relevant for normal IRFs. The default is the relevant steady state (stochastic steady state in case of a nonlinear solution, otherwise the non stochastic steady state). You can use any of `:relevant_SS`, `:relevant_ss`, `:relevant_steady_state` to use the relevant steady state, any of `:SSS`, `:sss`, `:stochastic_steady_state` to use the stochastic steady state (falls back to the non stochastic steady state in case the model is solution deifned in `algorithm` is linear), or any of `:NSSS`, `:nsss`, `:non_stochastic_steady_state` to use the non stochastic steady state. In the case of pruned solution algorithms the initial state can be given as multiple state vectors (`Vector{Vector{Float64}}`). In this case the initial state must be given in devations from the non-stochastic steady state. In all other cases the initial state must be given in levels. If a pruned solution algorithm is selected and initial state is a `Vector{Float64}` then it impacts the first order initial state vector only. The state includes all variables as well as exogenous variables in leads or lags if present." \ No newline at end of file From 723c1e63743cd697670b69dbb621b84d8565abb9 Mon Sep 17 00:00:00 2001 From: Thore Kockerols Date: Wed, 10 Jan 2024 10:00:35 +0100 Subject: [PATCH 23/34] fix init state func --- src/MacroModelling.jl | 50 ++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/src/MacroModelling.jl b/src/MacroModelling.jl index d7dad358..14f1d1f5 100644 --- a/src/MacroModelling.jl +++ b/src/MacroModelling.jl @@ -1641,30 +1641,36 @@ end function get_and_check_initial_state(𝓂::ℳ, initial_state::Union{Vector{Vector{Float64}}, Vector{Float64}, Symbol}, reference_steady_state::Vector{Float64}, NSSS::Vector{Float64}, SSS_delta::Vector{Float64}, algorithm::Symbol)::Union{Vector{Vector{Float64}}, Vector{Float64}} - if initial_state ∈ [:relevant_SS, :relevant_ss, :relevant_steady_state] - if algorithm == :pruned_second_order - initial_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars) - SSS_delta] - elseif algorithm == :pruned_third_order - initial_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars) - SSS_delta, zeros(𝓂.timings.nVars)] - else - initial_state = zeros(𝓂.timings.nVars) - SSS_delta - end - elseif initial_state ∈ [:SSS, :sss, :stochastic_steady_state] - if algorithm ∈ [:second_order, :pruned_second_order, :third_order, :pruned_third_order] - initial_state = zeros(𝓂.timings.nVars) - SSS_delta - else - @warn "Algorithm: $algorithm has no stochastic steady state. Continuing with the non stochastic steady state as the initial state." - initial_state = zeros(𝓂.timings.nVars) - end - elseif initial_state ∈ [:NSSS, :nsss, :non_stochastic_steady_state] - initial_state = zeros(𝓂.timings.nVars) - elseif initial_state isa Vector{Float64} + if initial_state isa Symbol + if initial_state ∈ [:relevant_SS, :relevant_ss, :relevant_steady_state] + if algorithm == :pruned_second_order + init_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars) - SSS_delta] + elseif algorithm == :pruned_third_order + init_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars) - SSS_delta, zeros(𝓂.timings.nVars)] + else + init_state = zeros(𝓂.timings.nVars) - SSS_delta + end + elseif initial_state ∈ [:SSS, :sss, :stochastic_steady_state] + if algorithm ∈ [:second_order, :pruned_second_order, :third_order, :pruned_third_order] + init_state = zeros(𝓂.timings.nVars) - SSS_delta + else + @warn "Algorithm: $algorithm has no stochastic steady state. Continuing with the non stochastic steady state as the initial state." + init_state = zeros(𝓂.timings.nVars) + end + elseif initial_state ∈ [:NSSS, :nsss, :non_stochastic_steady_state] + init_state = zeros(𝓂.timings.nVars) + else + @assert initial_state ∈ [:NSSS, :nsss, :non_stochastic_steady_state, :SSS, :sss, :stochastic_steady_state, :relevant_SS, :relevant_ss, :relevant_steady_state] "No valid input of type Symbol." + end + end + + if initial_state isa Vector{Float64} if algorithm == :pruned_second_order - initial_state = [initial_state - reference_steady_state[1:𝓂.timings.nVars], zeros(𝓂.timings.nVars) - SSS_delta] + init_state = [initial_state - reference_steady_state[1:𝓂.timings.nVars], zeros(𝓂.timings.nVars) - SSS_delta] elseif algorithm == :pruned_third_order - initial_state = [initial_state - reference_steady_state[1:𝓂.timings.nVars], zeros(𝓂.timings.nVars) - SSS_delta, zeros(𝓂.timings.nVars)] + init_state = [initial_state - reference_steady_state[1:𝓂.timings.nVars], zeros(𝓂.timings.nVars) - SSS_delta, zeros(𝓂.timings.nVars)] else - initial_state = initial_state - NSSS + init_state = initial_state - NSSS end elseif initial_state isa Vector{Vector{Float64}} if algorithm ∉ [:pruned_second_order, :pruned_third_order] @@ -1672,7 +1678,7 @@ function get_and_check_initial_state(𝓂::ℳ, initial_state::Union{Vector{Vect end end - return initial_state + return init_state end function minmax!(x::Vector{Float64},lb::Vector{Float64},ub::Vector{Float64}) From 8d3de87e43de4dbfdf57649e71adeeb6a8492368 Mon Sep 17 00:00:00 2001 From: Thore Kockerols Date: Wed, 10 Jan 2024 10:30:08 +0100 Subject: [PATCH 24/34] fix remaining old init state --- src/plotting.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plotting.jl b/src/plotting.jl index c6484977..04c30515 100644 --- a/src/plotting.jl +++ b/src/plotting.jl @@ -1354,7 +1354,7 @@ plot_conditional_forecast(RBC_CME, conditions, shocks = shocks, conditions_in_le function plot_conditional_forecast(𝓂::ℳ, conditions::Union{Matrix{Union{Nothing,Float64}}, SparseMatrixCSC{Float64}, KeyedArray{Union{Nothing,Float64}}, KeyedArray{Float64}}; shocks::Union{Matrix{Union{Nothing,Float64}}, SparseMatrixCSC{Float64}, KeyedArray{Union{Nothing,Float64}}, KeyedArray{Float64}, Nothing} = nothing, - initial_state::Union{Vector{Vector{Float64}},Vector{Float64}} = [0.0], + initial_state::Union{Vector{Vector{Float64}}, Vector{Float64}, Symbol} = :relevant_steady_state, periods::Int = 40, parameters::ParameterType = nothing, variables::Union{Symbol_input,String_input} = :all_excluding_obc, From 1f6fd4c738060cc92f512f56877c1f818af0cc6e Mon Sep 17 00:00:00 2001 From: Thore Kockerols Date: Wed, 10 Jan 2024 11:00:15 +0100 Subject: [PATCH 25/34] fix init state again --- src/MacroModelling.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MacroModelling.jl b/src/MacroModelling.jl index 14f1d1f5..dffabef9 100644 --- a/src/MacroModelling.jl +++ b/src/MacroModelling.jl @@ -1641,7 +1641,7 @@ end function get_and_check_initial_state(𝓂::ℳ, initial_state::Union{Vector{Vector{Float64}}, Vector{Float64}, Symbol}, reference_steady_state::Vector{Float64}, NSSS::Vector{Float64}, SSS_delta::Vector{Float64}, algorithm::Symbol)::Union{Vector{Vector{Float64}}, Vector{Float64}} - if initial_state isa Symbol + if initial_state isa Symbol if initial_state ∈ [:relevant_SS, :relevant_ss, :relevant_steady_state] if algorithm == :pruned_second_order init_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars) - SSS_delta] @@ -1675,6 +1675,8 @@ function get_and_check_initial_state(𝓂::ℳ, initial_state::Union{Vector{Vect elseif initial_state isa Vector{Vector{Float64}} if algorithm ∉ [:pruned_second_order, :pruned_third_order] @assert initial_state isa Vector{Float64} "The solution algorithm has one state vector: initial_state must be a Vector{Float64}." + else + init_state = initial_state end end From e36aa1f0c64482994197e782d4a62da4986686fa Mon Sep 17 00:00:00 2001 From: Thore Kockerols Date: Wed, 10 Jan 2024 11:50:12 +0100 Subject: [PATCH 26/34] wanr not fail if no SSS --- src/MacroModelling.jl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/MacroModelling.jl b/src/MacroModelling.jl index dffabef9..3f8137d6 100644 --- a/src/MacroModelling.jl +++ b/src/MacroModelling.jl @@ -3568,7 +3568,7 @@ function solve!(𝓂::ℳ; stochastic_steady_state, converged, SS_and_pars, solution_error, ∇₁, ∇₂, 𝐒₁, 𝐒₂ = calculate_second_order_stochastic_steady_state(𝓂.parameter_values, 𝓂, verbose = verbose) - @assert converged "Solution does not have a stochastic steady state. Try reducing shock sizes by multiplying them with a number < 1." + if !converged @warn "Solution does not have a stochastic steady state. Try reducing shock sizes by multiplying them with a number < 1." end state_update₂ = function(state::Vector{T}, shock::Vector{S}) where {T,S} aug_state = [state[𝓂.timings.past_not_future_and_mixed_idx] @@ -3601,7 +3601,7 @@ function solve!(𝓂::ℳ; stochastic_steady_state, converged, SS_and_pars, solution_error, ∇₁, ∇₂, 𝐒₁, 𝐒₂ = calculate_second_order_stochastic_steady_state(𝓂.parameter_values, 𝓂, verbose = verbose, pruning = true) - @assert converged "Solution does not have a stochastic steady state. Try reducing shock sizes by multiplying them with a number < 1." + if !converged @warn "Solution does not have a stochastic steady state. Try reducing shock sizes by multiplying them with a number < 1." end state_update₂ = function(pruned_states::Vector{Vector{T}}, shock::Vector{S}) where {T,S} aug_state₁ = [pruned_states[1][𝓂.timings.past_not_future_and_mixed_idx]; 1; shock] @@ -3632,7 +3632,7 @@ function solve!(𝓂::ℳ; if ((:third_order == algorithm) && ((:third_order ∈ 𝓂.solution.outdated_algorithms) || (obc && obc_not_solved))) stochastic_steady_state, converged, SS_and_pars, solution_error, ∇₁, ∇₂, ∇₃, 𝐒₁, 𝐒₂, 𝐒₃ = calculate_third_order_stochastic_steady_state(𝓂.parameter_values, 𝓂, verbose = verbose) - @assert converged "Solution does not have a stochastic steady state. Try reducing shock sizes by multiplying them with a number < 1." + if !converged @warn "Solution does not have a stochastic steady state. Try reducing shock sizes by multiplying them with a number < 1." end state_update₃ = function(state::Vector{T}, shock::Vector{S}) where {T,S} aug_state = [state[𝓂.timings.past_not_future_and_mixed_idx] @@ -3664,7 +3664,7 @@ function solve!(𝓂::ℳ; stochastic_steady_state, converged, SS_and_pars, solution_error, ∇₁, ∇₂, ∇₃, 𝐒₁, 𝐒₂, 𝐒₃ = calculate_third_order_stochastic_steady_state(𝓂.parameter_values, 𝓂, verbose = verbose, pruning = true) - @assert converged "Solution does not have a stochastic steady state. Try reducing shock sizes by multiplying them with a number < 1." + if !converged @warn "Solution does not have a stochastic steady state. Try reducing shock sizes by multiplying them with a number < 1." end state_update₃ = function(pruned_states::Vector{Vector{T}}, shock::Vector{S}) where {T,S} aug_state₁ = [pruned_states[1][𝓂.timings.past_not_future_and_mixed_idx]; 1; shock] @@ -4390,7 +4390,7 @@ function SSS_third_order_parameter_derivatives(parameters::Vector{ℱ.Dual{Z,S,N params[parameters_idx] = parameters SSS = calculate_third_order_stochastic_steady_state(params, 𝓂, verbose = verbose, pruning = pruning) - @assert SSS[2] "Solution does not have a stochastic steady state. Try reducing shock sizes by multiplying them with a number < 1." + if !SSS[2] @warn "Solution does not have a stochastic steady state. Try reducing shock sizes by multiplying them with a number < 1." end return SSS end @@ -4403,7 +4403,7 @@ function SSS_third_order_parameter_derivatives(parameters::ℱ.Dual{Z,S,N}, para params[parameters_idx] = parameters SSS = calculate_third_order_stochastic_steady_state(params, 𝓂, verbose = verbose, pruning = pruning) - @assert SSS[2] "Solution does not have a stochastic steady state. Try reducing shock sizes by multiplying them with a number < 1." + if !SSS[2] @warn "Solution does not have a stochastic steady state. Try reducing shock sizes by multiplying them with a number < 1." end return SSS end @@ -4416,7 +4416,7 @@ function SSS_second_order_parameter_derivatives(parameters::Vector{ℱ.Dual{Z,S, params[parameters_idx] = parameters SSS = calculate_second_order_stochastic_steady_state(params, 𝓂, verbose = verbose, pruning = pruning) - @assert SSS[2] "Solution does not have a stochastic steady state. Try reducing shock sizes by multiplying them with a number < 1." + if !SSS[2] @warn "Solution does not have a stochastic steady state. Try reducing shock sizes by multiplying them with a number < 1." end return SSS end @@ -4429,7 +4429,7 @@ function SSS_second_order_parameter_derivatives(parameters::ℱ.Dual{Z,S,N}, par params[parameters_idx] = parameters SSS = calculate_second_order_stochastic_steady_state(params, 𝓂, verbose = verbose, pruning = pruning) - @assert SSS[2] "Solution does not have a stochastic steady state. Try reducing shock sizes by multiplying them with a number < 1." + if !SSS[2] @warn "Solution does not have a stochastic steady state. Try reducing shock sizes by multiplying them with a number < 1." end return SSS end From 569e11da9696c8a5ae358fdb740a865fd612eb8d Mon Sep 17 00:00:00 2001 From: Thore Kockerols Date: Thu, 11 Jan 2024 09:56:39 +0100 Subject: [PATCH 27/34] no nsss throws error --- src/get_functions.jl | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/get_functions.jl b/src/get_functions.jl index bc824669..cce9c8e1 100644 --- a/src/get_functions.jl +++ b/src/get_functions.jl @@ -1238,9 +1238,7 @@ function get_eigenvalues(𝓂::ℳ; SS_and_pars, (solution_error, iters) = 𝓂.SS_solve_func(𝓂.parameter_values, 𝓂, verbose, false, 𝓂.solver_parameters) - if solution_error > tol - @warn "Could not find non-stochastic steady state." - end + @assert solution_error < tol "Could not find non-stochastic steady state." ∇₁ = calculate_jacobian(𝓂.parameter_values, SS_and_pars, 𝓂) |> Matrix @@ -1367,9 +1365,7 @@ function get_steady_state(𝓂::ℳ; SS, (solution_error, iters) = 𝓂.SS_solve_func(𝓂.parameter_values, 𝓂, verbose, false, 𝓂.solver_parameters, false, 𝓂.solver_parameters) # SS, solution_error = 𝓂.solution.outdated_NSSS ? 𝓂.SS_solve_func(𝓂.parameter_values, 𝓂, verbose) : (copy(𝓂.solution.non_stochastic_steady_state), eps()) - if solution_error > tol - @warn "Could not find non-stochastic steady state." - end + @assert solution_error < tol "Could not find non-stochastic steady state." if stochastic if algorithm == :third_order From 8cbd9e6d4187a89b4d807771b19a5dcd342722e8 Mon Sep 17 00:00:00 2001 From: thorek1 Date: Fri, 12 Jan 2024 13:35:21 +0100 Subject: [PATCH 28/34] try and fix plot_solutions --- src/MacroModelling.jl | 32 +++++++++++++++++++++++++++----- src/plotting.jl | 33 +++++++++++++++++++-------------- 2 files changed, 46 insertions(+), 19 deletions(-) diff --git a/src/MacroModelling.jl b/src/MacroModelling.jl index 3f8137d6..619abfbd 100644 --- a/src/MacroModelling.jl +++ b/src/MacroModelling.jl @@ -1651,14 +1651,36 @@ function get_and_check_initial_state(𝓂::ℳ, initial_state::Union{Vector{Vect init_state = zeros(𝓂.timings.nVars) - SSS_delta end elseif initial_state ∈ [:SSS, :sss, :stochastic_steady_state] - if algorithm ∈ [:second_order, :pruned_second_order, :third_order, :pruned_third_order] + if algorithm ∈ [:second_order, :third_order] init_state = zeros(𝓂.timings.nVars) - SSS_delta - else + elseif algorithm == :pruned_second_order + init_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars) - SSS_delta] + elseif algorithm == :pruned_third_order + init_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars) - SSS_delta, zeros(𝓂.timings.nVars)] + else @warn "Algorithm: $algorithm has no stochastic steady state. Continuing with the non stochastic steady state as the initial state." init_state = zeros(𝓂.timings.nVars) end elseif initial_state ∈ [:NSSS, :nsss, :non_stochastic_steady_state] - init_state = zeros(𝓂.timings.nVars) + if algorithm == :pruned_second_order + init_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars)] + elseif algorithm == :pruned_third_order + init_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars)] + else + init_state = zeros(𝓂.timings.nVars) + end + elseif initial_state == :mean + if algorithm == :pruned_second_order + mean = calculate_second_order_moments(𝓂.parameter_values, 𝓂; covariance = false)[1] + init_state = [zeros(𝓂.timings.nVars), mean - NSSS] + elseif algorithm == :pruned_third_order + mean = calculate_second_order_moments(𝓂.parameter_values, 𝓂; covariance = false)[1] + init_state = [zeros(𝓂.timings.nVars), mean - NSSS, zeros(𝓂.timings.nVars)] + elseif algorithm == :first_order + init_state = zeros(𝓂.timings.nVars) + else + @assert algorithm ∈ [:first_order, :pruned_second_order, :pruned_third_order] "Mean only available for first order, pruned second order, or pruned third order solution." + end else @assert initial_state ∈ [:NSSS, :nsss, :non_stochastic_steady_state, :SSS, :sss, :stochastic_steady_state, :relevant_SS, :relevant_ss, :relevant_steady_state] "No valid input of type Symbol." end @@ -1666,9 +1688,9 @@ function get_and_check_initial_state(𝓂::ℳ, initial_state::Union{Vector{Vect if initial_state isa Vector{Float64} if algorithm == :pruned_second_order - init_state = [initial_state - reference_steady_state[1:𝓂.timings.nVars], zeros(𝓂.timings.nVars) - SSS_delta] + init_state = [initial_state - NSSS, zeros(𝓂.timings.nVars) - SSS_delta] elseif algorithm == :pruned_third_order - init_state = [initial_state - reference_steady_state[1:𝓂.timings.nVars], zeros(𝓂.timings.nVars) - SSS_delta, zeros(𝓂.timings.nVars)] + init_state = [initial_state - NSSS, zeros(𝓂.timings.nVars) - SSS_delta, zeros(𝓂.timings.nVars)] else init_state = initial_state - NSSS end diff --git a/src/plotting.jl b/src/plotting.jl index 04c30515..6a527f5c 100644 --- a/src/plotting.jl +++ b/src/plotting.jl @@ -1011,6 +1011,7 @@ function plot_solution(𝓂::ℳ, variables::Union{Symbol_input,String_input} = :all, algorithm::Union{Symbol,Vector{Symbol}} = :first_order, σ::Union{Int64,Float64} = 2, + initial_state::Union{Vector{Vector{Float64}}, Vector{Float64}, Symbol} = :relevant_steady_state, parameters::ParameterType = nothing, ignore_obc::Bool = false, show_plots::Bool = true, @@ -1111,14 +1112,18 @@ function plot_solution(𝓂::ℳ, full_NSSS = [length(a) > 1 ? string(a[1]) * "{" * join(a[2],"}{") * "}" * (a[end] isa Symbol ? string(a[end]) : "") : string(a[1]) for a in full_NSSS_decomposed] end - relevant_SS_dictionnary = Dict{Symbol,Vector{Float64}}() + initial_state_dictionnary = Dict{Symbol, Vector{Float64}}() for a in algorithm - relevant_SS = get_steady_state(𝓂, algorithm = a, return_variables_only = true, derivatives = false) - - full_SS = [s ∈ 𝓂.exo_present ? 0 : relevant_SS(s) for s in full_NSSS] + reference_steady_state, NSSS, SSS_delta = get_relevant_steady_states(𝓂, a) + + init_state = get_and_check_initial_state(𝓂, initial_state, reference_steady_state, NSSS, SSS_delta, a) - push!(relevant_SS_dictionnary, a => full_SS) + if a ∈ [:pruned_second_order, :pruned_third_order] + push!(initial_state_dictionnary, a => NSSS + init_state[2]) + else + push!(initial_state_dictionnary, a => NSSS + init_state) + end end if :first_order ∉ algorithm @@ -1126,7 +1131,7 @@ function plot_solution(𝓂::ℳ, full_SS = [s ∈ 𝓂.exo_present ? 0 : relevant_SS(s) for s in full_NSSS] - push!(relevant_SS_dictionnary, :first_order => full_SS) + push!(initial_state_dictionnary, :first_order => full_SS) end StatsPlots.scatter!(fill(0,1,1), @@ -1143,25 +1148,25 @@ function plot_solution(𝓂::ℳ, has_impact_dict = Dict() variable_dict = Dict() - NSSS = relevant_SS_dictionnary[:first_order] + NSSS = initial_state_dictionnary[:first_order] all_states = sort(union(𝓂.var,𝓂.aux,𝓂.exo_present)) for a in algorithm - SSS_delta = collect(NSSS - relevant_SS_dictionnary[a]) + SSS_delta = collect(NSSS - initial_state_dictionnary[a]) var_state_range = [] for x in state_range if a == :pruned_second_order - initial_state = [state_selector * x, -SSS_delta] + init_st = [state_selector * x, -SSS_delta] elseif a == :pruned_third_order - initial_state = [state_selector * x, -SSS_delta, zeros(length(all_states))] + init_st = [state_selector * x, -SSS_delta, zeros(length(all_states))] else - initial_state = collect(relevant_SS_dictionnary[a]) .+ state_selector * x + init_st = collect(initial_state_dictionnary[a]) .+ state_selector * x end - push!(var_state_range, get_irf(𝓂, algorithm = a, periods = 1, ignore_obc = ignore_obc, initial_state = initial_state, shocks = :none, levels = true, variables = :all)[:,1,1] |> collect) + push!(var_state_range, get_irf(𝓂, algorithm = a, periods = 1, ignore_obc = ignore_obc, initial_state = init_st, shocks = :none, levels = true, variables = :all)[:,1,1] |> collect) end var_state_range = hcat(var_state_range...) @@ -1204,7 +1209,7 @@ function plot_solution(𝓂::ℳ, Pl = StatsPlots.plot() for a in algorithm - StatsPlots.plot!(state_range .+ relevant_SS_dictionnary[a][indexin([state],all_states)][1], + StatsPlots.plot!(state_range .+ initial_state_dictionnary[a][indexin([state],all_states)][1], variable_dict[a][k][1,:], ylabel = replace_indices_in_symbol(k)*"₍₀₎", xlabel = replace_indices_in_symbol(state)*"₍₋₁₎", @@ -1212,7 +1217,7 @@ function plot_solution(𝓂::ℳ, end for a in algorithm - StatsPlots.scatter!([relevant_SS_dictionnary[a][indexin([state], all_states)][1]], [relevant_SS_dictionnary[a][indexin([k], all_states)][1]], + StatsPlots.scatter!([initial_state_dictionnary[a][indexin([state], all_states)][1]], [initial_state_dictionnary[a][indexin([k], all_states)][1]], label = "") end From 8953acc9be8e998047373e349d0abd17cc0ce0ca Mon Sep 17 00:00:00 2001 From: Thore Kockerols Date: Fri, 12 Jan 2024 17:42:16 +0100 Subject: [PATCH 29/34] adjust init state func --- src/MacroModelling.jl | 46 +++++++++++-------------------------------- 1 file changed, 12 insertions(+), 34 deletions(-) diff --git a/src/MacroModelling.jl b/src/MacroModelling.jl index 619abfbd..092f8519 100644 --- a/src/MacroModelling.jl +++ b/src/MacroModelling.jl @@ -1643,39 +1643,17 @@ end function get_and_check_initial_state(𝓂::ℳ, initial_state::Union{Vector{Vector{Float64}}, Vector{Float64}, Symbol}, reference_steady_state::Vector{Float64}, NSSS::Vector{Float64}, SSS_delta::Vector{Float64}, algorithm::Symbol)::Union{Vector{Vector{Float64}}, Vector{Float64}} if initial_state isa Symbol if initial_state ∈ [:relevant_SS, :relevant_ss, :relevant_steady_state] - if algorithm == :pruned_second_order - init_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars) - SSS_delta] - elseif algorithm == :pruned_third_order - init_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars) - SSS_delta, zeros(𝓂.timings.nVars)] - else - init_state = zeros(𝓂.timings.nVars) - SSS_delta - end + init_state = zeros(𝓂.timings.nVars) - SSS_delta elseif initial_state ∈ [:SSS, :sss, :stochastic_steady_state] - if algorithm ∈ [:second_order, :third_order] - init_state = zeros(𝓂.timings.nVars) - SSS_delta - elseif algorithm == :pruned_second_order - init_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars) - SSS_delta] - elseif algorithm == :pruned_third_order - init_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars) - SSS_delta, zeros(𝓂.timings.nVars)] - else + init_state = zeros(𝓂.timings.nVars) - SSS_delta + + if algorithm ∈ [:second_order, :third_order, :pruned_second_order, :pruned_third_order] @warn "Algorithm: $algorithm has no stochastic steady state. Continuing with the non stochastic steady state as the initial state." init_state = zeros(𝓂.timings.nVars) end elseif initial_state ∈ [:NSSS, :nsss, :non_stochastic_steady_state] - if algorithm == :pruned_second_order - init_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars)] - elseif algorithm == :pruned_third_order - init_state = [zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars), zeros(𝓂.timings.nVars)] - else - init_state = zeros(𝓂.timings.nVars) - end + init_state = zeros(𝓂.timings.nVars) elseif initial_state == :mean - if algorithm == :pruned_second_order - mean = calculate_second_order_moments(𝓂.parameter_values, 𝓂; covariance = false)[1] - init_state = [zeros(𝓂.timings.nVars), mean - NSSS] - elseif algorithm == :pruned_third_order - mean = calculate_second_order_moments(𝓂.parameter_values, 𝓂; covariance = false)[1] - init_state = [zeros(𝓂.timings.nVars), mean - NSSS, zeros(𝓂.timings.nVars)] elseif algorithm == :first_order init_state = zeros(𝓂.timings.nVars) else @@ -1687,13 +1665,7 @@ function get_and_check_initial_state(𝓂::ℳ, initial_state::Union{Vector{Vect end if initial_state isa Vector{Float64} - if algorithm == :pruned_second_order - init_state = [initial_state - NSSS, zeros(𝓂.timings.nVars) - SSS_delta] - elseif algorithm == :pruned_third_order - init_state = [initial_state - NSSS, zeros(𝓂.timings.nVars) - SSS_delta, zeros(𝓂.timings.nVars)] - else - init_state = initial_state - NSSS - end + init_state = initial_state - NSSS elseif initial_state isa Vector{Vector{Float64}} if algorithm ∉ [:pruned_second_order, :pruned_third_order] @assert initial_state isa Vector{Float64} "The solution algorithm has one state vector: initial_state must be a Vector{Float64}." @@ -1702,6 +1674,12 @@ function get_and_check_initial_state(𝓂::ℳ, initial_state::Union{Vector{Vect end end + if algorithm == :pruned_second_order + init_state = [zeros(𝓂.timings.nVars), init_state] + elseif algorithm == :pruned_third_order + init_state = [zeros(𝓂.timings.nVars), init_state, zeros(𝓂.timings.nVars)] + end + return init_state end From 335d88aa1016d89c4039e789029ee0a352e3220d Mon Sep 17 00:00:00 2001 From: Thore Kockerols Date: Fri, 12 Jan 2024 17:45:28 +0100 Subject: [PATCH 30/34] amend plot solution --- src/plotting.jl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plotting.jl b/src/plotting.jl index 6a527f5c..95104547 100644 --- a/src/plotting.jl +++ b/src/plotting.jl @@ -1010,7 +1010,7 @@ function plot_solution(𝓂::ℳ, state::Union{Symbol,String}; variables::Union{Symbol_input,String_input} = :all, algorithm::Union{Symbol,Vector{Symbol}} = :first_order, - σ::Union{Int64,Float64} = 2, + σ::Union{Int64,Float64,KeyedArray{Float64}} = 2, initial_state::Union{Vector{Vector{Float64}}, Vector{Float64}, Symbol} = :relevant_steady_state, parameters::ParameterType = nothing, ignore_obc::Bool = false, @@ -1071,7 +1071,11 @@ function plot_solution(𝓂::ℳ, vars_to_plot = intersect(axiskeys(SS_and_std[1])[1],𝓂.timings.var[var_idx]) - state_range = collect(range(-SS_and_std[2](state), SS_and_std[2](state), 100)) * σ + if typeof(σ) in [Int, Float64] + state_range = collect(range(-SS_and_std[2](state), SS_and_std[2](state), 100)) * σ + else + state_range = collect(range(-σ(state), σ(state), 100)) + end state_selector = state .== 𝓂.timings.var From ca091a375028c3797346712626e03c18778dc947 Mon Sep 17 00:00:00 2001 From: thorek1 Date: Fri, 12 Jan 2024 19:59:19 +0100 Subject: [PATCH 31/34] more tested models --- test/test_cycles.jl | 169 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 167 insertions(+), 2 deletions(-) diff --git a/test/test_cycles.jl b/test/test_cycles.jl index a5141be5..cbf5ff54 100644 --- a/test/test_cycles.jl +++ b/test/test_cycles.jl @@ -1,6 +1,171 @@ using MacroModelling, StatsPlots -import LinearAlgebra as ℒ -import RecursiveFactorization as RF +# import LinearAlgebra as ℒ +# import RecursiveFactorization as RF +# import MacroModelling: ParameterType, ℳ + +include("models/RBC_CME.jl") + +@model RBC_habit_invest_adjust begin + λ²[0] = β * ((1 - δ) * λ²[1] + λ¹[1] * r[1]) + + λ¹[0] * W[0] + (-1 + μ) * (1 - L[0])^(-μ) * (C[0] - h * C[-1])^μ * ((1 - L[0])^(1 - μ) * (C[0] - h * C[-1])^μ)^(-η) = 0 + + -λ¹[0] + λ²[0] * (1 - 0.5 * φ * (-1 + I[-1]^-1 * I[0])^2 - φ * I[-1]^-1 * I[0] * (-1 + I[-1]^-1 * I[0])) + β * φ * I[0]^-2 * λ²[1] * I[1]^2 * (-1 + I[0]^-1 * I[1]) = 0 + + -λ¹[0] - β * μ * h * (1 - L[1])^(1 - μ) * (C[1] - h * C[0])^(-1 + μ) * ((1 - L[1])^(1 - μ) * (C[1] - h * C[0])^μ)^(-η) + μ * (1 - L[0])^(1 - μ) * (C[0] - h * C[-1])^(-1 + μ) * ((1 - L[0])^(1 - μ) * (C[0] - h * C[-1])^μ)^(-η) = 0 + + r[0] = α * Z[0] * K[-1]^(-1 + α) * L[0]^(1 - α) + + W[0] = Z[0] * (1 - α) * K[-1]^α * L[0]^(-α) + + Y[0] = Z[0] * K[-1]^α * L[0]^(1 - α) + + C[0] + I[0] = Y[0] + + K[0] = K[-1] * (1 - δ) + I[0] * (1 - φ / 2 * (1 - I[0] / I[-1])^2) + + Z[0] = exp(ϵᶻ[x] + σᶻ * log(Z[-1])) + + U[0] = β * U[1] + (1 - η)^-1 * ((1 - L[0])^(1 - μ) * (C[0] - h * C[-1])^μ)^(1 - η) +end + +@parameters RBC_habit_invest_adjust begin + σᶻ = 0.066 + 0.36 * Y[ss] = r[ss] * K[ss] | α + β = 0.99 + δ = 0.025 + η = 2 + # μ = 0.3 + h = 0.57 + ϕ = 0.95 + φ = 6.771 + + # σᵍ + # ḡ | ḡ = g_y * y[ss] + + # δ = i_y / k_y + + # β = 1 / (α / k_y + (1 - δ)) + + μ | L[ss] = 1/3 +end + +SS(RBC_habit_invest_adjust) + +get_eigenvalues(RBC_habit_invest_adjust) + +using StatsPlots +plot_irf(RBC_habit_invest_adjust, parameters = :φ => 5, algorithm = :second_order) +plot_solution(RBC_habit_invest_adjust, :I, parameters = :φ => 4.2, algorithm = :second_order) +plot_solution(RBC_habit_invest_adjust, :I, parameters = (:φ => 5., :h => .6), algorithm = :second_order) + +plot_irf(RBC_habit_invest_adjust, parameters = (:φ => 5.2, :h => .6), algorithm = :second_order) + + +get_eigenvalues(RBC_habit_invest_adjust, parameters = (:φ => 100., :h => .9900)) + + + +# plot_solution(m, :k, algorithm = :pruned_second_order, σ = 10) +# mn = get_mean(m, derivatives = false) +# SS(m, derivatives = false) +# SSS(m, derivatives = false, algorithm = :pruned_second_order) +mn = get_mean(m, derivatives = false, algorithm = :pruned_second_order) +# plot_solution(m, :k, algorithm = :pruned_second_order, σ = 1, initial_state = :nsss, parameters = :std_eps => .1) +# plot_solution(m, :k, algorithm = :pruned_second_order, σ = 1, initial_state = :sss, parameters = :std_eps => .1) +# plot_solution(m, :k, algorithm = :pruned_second_order, σ = 1, initial_state = :mean, parameters = :std_eps => .1) +plot_solution(m, :k, algorithm = :pruned_second_order, σ = 1, initial_state = collect(mn), parameters = :std_eps => .1) + + +plot_solution(m, :k, algorithm = :pruned_second_order, σ = 1, initial_state = collect(.9*mn), parameters = :std_eps => .1) + +plot_solution(m, :k, algorithm = [:pruned_second_order, :pruned_third_order])#, initial_state = :NSSS) +plot_irf(m, algorithm = :pruned_second_order, shocks = :eps_z) +plot_irf(m, algorithm = :pruned_second_order, shocks = :eps_z, initial_state = :NSSS) +plot_irf(m, algorithm = :pruned_second_order, shocks = :eps_z, initial_state = :mean) + +get_irf(m, shocks = :none) +get_irf(m) +get_irf(m, levels = false) + + +plot_irf(m) +plot_irf(m, algorithm = :second_order, initial_state = :NSSS, parameters = :std_eps => .1) +plot_irf(m, algorithm = :second_order, initial_state = :SSS, parameters = :std_eps => .1) +get_irf(m, shocks = :none) +get_irf(m, algorithm = :second_order) +get_irf(m, algorithm = :second_order, initial_state = :NSSS) +get_irf(m, algorithm = :second_order, initial_state = :SSS) +SS(m) +SSS(m) +1 + +# 𝑺₁ = RBC.solution.perturbation.first_order.solution_matrix +# T = RBC.timings +# 𝑺₁[:,1:T.nPast_not_future_and_mixed] + +# S1 = zeros(T.nVars,T.nVars) + +# S1[:,T.past_not_future_and_mixed_idx] = 𝑺₁[:,1:T.nPast_not_future_and_mixed] +# import LinearAlgebra as ℒ +# eigen(S1) + + +# get_eigenvalues(RBC) +# 𝓂 = RBC + +# function get_eigenvalues(𝓂::ℳ; +# parameters::ParameterType = nothing, +# verbose::Bool = false, +# tol::AbstractFloat = eps()) +# solve!(𝓂, parameters = parameters, verbose = verbose, dynamics = true) + +# SS_and_pars, (solution_error, iters) = 𝓂.SS_solve_func(𝓂.parameter_values, 𝓂, verbose, false, 𝓂.solver_parameters) + +# if solution_error > tol +# @warn "Could not find non-stochastic steady state." +# end + +# ∇₁ = calculate_jacobian(𝓂.parameter_values, SS_and_pars, 𝓂) |> Matrix + +# T = 𝓂.timings + +# ∇₊ = @view ∇₁[:,1:T.nFuture_not_past_and_mixed] +# ∇₀ = @view ∇₁[:,T.nFuture_not_past_and_mixed .+ range(1, T.nVars)] +# ∇₋ = @view ∇₁[:,T.nFuture_not_past_and_mixed + T.nVars .+ range(1, T.nPast_not_future_and_mixed)] + +# Q = ℒ.qr(collect(∇₀[:,T.present_only_idx])) +# Qinv = Q.Q' + +# A₊ = Qinv * ∇₊ +# A₀ = Qinv * ∇₀ +# A₋ = Qinv * ∇₋ + +# dynIndex = T.nPresent_only+1:T.nVars + +# Ã₊ = @view A₊[dynIndex,:] +# Ã₋ = @view A₋[dynIndex,:] +# Ã₀₊ = @view A₀[dynIndex, T.future_not_past_and_mixed_idx] +# Ã₀₋ = @views A₀[dynIndex, T.past_not_future_idx] * ℒ.diagm(ones(T.nPast_not_future_and_mixed))[T.not_mixed_in_past_idx,:] + +# Z₊ = zeros(T.nMixed,T.nFuture_not_past_and_mixed) +# I₊ = @view ℒ.diagm(ones(T.nFuture_not_past_and_mixed))[T.mixed_in_future_idx,:] + +# Z₋ = zeros(T.nMixed,T.nPast_not_future_and_mixed) +# I₋ = @view ℒ.diagm(ones(T.nPast_not_future_and_mixed))[T.mixed_in_past_idx,:] + +# D = vcat(hcat(Ã₀₋, Ã₊), hcat(I₋, Z₊)) +# E = vcat(hcat(-Ã₋,-Ã₀₊), hcat(Z₋, I₊)) + +# eigvals = ℒ.eigen(E,D).values + +# return KeyedArray(hcat(reim(eigvals)...); Eigenvalue = 1:length(eigs[1]), Parts = [:Real,:Imaginary]) +# end + +eigs = get_eigenvalues(m) + + +KeyedArray(hcat(eigs...); Eigenvalue = 1:length(eigs[1]), Parts = [:Real,:Imaginary]) @model reduced_form begin K[0] = (1 - δ) * K[-1] + I[-1] From 0c473858cb768c85e712f62ec937b80ca713a924 Mon Sep 17 00:00:00 2001 From: Thore Kockerols Date: Fri, 12 Jan 2024 20:00:48 +0100 Subject: [PATCH 32/34] Create cycles_pluto.jl --- test/cycles_pluto.jl | 612 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 612 insertions(+) create mode 100644 test/cycles_pluto.jl diff --git a/test/cycles_pluto.jl b/test/cycles_pluto.jl new file mode 100644 index 00000000..aa2b86d0 --- /dev/null +++ b/test/cycles_pluto.jl @@ -0,0 +1,612 @@ +### A Pluto.jl notebook ### +# v0.19.36 + +using Markdown +using InteractiveUtils + +# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error). +macro bind(def, element) + quote + local iv = try Base.loaded_modules[Base.PkgId(Base.UUID("6e696c72-6542-2067-7265-42206c756150"), "AbstractPlutoDingetjes")].Bonds.initial_value catch; b -> missing; end + local el = $(esc(element)) + global $(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : iv(el) + el + end +end + +# ╔═╡ bad5a8f1-fdf0-47f4-98e5-25f8ec03426b +import Pkg; Pkg.activate("D:\\CustomTools\\MacroModelling.jl-cycles")#; Pkg.add("PlutoUI") + +# ╔═╡ 1989ec7e-8d47-11ee-13a7-87c968f56766 +using MacroModelling + +# ╔═╡ d450c895-1433-4fcc-9905-1c18879e49ec +using PlutoUI + +# ╔═╡ 10aca7df-6bb3-4dfc-86e0-a431107ea716 +using Random + +# ╔═╡ c762bf37-305b-463e-b573-6befd69288ee +using LinearAlgebra + +# ╔═╡ 8fc6e932-6d22-46c3-8ad6-b26684c38fa1 +show_pluto(x) = Text(sprint(show, "text/plain",x)); + +# ╔═╡ 97ff64bd-961f-43c3-b46d-f3b17e1aabd2 +import StatsPlots + +# ╔═╡ ea44d30c-2591-43b5-9cbf-ee301bb14020 +import LinearAlgebra as ℒ + +# ╔═╡ 1c646fb3-8f43-440f-834e-9c4e239bd5ad +md"# An RBC model with habit formation and a nonlinaer autoregressive investment process." + +# ╔═╡ 2bdbbaf9-03dd-4492-abf4-ff7aca63e19e +@model RBC_baselin begin + λ[0] = (c[0] - h * c[-1]) ^ (-σ) - β * h * (c[1] - h * c[0]) ^ (-σ) + + λ[0] = β * λ[1] * (α * z[1] * (k[0] / l[1]) ^ (α - 1) + 1 - δ) + + ψ / (1 - l[0]) = λ[0] * w[0] + + k[0] = (1 - δ) * k[-1] + i[0] + G[0] + + G[0] = a3 * (i[-1] - i[ss]) ^ 3 + a2 * (i[-1] - i[ss]) ^ 2 + a1 * (i[-1] - i[ss]) + + y[0] = c[0] + i[0] + g[0] + + y[0] = z[0] * k[-1] ^ α * l[0] ^ (1 - α) + + w[0] = y[0] * (1 - α) / l[0] + + r[0] = y[0] * α * 4 / k[-1] + + z[0] = (1 - ρᶻ) + ρᶻ * z[-1] + σᶻ * ϵᶻ[x] + + g[0] = (1 - ρᵍ) * ḡ + ρᵍ * g[-1] + σᵍ * ϵᵍ[x] + +end + +# ╔═╡ f5983385-9164-4509-bc44-ab3043d379cf +@parameters RBC_baselin begin + a1 = 0.0005 + + a2 = 0.999 + + a3 = 0 + + h = .5 + + σᶻ = 0.066 + + σᵍ = .104 + + σ = 1 + + α = 1/3 + + i_y = 0.25 + + k_y = 10.4 + + ρᶻ = 0.97 + + ρᵍ = 0.989 + + g_y = 0.2038 + + ḡ | ḡ = g_y * y[ss] + + δ = i_y / k_y + + β = 1 / (α / k_y + (1 - δ)) + + ψ | l[ss] = 1/3 +end + +# ╔═╡ d61dd34b-7765-4cac-b610-4e7e1031a9e8 +md"This model has a reduced form nonlinear structure driving I and thereby K." + +# ╔═╡ 534226bf-cfef-4fd0-b40a-f9a3db201e64 +get_SS(RBC_baselin) |> show_pluto + +# ╔═╡ c365b37a-bef3-4a0d-96aa-3af2db6180ca +md"We approximate around a non-zero non stochastic steady state (NSSS)." + +# ╔═╡ dc224752-f3e2-489a-992d-101925299105 +get_solution(RBC_baselin) |> show_pluto + +# ╔═╡ 382b69e7-f843-47ac-8bb2-33912bfaa473 +MacroModelling.get_eigenvalues(RBC_baselin) |> show_pluto + +# ╔═╡ 38d40765-66d8-44a0-af2e-bffad2733994 +RBC_baselin + +# ╔═╡ fc8d5002-3d29-45ec-9665-2cd863b4a748 + + +# ╔═╡ 1508faa7-3e2e-4f3a-90e1-6616b1544610 +md"## Plotting" + +# ╔═╡ ac41c574-c53e-4127-918b-5be4040cc601 +md"h = .292 and a1 = 92.893 gives interesting results" + +# ╔═╡ d127d880-bf08-408d-b67d-e13ec65d7b66 +@bind h Slider(.29:.0005:.31, default = 0.292) + +# ╔═╡ 18c1c69a-6b00-41a5-af68-6e7b4853abf3 +h + +# ╔═╡ 383372a0-dc81-4343-bff8-74fe688e96e1 +@bind a1 Slider(0:.001:100, default = 92.893) + +# ╔═╡ 2953265e-0e4c-42c9-a933-534361e2bbd5 +a1 + +# ╔═╡ 47901235-dc5d-45a2-908a-b1c00648727c +@bind a2 Slider(6.2:.0001:6.6, default = .00) + +# ╔═╡ 76b30796-b561-43a4-99e1-de09a2e33292 +a2 + +# ╔═╡ f13e7256-b624-41ee-bf4d-aa912875c949 +@bind a3 Slider(-1:.01:1, default = .00) + +# ╔═╡ 9f292898-b6a8-4bc5-827e-6c8b75309c4a +Random.seed!(1) + +# ╔═╡ 7e1fff86-654b-4df0-b875-8135bfbca760 +MacroModelling.get_eigenvalues(RBC_baselin, parameters = (:a1 => a1, :a2 => a2, :a3 => a3, :h => h)) |> show_pluto + +# ╔═╡ ba6174b3-97cb-4a76-a7e6-68c646fdf916 +plot_irf(RBC_baselin, parameters = (:a1 => a1, :a2 => a2, :a3 => a3, :h => h, :σᵍ => .104), algorithm = :second_order, variables = [:i,:c,:k,:y,:l,:w], periods = 120)[1] + +# ╔═╡ 938f34f6-fd79-4fd0-9ad1-82619e2b859f +SSS(RBC_baselin, algorithm = :second_order, derivatives = false, parameters = (:a1 => a1, :a2 => a2, :a3 => a3, :h => h, :σᵍ => .104)) |> show_pluto + +# ╔═╡ 85c6b0cb-5eb1-4fcb-9365-32bca4f35fb8 +stds = get_std(RBC_baselin, derivatives = false, parameters = (:a1 => 0.0, :a2 => a2, :a3 => a3, :h => h, :σᵍ => .104)); + +# ╔═╡ 9c727850-1ff6-435c-8ea4-926206cd7047 +stds |> show_pluto + +# ╔═╡ f882d5b1-7da0-458b-b079-33fbbcebd057 +plot_solution(RBC_baselin, :i, algorithm = :second_order, parameters = (:a1 => 75.0, :a2 => 0.0, :a3 => 0.0, :h => 0.0, :σᵍ => .104), standard_deviations = 5*stds, initial_state = :nsss)[1] + +# ╔═╡ 9ca2fac3-7695-4b82-8f75-b7db5f35d84d +get_std(RBC_baselin, parameters = (:a1 => 40.0, :a2 => a2, :a3 => a3, :h => h, :σᵍ => .104), algorithm = :pruned_second_order, derivatives = false) |> show_pluto + +# ╔═╡ 8beb523a-102b-4474-8044-4e15586c674f +md"## Only second order needed for cycles" + +# ╔═╡ 76c07b1a-0994-47fa-89f9-cc060b51841a +# Generate cyclical time series data +begin + n_quarters = 1000 + cycle_length = 80 + time = 0:(n_quarters - 1) + amperes = 10 * sin.(2 * π * time / cycle_length) + 5 * cos.(2 * π * time / cycle_length) + rand(n_quarters)*1 .+ 10 +end + +# ╔═╡ 0dc35e06-d94f-4f88-9ebe-bbf6e0bf8366 +# Prepare the data for the polynomial model +begin + X = amperes[1:end-1] # Exclude the last point for X + y = amperes[2:end] # Exclude the first point for y + # X_matrix = hcat(X,X.^2, X.^3, ones(length(X))) + # X_matrix = hcat(ones(length(X)), X, X.^2) + X_matrix = hcat( X, X.^2) +end + +# ╔═╡ fdb8b36f-579b-4a9a-81aa-31bc366dce02 +coefficients = (X_matrix' * X_matrix) \ (X_matrix' * y) + +# ╔═╡ c1ec07df-0104-4b0d-816c-03b999cc4609 +begin + # Generate predictions from the model + fitted_series = X_matrix * coefficients + + # Plotting the original and fitted series + StatsPlots.plot(time[1:end-1], X, label="Original Series", title="Cyclical Time Series and Fitted Model", xlabel="Time (Quarters)", ylabel="Amperes") + StatsPlots.plot!(time[1:end-1], fitted_series, label="Fitted Series") +end + +# ╔═╡ 8c877be1-5861-45ac-9087-e9e8c2f7786d +md"## Dewachter and Wouter model" + +# ╔═╡ e63463de-ed39-4b2f-ad9e-2ba217db931d + +@model HeKr_2012 begin + A[0] = 0.05 * cA + 0.95 * A[-1] + cA * σᵉ * esigma[x] # gA[0] + + + # gA[0] = 0.8 * gA[-1] + + # us[0] = log(es[0]) + + usc[0] = es[0] ^ (-cra_usc) + + ERs[0] = cm_ers * cm * theta[0] * (rrs[1] - rf[0]) ^ 2# + riskshock[0] + + es[0] = es[-1] * (1 + cm / cm_es * (R_tilde[0] - 1) - ceta / cm_es - cexit * (es[-1] - es_bar) ^ 2) + es_bar * (cexit * (es[-1] - es_bar) ^ 2 + .0)# + eshock[x] + # es appears to be the reputation + + 0 = ps[0] * ss_bar - h[0] - pbn[0] * b[0] + + Y[0] = A[0] * L[0] ^ calfa * K[0] ^ (1 - calfa) - cfix * Y_bar + + K[0] = (1 - cdelta) * K[-1] + K[-1] * inves[-1] + + inves[0] = cdelta + (Q[0] - 1) / ckappa + + Y[0] = cb[0] + K[0] * inves[0] + K[0] * ckappa * 0.5 * (inves[0] - cdelta) ^ 2 + + K[0] * Q[0] = ps[0] * ss_bar + + theta[0] * h[0] = K[0] * Q[0] + + 1.0 * (es[0] - es_low) * Qes[0] = K[0] * Q[0] + + theta[0] = 1 / (1 - clambda) + (1 - clambda) ^ 2 * Qes[-1] ^ 3 + + ubc[0] = (cb[0] - chab * cb[-1] - clabut / (1 + cinvfe) * L[0] ^ (1 + cinvfe)) ^ (-cgammab) + + ubn[0] = clabut * (cb[0] - chab * cb[-1] - clabut / (1 + cinvfe) * L[0] ^ (1 + cinvfe)) ^ (-cgammab) * L[0] ^ cinvfe + + pbn[0] * b[0] + h[0] + cb[0] + K[0] * (inves[0] - cdelta + ckappa * 0.5 * (inves[0] - cdelta) ^ 2) = wagebill[0] + b[-1] / (1 + pinf[0]) + R_tilde[0] * h[-1] + + wb[0] = h[0] + pbn[0] * b[0] + + ubc[0] * pbf[0] = cbetab * ubc[1] + + pbn[0] * ubc[0] = cbetab * ubc[1] / (1 + pinf[1]) + + wagebill[0] = L[0] * wage[0] + + wage[0] * lagr[0] = K[0] ^ (1 - calfa) * A[0] * calfa * L[0] ^ (calfa - 1) + + winf[0] = cbetas * winf[1] + 0.5 * pinf[-1] - pinf[0] * 0.5 * cbetas + 0.02 * (ubn[0] * clandaw - ubc[0] * wage[0]) / (clandaw * ubn_bar) + + mrs[0] = (ubn[0] * clandaw - ubc[0] * wage[0]) / (clandaw * ubn_bar) + + wage[0] = wage[-1] * (1 + winf[0] - pinf[0]) + + pinf[0] = pinf[1] * cbetas - 0.1 * (lagr[0] - lagr_bar) / lagr_bar + + rn[0] = rf_bar + pinf[0] * 1.50# + exor[0] + + ss_bar * div[0] = Y[0] - K[0] * cdelta - wagebill[0] + + rf[0] = (1 - pbf[0]) / pbf[0] + + rn[0] = (1 - pbn[0]) / pbn[0] + + rs[0] = (div[1] + ps[1] - ps[0]) / ps[0] + + # sigma[0] = csigma * (1 + esigma[x]) + + # riskshock[0] = 0.00 * riskshock[-1] + + # exor[0] = 0.75 * exor[-1] + + # Y_rel[0] = (Y[0] - Y_bar) / Y_bar + + # L_rel[0] = (L[0] - L_bar) / L_bar + + # K_rel[0] = (K[0] - K_bar) / K_bar + + # wage_rel[0] = (wage[0] - wage_bar) / wage_bar + + # inv_rel[0] = K_bar * (K[0] * inves[0] - K_bar * inves_bar) / inves_bar + + # es_rel[0] = (es[0] - es_bar) / es_bar + + # cb_rel[0] = (cb[0] - cb_bar) / cb_bar + + # div_rel[0] = (div[0] - div_bar) / div_bar + + # wb_rel[0] = (wb[0] - wb_bar) / wb_bar + + # ps_rel[0] = (ps[0] - ps_bar) / ps_bar + + # b_rel[0] = (b[0] - b_bar) / b_bar + + # h_rel[0] = (h[0] - h_bar) / h_bar + + # des[0] = (es[0] * gk[-1] - es[-1]) / es[-1] + + # dcb[0] = (cb[0] * gk[-1] - cb[-1]) / cb[-1] + + # dlambdas[0] = log(es[0] ^ (-cgammas)) - log(es[-1] ^ (-cgammas)) + + # dlambdab[0] = log(cb[0] ^ (-cgammab)) - log(cb[-1] ^ (-cgammab)) + + rrs[0] = (ps[0] + div[0] - ps[-1]) / ps[-1] + + ERs[0] = rs[0] - rf[0] + + # ER_tilde[0] = R_tilde[1] + + # ERt[0] = ER_tilde[0] - rf[0] - 1 + + # Evarrs[0] = (rrs[1] - rs[0]) ^ 2 + + # Evarrt[0] = (R_tilde[1] - ER_tilde[0]) ^ 2 + + # Evardlcs[0] = dlambdas[1] ^ 2 + + # EvardlQ[0] = dlQ[1] ^ 2 + + # gk[0] = K[0] / K[-1] + + # EQ[0] = Q[1] + + # dly[0] = 100 * (log(Y[0]) - log(Y[-1])) + + # dlc[0] = 100 * (log(cb[0]) - log(cb[-1])) + + # dli[0] = 100 * (log(K[0] * inves[0]) - log(K[-1] * inves[-1])) + + # dlk[0] = 100 * (log(K[0]) - log(K[-1])) + + # dlh[0] = 100 * (log(h[0]) - log(h[-1])) + + # dlQ[0] = 100 * (log(Q[0]) - log(Q[-1])) + +end + +# ╔═╡ 7cbcbd5c-4203-46c8-be25-14ca8f016eae +@parameters HeKr_2012 begin + σᵉ = 0.0075# 0.75*0.01*2/(nper^0.5) + + nper = 4 + + cbetas = 1/(1+.04/nper) + + cbetab = 1/(1+.04/nper) + + cgammas = 1.0 + + cgammab = 1.0 + + clambda = 0.5 + + cdelta = 0.1/nper + + csigma = 1 + + ckappa = 25 + + cm = 2.5 + + cls = 0.6 + + calfa = 0.6 + + cfix = 0.20 + + cA = (cdelta+1/cbetas-1)/(1-calfa)*(1+cfix) + + chab = 0.300 + + cinvfe = 1.0 + + K_bar = 1 + + L_bar = 1 + + Y_bar = cA*L_bar^calfa*K_bar^(1-calfa)/(1+cfix) + + inves_bar = cdelta + + cb_bar = Y_bar-K_bar*inves_bar + + rf_bar = 1/cbetas-1 + + rs_bar = 1/cbetas-1 + + pbf_bar = 1/(1+rf_bar) + + Q_bar = 1 + + cte = 1. + + es_bar = 1.0 + + es_low = 0.2 + + Qes_bar = Q_bar/(1.0*(es_bar-es_low)) + + theta_bar = 1/(1-clambda)+(1-clambda)^2*Qes_bar^3 + + h_bar = Q_bar/theta_bar + + us_bar = log(es_bar) + + usc_bar = es_bar^(-1) + + ss_bar = 1 + + wagebill_bar = Y_bar-K_bar*inves_bar-rs_bar + + wage_bar = wagebill_bar/L_bar + + lagr_bar = K_bar^(1-calfa)*cA*calfa*1/wage_bar*L_bar^(calfa-1) + + cpsi = wagebill_bar/(K_bar*Q_bar) + + div_bar = (Y_bar-wagebill_bar-K_bar*inves_bar)/ss_bar + + ps_bar = div_bar/rs_bar + + b_bar = (ss_bar*ps_bar-h_bar)/pbf_bar + + clab = 1 + + clabut = wage_bar/L_bar + + ubc_bar = (cb_bar-cb_bar*chab-clab*clabut/(1+cinvfe)*L_bar^(1+cinvfe))^(-cgammab) + + ubn_bar = clabut*(cb_bar-cb_bar*chab-clab*clabut/(1+cinvfe)*L_bar^(1+cinvfe))^(-cgammab)*L_bar^cinvfe + + wb_bar = h_bar+pbf_bar*b_bar + + R_tilde_bar = (-b_bar)/(ss_bar*ps_bar-pbf_bar*b_bar)+(div_bar+ss_bar*ps_bar)/(ss_bar*ps_bar-pbf_bar*b_bar) + + ceta = cm*(R_tilde_bar-1) + + crts = 1 + + cflex = 1 + + shocksize = 0 + + shockper = 0 + + shockvar = 0 + + clandaw = 1 + + cexit = 0.10 + + cra_usc = 1 + + cm_ers = 1.5 + + cm_es = 1.5 + + ubc > 50 + theta > 2.48 + ubn > 2 + R_tilde > 1 + # ER_tilde > 1 + wage < .06 + # us < 1e-5 + lagr > 1.1 + pbn < 1 + pbf < 1 + Y < .1 + h > .4 + b > .6 + rf < .02 + rs < .02 + div < .02 + rrs < .02 +end + +# ╔═╡ f103ce35-74be-4c2c-aee7-691926530174 +plot_irf(HeKr_2012)[1] + +# ╔═╡ b8d0c055-b7ef-4791-a9b6-5af7d07b0e8e +plot_irf(HeKr_2012, algorithm = :pruned_second_order)[1] + +# ╔═╡ 1c3e9adb-ece1-4067-9ac2-2389de62d129 +plot_irf(HeKr_2012, algorithm = :pruned_third_order, parameters = :σᵉ => .001)[1] + +# ╔═╡ 2e50a12d-6aa5-4e91-bc46-06ba71bf82cd +plot_irf(HeKr_2012, algorithm = :third_order, parameters = :σᵉ => .001)[1] + +# ╔═╡ 7e3cc930-8015-43e7-ac18-dc8d1d274c4c +HeKr_2012 + +# ╔═╡ 427b3fd2-a6cb-4a1e-b286-b88596ba2ac5 +get_parameters(HeKr_2012, values = true) |> show_pluto + +# ╔═╡ 0f15c89a-4505-4683-9413-ab2881c11b2e +@bind chab Slider(.01:.01:1.0, default = 0.3) + +# ╔═╡ b4d095bd-61b0-411f-bb08-910c2c5a7804 +chab + +# ╔═╡ 77637b57-ac4d-4459-bbcb-e070378bc1ae +@bind ckappa Slider(5.0:1.0:10000.0, default = 25.0) + +# ╔═╡ d8fc6d1d-7cc5-42b9-b3c7-33d9666cba2d +ckappa + +# ╔═╡ 299b0366-a510-438b-bb41-c0ef679f2403 +@bind cexit Slider(-1:.00001, default = 0.0) + +# ╔═╡ 41db6cb5-5c5a-4556-b2eb-3cb6c3b40013 +get_eigenvalues(HeKr_2012, parameters = (:cexit => cexit, :ckappa => ckappa, :chab => chab)) |> show_pluto + +# ╔═╡ 13c9dcce-fa5b-4cc4-b684-c0b791a79492 +cexit + +# ╔═╡ 23da9f62-5c43-4e8f-b05c-da2799e86474 +plot_irf(HeKr_2012, + algorithm = :second_order, + parameters = (:cexit => cexit, :ckappa => ckappa, :chab => chab), + periods = 20)[2] + +# ╔═╡ 91ba2048-42a9-49f9-8861-a545ff314b91 +plot_solution(HeKr_2012, :K, + algorithm = :third_order, + parameters = (:σᵉ => .00000001))[1] + +# ╔═╡ dafecb7b-0c4f-4084-9d24-302b09d98fa6 +SSS(HeKr_2012, algorithm = :second_order, parameters = :σᵉ => .000001) |> show_pluto + +# ╔═╡ f7b68127-2de2-4baf-9636-106310af6394 +SS(HeKr_2012, parameters = :σᵉ => .000001) |> show_pluto + +# ╔═╡ Cell order: +# ╠═bad5a8f1-fdf0-47f4-98e5-25f8ec03426b +# ╠═8fc6e932-6d22-46c3-8ad6-b26684c38fa1 +# ╠═1989ec7e-8d47-11ee-13a7-87c968f56766 +# ╠═97ff64bd-961f-43c3-b46d-f3b17e1aabd2 +# ╠═d450c895-1433-4fcc-9905-1c18879e49ec +# ╠═ea44d30c-2591-43b5-9cbf-ee301bb14020 +# ╟─1c646fb3-8f43-440f-834e-9c4e239bd5ad +# ╠═2bdbbaf9-03dd-4492-abf4-ff7aca63e19e +# ╠═f5983385-9164-4509-bc44-ab3043d379cf +# ╟─d61dd34b-7765-4cac-b610-4e7e1031a9e8 +# ╠═534226bf-cfef-4fd0-b40a-f9a3db201e64 +# ╟─c365b37a-bef3-4a0d-96aa-3af2db6180ca +# ╠═dc224752-f3e2-489a-992d-101925299105 +# ╠═382b69e7-f843-47ac-8bb2-33912bfaa473 +# ╠═38d40765-66d8-44a0-af2e-bffad2733994 +# ╠═fc8d5002-3d29-45ec-9665-2cd863b4a748 +# ╟─1508faa7-3e2e-4f3a-90e1-6616b1544610 +# ╟─ac41c574-c53e-4127-918b-5be4040cc601 +# ╠═d127d880-bf08-408d-b67d-e13ec65d7b66 +# ╠═18c1c69a-6b00-41a5-af68-6e7b4853abf3 +# ╠═383372a0-dc81-4343-bff8-74fe688e96e1 +# ╠═2953265e-0e4c-42c9-a933-534361e2bbd5 +# ╠═47901235-dc5d-45a2-908a-b1c00648727c +# ╠═76b30796-b561-43a4-99e1-de09a2e33292 +# ╠═f13e7256-b624-41ee-bf4d-aa912875c949 +# ╠═10aca7df-6bb3-4dfc-86e0-a431107ea716 +# ╠═9f292898-b6a8-4bc5-827e-6c8b75309c4a +# ╠═7e1fff86-654b-4df0-b875-8135bfbca760 +# ╠═ba6174b3-97cb-4a76-a7e6-68c646fdf916 +# ╠═938f34f6-fd79-4fd0-9ad1-82619e2b859f +# ╠═85c6b0cb-5eb1-4fcb-9365-32bca4f35fb8 +# ╠═9c727850-1ff6-435c-8ea4-926206cd7047 +# ╠═f882d5b1-7da0-458b-b079-33fbbcebd057 +# ╠═9ca2fac3-7695-4b82-8f75-b7db5f35d84d +# ╟─8beb523a-102b-4474-8044-4e15586c674f +# ╠═c762bf37-305b-463e-b573-6befd69288ee +# ╠═76c07b1a-0994-47fa-89f9-cc060b51841a +# ╠═0dc35e06-d94f-4f88-9ebe-bbf6e0bf8366 +# ╠═fdb8b36f-579b-4a9a-81aa-31bc366dce02 +# ╠═c1ec07df-0104-4b0d-816c-03b999cc4609 +# ╟─8c877be1-5861-45ac-9087-e9e8c2f7786d +# ╠═e63463de-ed39-4b2f-ad9e-2ba217db931d +# ╠═7cbcbd5c-4203-46c8-be25-14ca8f016eae +# ╠═f103ce35-74be-4c2c-aee7-691926530174 +# ╠═b8d0c055-b7ef-4791-a9b6-5af7d07b0e8e +# ╠═1c3e9adb-ece1-4067-9ac2-2389de62d129 +# ╠═2e50a12d-6aa5-4e91-bc46-06ba71bf82cd +# ╠═41db6cb5-5c5a-4556-b2eb-3cb6c3b40013 +# ╠═7e3cc930-8015-43e7-ac18-dc8d1d274c4c +# ╠═427b3fd2-a6cb-4a1e-b286-b88596ba2ac5 +# ╠═0f15c89a-4505-4683-9413-ab2881c11b2e +# ╠═b4d095bd-61b0-411f-bb08-910c2c5a7804 +# ╠═77637b57-ac4d-4459-bbcb-e070378bc1ae +# ╠═d8fc6d1d-7cc5-42b9-b3c7-33d9666cba2d +# ╠═299b0366-a510-438b-bb41-c0ef679f2403 +# ╠═13c9dcce-fa5b-4cc4-b684-c0b791a79492 +# ╠═23da9f62-5c43-4e8f-b05c-da2799e86474 +# ╠═91ba2048-42a9-49f9-8861-a545ff314b91 +# ╠═dafecb7b-0c4f-4084-9d24-302b09d98fa6 +# ╠═f7b68127-2de2-4baf-9636-106310af6394 From 6d9471d211a1eec2c91d3f65a2ed8d6c8a55472a Mon Sep 17 00:00:00 2001 From: thorek1 Date: Fri, 12 Jan 2024 20:33:10 +0100 Subject: [PATCH 33/34] fix typo --- src/MacroModelling.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MacroModelling.jl b/src/MacroModelling.jl index 092f8519..5e57efba 100644 --- a/src/MacroModelling.jl +++ b/src/MacroModelling.jl @@ -1654,7 +1654,7 @@ function get_and_check_initial_state(𝓂::ℳ, initial_state::Union{Vector{Vect elseif initial_state ∈ [:NSSS, :nsss, :non_stochastic_steady_state] init_state = zeros(𝓂.timings.nVars) elseif initial_state == :mean - elseif algorithm == :first_order + if algorithm == :first_order init_state = zeros(𝓂.timings.nVars) else @assert algorithm ∈ [:first_order, :pruned_second_order, :pruned_third_order] "Mean only available for first order, pruned second order, or pruned third order solution." From 45db0986a48ea21cd54b332ba1a3bc554edcaab6 Mon Sep 17 00:00:00 2001 From: thorek1 Date: Sat, 13 Jan 2024 15:07:26 +0100 Subject: [PATCH 34/34] fix plot solutions --- src/MacroModelling.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/MacroModelling.jl b/src/MacroModelling.jl index 5e57efba..017b419c 100644 --- a/src/MacroModelling.jl +++ b/src/MacroModelling.jl @@ -1675,9 +1675,9 @@ function get_and_check_initial_state(𝓂::ℳ, initial_state::Union{Vector{Vect end if algorithm == :pruned_second_order - init_state = [zeros(𝓂.timings.nVars), init_state] + init_state = init_state isa Vector{Float64} ? [zeros(𝓂.timings.nVars), init_state] : init_state elseif algorithm == :pruned_third_order - init_state = [zeros(𝓂.timings.nVars), init_state, zeros(𝓂.timings.nVars)] + init_state = init_state isa Vector{Float64} ? [zeros(𝓂.timings.nVars), init_state, zeros(𝓂.timings.nVars)] : init_state end return init_state