Skip to content

Commit

Permalink
test case with >2 shocks and more GC
Browse files Browse the repository at this point in the history
  • Loading branch information
thorek1 committed Sep 11, 2023
1 parent 1745f72 commit 54dac9e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 42 deletions.
4 changes: 4 additions & 0 deletions test/functionality_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ function functionality_test(m; algorithm = :first_order, plots = true, verbose =
new_moms4 = get_mean(m, algorithm = algorithm, verbose = true, parameters = (string.(m.parameters[1:2]) .=> m.parameter_values[1:2] * 1.000))
end

GC.gc()

if algorithm == :first_order
irfs_nv = get_irf(m, m.parameter_values)
irfs = get_irf(m, m.parameter_values, verbose = true)
Expand Down Expand Up @@ -391,6 +393,7 @@ function functionality_test(m; algorithm = :first_order, plots = true, verbose =
new_sols4 = get_solution(m, algorithm = algorithm, verbose = true, parameters = (string.(m.parameters[1:2]) .=> m.parameter_values[1:2] / 1.0001))
old_sols = get_solution(m, algorithm = algorithm, verbose = true, parameters = old_par_vals)

GC.gc()
# irfs
irfs_nv = get_irf(m, algorithm = algorithm)
irfs = get_irf(m, verbose = true, algorithm = algorithm)
Expand Down Expand Up @@ -465,6 +468,7 @@ function functionality_test(m; algorithm = :first_order, plots = true, verbose =

sims = simulate(m, algorithm = algorithm)

GC.gc()
# Inspect Model
get_equations(m)
get_steady_state_equations(m)
Expand Down
60 changes: 18 additions & 42 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,30 @@ GC.gc()
functionality_test(m)
end
m = nothing
GC.gc()


@testset verbose = true "RBC_CME with calibration equations, parameter definitions, special functions, variables in steady state, and leads/lag > 1 on endogenous and exogenous variables pruned second order" begin
include("models/RBC_CME_calibration_equations_and_parameter_definitions_lead_lags.jl")
functionality_test(m, algorithm = :pruned_second_order, plots = false)
end
m = nothing
GC.gc()

@testset verbose = true "RBC_CME with calibration equations, parameter definitions, special functions, variables in steady state, and leads/lag > 1 on endogenous and exogenous variables pruned third order" begin
include("models/RBC_CME_calibration_equations_and_parameter_definitions_lead_lags.jl")
functionality_test(m, algorithm = :pruned_third_order, plots = false)
end
m = nothing
GC.gc()


@testset verbose = true "RBC_CME with calibration equations, parameter definitions, special functions, variables in steady state, and leads/lag > 1 on endogenous and exogenous variables numerical SS" begin
include("models/RBC_CME_calibration_equations_and_parameter_definitions_lead_lags_numsolve.jl")
functionality_test(m)
end
m = nothing
GC.gc()

@testset verbose = true "RBC_CME with calibration equations, parameter definitions, and special functions" begin
include("models/RBC_CME_calibration_equations_and_parameter_definitions_and_specfuns.jl")
Expand All @@ -144,27 +162,13 @@ end
m = nothing
GC.gc()

@testset verbose = true "RBC_CME with calibration equations and parameter definitions pruned second order" begin
include("models/RBC_CME_calibration_equations_and_parameter_definitions.jl")
functionality_test(m, algorithm = :pruned_second_order, plots = false)
end
m = nothing
GC.gc()

@testset verbose = true "RBC_CME with calibration equations and parameter definitions third order" begin
include("models/RBC_CME_calibration_equations_and_parameter_definitions.jl")
functionality_test(m, algorithm = :third_order, plots = false)
end
m = nothing
GC.gc()

@testset verbose = true "RBC_CME with calibration equations and parameter definitions pruned third order" begin
include("models/RBC_CME_calibration_equations_and_parameter_definitions.jl")
functionality_test(m, algorithm = :pruned_third_order, plots = false)
end
m = nothing
GC.gc()



@testset verbose = true "RBC_CME with calibration equations" begin
Expand All @@ -181,27 +185,13 @@ end
m = nothing
GC.gc()

@testset verbose = true "RBC_CME with calibration equations pruned second order" begin
include("models/RBC_CME_calibration_equations.jl")
functionality_test(m, algorithm = :pruned_second_order, plots = false)
end
m = nothing
GC.gc()

@testset verbose = true "RBC_CME with calibration equations third order" begin
include("models/RBC_CME_calibration_equations.jl")
functionality_test(m, algorithm = :third_order, plots = false)
end
m = nothing
GC.gc()

@testset verbose = true "RBC_CME with calibration equations pruned third order" begin
include("models/RBC_CME_calibration_equations.jl")
functionality_test(m, algorithm = :pruned_third_order, plots = false)
end
m = nothing
GC.gc()


@testset verbose = true "RBC_CME" begin
include("models/RBC_CME.jl")
Expand All @@ -218,14 +208,6 @@ m = nothing
GC.gc()


@testset verbose = true "RBC_CME pruned second order" begin
include("models/RBC_CME.jl")
functionality_test(m, algorithm = :pruned_second_order, plots = false)
end
m = nothing
GC.gc()


@testset verbose = true "RBC_CME third order" begin
include("models/RBC_CME.jl")
functionality_test(m, algorithm = :third_order, plots = false)
Expand All @@ -234,12 +216,6 @@ m = nothing
GC.gc()


@testset verbose = true "RBC_CME pruned third order" begin
include("models/RBC_CME.jl")
functionality_test(m, algorithm = :pruned_third_order, plots = false)
end
m = nothing
GC.gc()


@testset verbose = true "Model without shocks" begin
Expand Down

0 comments on commit 54dac9e

Please sign in to comment.