Skip to content

Commit

Permalink
more interp
Browse files Browse the repository at this point in the history
  • Loading branch information
thorek1 committed Dec 10, 2024
1 parent b5e30b0 commit ad0b98b
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions src/uncertainty.jl
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,53 @@ end



SS(Smets_Wouters_2007, parameters = pars .=> no_pandemic, derivatives = false)

f = OptimizationFunction(calculate_cb_loss, AutoZygote())
# f = OptimizationFunction(calculate_cb_loss, AutoForwardDiff())
prob = OptimizationProblem(f, optimal_taylor_coefficients, (loss_function_weights, regularisation), ub = ubs, lb = lbs)

# Import a solver package and solve the optimization problem

sol = solve(prob, NLopt.LD_LBFGS(), maxiters = 10000) # this seems to achieve best results

sol.objective


SS(Smets_Wouters_2007, parameters = pars .=> full_sample_shock_pandemic, derivatives = false)

f = OptimizationFunction(calculate_cb_loss, AutoZygote())
# f = OptimizationFunction(calculate_cb_loss, AutoForwardDiff())
prob = OptimizationProblem(f, optimal_taylor_coefficients, (loss_function_weights, regularisation), ub = ubs, lb = lbs)

# Import a solver package and solve the optimization problem

sol = solve(prob, NLopt.LD_LBFGS(), maxiters = 10000) # this seems to achieve best results
sol = solve(prob, NLopt.LN_NELDERMEAD(), maxiters = 10000) # this seems to achieve best results
sol = solve(prob, NLopt.LN_PRAXIS(), maxiters = 10000) # this seems to achieve best results

sol.objective


SS(Smets_Wouters_2007, parameters = pars .=> full_sample, derivatives = false)

f = OptimizationFunction(calculate_cb_loss, AutoZygote())
# f = OptimizationFunction(calculate_cb_loss, AutoForwardDiff())
prob = OptimizationProblem(f, optimal_taylor_coefficients, (loss_function_weights, regularisation), ub = ubs, lb = lbs)

# Import a solver package and solve the optimization problem

# sol = solve(prob, NLopt.LN_PRAXIS(), maxiters = 10000) # this seems to achieve best results

sol = solve(prob, NLopt.LN_NELDERMEAD(), maxiters = 10000) # this seems to achieve best results

# sol = solve(prob, NLopt.LD_LBFGS(), maxiters = 10000) # this seems to achieve best results

sol.objective

# Interpretation:
# taken together the changes in the variance of the shock processes imply a weaker response to inflation, a stronger response to output and overall more persistence

## Analysis of other sources of uncertainty
include("../models/Smets_Wouters_2007_ext.jl")

Expand Down Expand Up @@ -621,6 +668,12 @@ for (nm,vl) in zip(stds,std_vals)
ii += 1
end


# Interpretation:
# increase in uncertainty regarding the calvo probabilities, or a measurement error of inflation in the Taylor rule all trigger a weaker inflation response and a stronger output response



# look at shock decomposition for pandemic period
using StatsPlots
include("../test/download_EA_data.jl")
Expand Down

0 comments on commit ad0b98b

Please sign in to comment.