Skip to content

Commit

Permalink
fix plot_cond_fcst
Browse files Browse the repository at this point in the history
  • Loading branch information
thorek1 committed Dec 21, 2023
1 parent 344a7cb commit 6c059f5
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/plotting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ function plot_solution(𝓂::β„³,
SS_and_std[2] = SS_and_std[2] isa KeyedArray ? axiskeys(SS_and_std[2],1) isa Vector{String} ? rekey(SS_and_std[2], 1 => axiskeys(SS_and_std[2],1).|> x->Symbol.(replace.(x, "{" => "β—–", "}" => "β——"))) : SS_and_std[2] : SS_and_std[2]

full_NSSS = sort(union(𝓂.var,𝓂.aux,𝓂.exo_present))

full_NSSS[indexin(𝓂.aux,full_NSSS)] = map(x -> Symbol(replace(string(x), r"ᴸ⁽⁻?[⁰¹²³⁴⁡⁢⁷⁸⁹]+⁾" => "")), 𝓂.aux)

full_SS = [s ∈ 𝓂.exo_present ? 0 : SS_and_std[1](s) for s in full_NSSS]
Expand Down Expand Up @@ -1378,17 +1378,12 @@ function plot_conditional_forecast(𝓂::β„³,

var_idx = indexin(var_names,full_SS)

full_NSSS = sort(union(𝓂.var,𝓂.aux,𝓂.exo_present))

full_NSSS[indexin(𝓂.aux,full_NSSS)] = map(x -> Symbol(replace(string(x), r"ᴸ⁽⁻?[⁰¹²³⁴⁡⁢⁷⁸⁹]+⁾" => "")), 𝓂.aux)

if any(x -> contains(string(x), "β—–"), full_NSSS)
full_NSSS_decomposed = decompose_name.(full_NSSS)
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
var_names[indexin(𝓂.aux,var_names)] = map(x -> Symbol(replace(string(x), r"ᴸ⁽⁻?[⁰¹²³⁴⁡⁢⁷⁸⁹]+⁾" => "")), 𝓂.aux)

relevant_SS = get_steady_state(𝓂, algorithm = algorithm, return_variables_only = true, derivatives = false)

relevant_SS = relevant_SS isa KeyedArray ? axiskeys(relevant_SS,1) isa Vector{String} ? rekey(relevant_SS, 1 => axiskeys(relevant_SS,1) .|> Meta.parse .|> replace_indices) : relevant_SS : relevant_SS

reference_steady_state = [s ∈ union(map(x -> Symbol(string(x) * "β‚β‚“β‚Ž"), 𝓂.timings.exo), 𝓂.exo_present) ? 0 : relevant_SS(s) for s in var_names]

var_length = length(full_SS) - 𝓂.timings.nExo
Expand Down

0 comments on commit 6c059f5

Please sign in to comment.