Skip to content

Commit

Permalink
test: bring accounting identities precision from 1e-9 to 1e-8 to avoi…
Browse files Browse the repository at this point in the history
…d failure due to numerics
  • Loading branch information
AldoGl committed May 13, 2024
1 parent 878e8c6 commit d8c8c10
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/accounting_identities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ using Test

# income accounting and production accounting should be equal
zero = sum(data.nominal_gva - data.compensation_employees - data.operating_surplus - data.taxes_production)
@test isapprox(zero, 0.0, atol = 1e-9)
@test isapprox(zero, 0.0, atol = 1e-8)

# compare nominal_gdp to total expenditure
zero = sum(
data.nominal_gdp - data.nominal_household_consumption - data.nominal_government_consumption -
data.nominal_capitalformation - data.nominal_exports + data.nominal_imports,
)
@test isapprox(zero, 0.0, atol = 1e-9)
@test isapprox(zero, 0.0, atol = 1e-8)

zero = sum(
data.real_gdp - data.real_household_consumption - data.real_government_consumption - data.real_capitalformation - data.real_exports + data.real_imports,
Expand All @@ -34,10 +34,10 @@ using Test

# accounting identity of balance sheet of central bank
zero = model.cb.E_CB + model.rotw.D_RoW - model.gov.L_G + model.bank.D_k
@test isapprox(zero, 0.0, atol = 1e-9)
@test isapprox(zero, 0.0, atol = 1e-8)

# accounting identity of balance sheet of commercial bank
tot_D_h = sum(model.w_act.D_h) + sum(model.w_inact.D_h) + sum(model.firms.D_h) + model.bank.D_h
zero = sum(model.firms.D_i) + tot_D_h + sum(model.bank.E_k) - sum(model.firms.L_i) - model.bank.D_k
@test isapprox(zero, 0.0, atol = 1e-9)
@test isapprox(zero, 0.0, atol = 1e-8)
end

0 comments on commit d8c8c10

Please sign in to comment.