Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Nägele committed Oct 29, 2023
1 parent d9ba1b0 commit 46908c3
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,42 @@ using Test
@testset "Default models" begin
sim = Consistent.SIM()
@test sim[:model].exogenous_variables.variables == [:G]
show(sim)
Consistent.SIMStoch()
Consistent.LP()
Consistent.PC()
Consistent.DIS()
Consistent.BMW()
end

@testset "Combine models" begin
PC_gdp = model(
endos = @variables(Y, YD, T, V, C),
exos = @variables(r, G, B_h),
params = @variables(α_1, α_2, θ),
eqs = @equations begin
Y = C + G
YD = Y - T + r[-1] * B_h[-1]
T = θ * (Y + r[-1] * B_h[-1])
V = V[-1] + (YD - C)
C = α_1 * YD + α_2 * V[-1]
end
)

PC_hh = model(
endos = @variables(H_h, B_h, B_s, H_s, B_cb, r),
exos = @variables(r_exo, G, V, YD, T),
params = @variables(λ_0, λ_1, λ_2),
eqs = @equations begin
H_h = V - B_h
B_h = (λ_0 + λ_1 * r - λ_2 * (YD / V)) * V
B_s = (G + r[-1] * B_s[-1]) - (T + r[-1] * B_cb[-1]) + B_s[-1]
H_s = B_cb - B_cb[-1] + H_s[-1]
B_cb = B_s - B_h
r = r_exo
end
)

PC_complete = PC_gdp + PC_hh
end
end

0 comments on commit 46908c3

Please sign in to comment.