Skip to content

Commit

Permalink
set tax rates
Browse files Browse the repository at this point in the history
  • Loading branch information
jdebacker committed Jun 18, 2024
1 parent 7a54015 commit bc97cb5
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions examples/run_og_zaf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,26 @@
import json
import time
import copy
import numpy as np

# from taxcalc import Calculator
import matplotlib.pyplot as plt
from ogzaf.calibrate import Calibration
from ogcore.parameters import Specifications
from ogcore import output_tables as ot
from ogcore import output_plots as op
from ogcore.execute import runner
from ogcore.utils import safe_read_pickle
from ogcore.utils import safe_read_pickle, param_dump_json

# Use a custom matplotlib style file for plots
style_file_url = (
"https://raw.githubusercontent.com/PSLmodels/OG-Core/"
+ "master/ogcore/OGcorePlots.mplstyle"
)
plt.style.use(style_file_url)


def main():
# Define parameters to use for multiprocessing
client = Client()
num_workers = min(multiprocessing.cpu_count(), 7)
client = Client(n_workers=num_workers, threads_per_worker=1)
print("Number of workers = ", num_workers)

# Directories to save data
Expand Down Expand Up @@ -51,9 +56,21 @@ def main():
)
)
# Update parameters from calibrate.py Calibration class
c = Calibration(p, estimate_pop=True)
c = Calibration(p)
updated_params = c.get_dict()
p.update_specifications(updated_params)
# set tax rates
p.update_specifications(
{
"cit_rate": [[0.27]],
"tax_func_type": "linear",
"age_specific": False,
"etr_params": [[[0.22]]],
"mtrx_params": [[[0.31]]],
"mtry_params": [[[0.25]]],
"tau_c": [[0.15]],
}
)

# Run model
start_time = time.time()
Expand Down

0 comments on commit bc97cb5

Please sign in to comment.