diff --git a/docs/src/how-to/obc.md b/docs/src/how-to/obc.md index 3d8fcd0d..b28c9521 100644 --- a/docs/src/how-to/obc.md +++ b/docs/src/how-to/obc.md @@ -123,6 +123,7 @@ Let's check out the non stochastic steady state (NSSS): ```@repl howto_obc SS(Gali_2015_chapter_3_obc) +SS(Gali_2015_chapter_3_obc)(:R) ``` There are a few things to note here. First, we get the NSSS values of the auxilliary variables related to the occasionally binding constraint. Second, the NSSS value of `R` is 1, and thereby the effective lower bound is binding in the NSSS. While this is a viable NSSS it is not a viable approximation point for perturbation. We can only find a perturbation solution if the effective lower bound is not binding in NSSS. Calling `get_solution` reveals that there is no stable solution at this NSSS: @@ -226,6 +227,7 @@ and check the NSSS once more: ```@repl howto_obc SS(Gali_2015_chapter_3_obc) +SS(Gali_2015_chapter_3_obc)(:R) ``` Now we get `R > R̄`, so that the constraint is not binding in the NSSS and we can work with a stable first order solution: @@ -317,12 +319,14 @@ Compare this to the theoretical mean of the model without the occasionally bindi ```@repl howto_obc get_mean(Gali_2015_chapter_3_obc) +get_mean(Gali_2015_chapter_3_obc)(:Y) ``` and the theoretical standard deviation: ```@repl howto_obc get_std(Gali_2015_chapter_3_obc) +get_std(Gali_2015_chapter_3_obc)(:Y) ``` The mean of output is lower in the model with effective lower bound compared to the model without and the standard deviation is higher. diff --git a/docs/src/unfinished_docs/todo.md b/docs/src/unfinished_docs/todo.md index 70944cba..b099fde8 100644 --- a/docs/src/unfinished_docs/todo.md +++ b/docs/src/unfinished_docs/todo.md @@ -3,6 +3,7 @@ ## High priority - [ ] add technical details about SS solver, obc solver, and other algorithms +- [ ] fix translate dynare mod file from file written using write to dynare file (see test models) - [ ] rm obc vars from get_SS - [ ] fix SS solver (failed for backus in guide) - [ ] functions to reverse state_update (input: previous shock and current state, output previous state), find shocks corresponding to bringing one state to the next diff --git a/test/test_models.jl b/test/test_models.jl index a9bdce72..532618c6 100644 --- a/test/test_models.jl +++ b/test/test_models.jl @@ -10,6 +10,7 @@ if !test_higher_order @test isapprox(var_dec(["K{F}","Y{H}","Z{F}"],"E{H}") * 100, [48.66, 57.56, 47.41],rtol = 1e-3) write_to_dynare_file(Backus_Kehoe_Kydland_1992) + translate_dynare_file("Backus_Kehoe_Kydland_1992.mod") Backus_Kehoe_Kydland_1992 = nothing @@ -25,6 +26,7 @@ if !test_higher_order @test isapprox(var_dec(:US_K,[:EA_EPSRP,:US_EPSR,:US_EPSZ]) * 100, [17.48, 26.83, 27.76],rtol = 1e-3) write_to_dynare_file(NAWM_EAUS_2008) + translate_dynare_file("NAWM_EAUS_2008.mod") NAWM_EAUS_2008 = nothing @@ -41,6 +43,7 @@ if !test_higher_order @test isapprox(corrr(:r,:w),-0.9898,rtol = 1e-3) write_to_dynare_file(Baxter_King_1993) + translate_dynare_file("Baxter_King_1993.mod") Baxter_King_1993 = nothing @@ -54,6 +57,7 @@ if !test_higher_order @test isapprox(var_dec(:π̂,:) * 100, [4.51, 0.91, 87.44, 7.14],rtol = 1e-4) write_to_dynare_file(Ireland_2004) + translate_dynare_file("Ireland_2004.mod") Ireland_2004 = nothing @@ -69,6 +73,7 @@ if !test_higher_order @test isapprox(var_dec(:E_BGYN,:) * 100, [3.00, 0.23, 0.54, 0.01, 0.08, 0.38, 0.14, 0.10, 83.60, 3.28, 1.11, 3.36, 0.01, 1.56, 0.17, 0.17, 0.00, 2.24, 0.01], rtol = 1e-3) write_to_dynare_file(QUEST3_2009) + # translate_dynare_file("QUEST3_2009.mod") # fix BGADJ1 = 0.001BGADJ2; QUEST3_2009 = nothing @@ -84,6 +89,7 @@ if !test_higher_order @test isapprox(var_dec(:B,:) * 100, [42.97, 19.31, 11.70, 0.36, 4.45, 1.41, 0.70, 0.00, 0.61, 12.54, 2.85, 2.72, 0.38],rtol = 1e-3) write_to_dynare_file(GNSS_2010) + translate_dynare_file("GNSS_2010.mod") GNSS_2010 = nothing @@ -98,6 +104,7 @@ if !test_higher_order @test isapprox(var_dec(:x,:) * 100, [56.22, 43.78],rtol = 1e-3) write_to_dynare_file(Gali_Monacelli_2005_CITR) + translate_dynare_file("Gali_Monacelli_2005_CITR.mod") Gali_Monacelli_2005_CITR = nothing @@ -112,6 +119,7 @@ if !test_higher_order @test isapprox(var_dec(:y,:) * 100, [0.47, 99.41, 0.12],rtol = 1e-3) write_to_dynare_file(Ascari_Sbordone_2014) + translate_dynare_file("Ascari_Sbordone_2014.mod") Ascari_Sbordone_2014 = nothing end @@ -135,6 +143,7 @@ if test_higher_order end write_to_dynare_file(SGU_2003_debt_premium) +translate_dynare_file("SGU_2003_debt_premium.mod") SGU_2003_debt_premium = nothing @@ -159,6 +168,7 @@ if test_higher_order end write_to_dynare_file(JQ_2012_RBC) +translate_dynare_file("JQ_2012_RBC.mod") JQ_2012_RBC = nothing @@ -186,6 +196,7 @@ if test_higher_order end write_to_dynare_file(Ghironi_Melitz_2005) +translate_dynare_file("Ghironi_Melitz_2005.mod") Ghironi_Melitz_2005 = nothing @@ -211,6 +222,7 @@ if test_higher_order end write_to_dynare_file(Gali_2015_chapter_3_nonlinear) +translate_dynare_file("Gali_2015_chapter_3_nonlinear.mod") Gali_2015_chapter_3_nonlinear = nothing @@ -230,6 +242,7 @@ if test_higher_order end write_to_dynare_file(Caldara_et_al_2012) +translate_dynare_file("Caldara_et_al_2012.mod") Caldara_et_al_2012 = nothing @@ -255,4 +268,5 @@ if test_higher_order end write_to_dynare_file(Aguiar_Gopinath_2007) +translate_dynare_file("Aguiar_Gopinath_2007.mod") Aguiar_Gopinath_2007 = nothing \ No newline at end of file