-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix RPM distribution amounts #4
Comments
RPM logic:
Mirella response, via email 2021-09-06:
|
Comment for my own future reference. Tried recalculating rates after distributing the capture TIF increment back to districts. Doesn't seem to matter much: agencies <- DBI::dbGetQuery(ptaxsim_db_conn, "SELECT * FROM agencies")
tax_codes <- DBI::dbGetQuery(ptaxsim_db_conn, "SELECT * FROM tax_codes")
tifs <- DBI::dbGetQuery(ptaxsim_db_conn, "SELECT * FROM tif_distributions")
setDT(agencies, key = c("year", "agency_num"))
setDT(tax_codes, key = c("year", "agency_num", "tax_code_num"))
setDT(tifs, key = c("year", "tax_code_num"))
temp <- merge(agencies, tax_codes, all.x = TRUE)
temp2 <- agencies[
tax_codes
][tifs, on = .(year, tax_code_num)
][, .(new_rate = total_ext / (total_eav + sum(tax_code_frozen_eav))), by = .(year, agency_num)]
# Get list of all tax codes within agencies that overlap the RPM TIF
rpm_agencies <- unique(tax_codes[tax_codes[agency_num == "030210900", c("year", "tax_code_num")
], on = .(year, tax_code_num)][, c("year", "agency_num")])
rpm_tax_codes <- tax_codes[rpm_agencies, c("year", "agency_num", "tax_code_num")]
temp3 <- rpm_tax_codes[
tifs,
on = .(year, tax_code_num),
tax_code_frozen_eav := i.tax_code_frozen_eav
][, .(frozen_eav = sum(tax_code_frozen_eav, na.rm = TRUE)), by = .(year, agency_num)]
# filter TIFs
# calc new rates
# calc distributions
temp3 <- rpm_tax_codes[tifs, on = .(year, tax_code_num)]
temp4 <- agencies[
rpm_agencies
][temp3, on = .(year, agency_num)
][, agency_rate_rpm := total_ext / (total_eav + frozen_eav)][!is.na(agency_name), c("year", "agency_num", "agency_rate_rpm")]
|
GitHub does not appear to allow for relative links to issues within the readme using #4 syntax for example. Updated issue numbers and added absolute links *shrug.*
GitHub does not appear to allow for relative links to issues within the readme using #4 syntax for example. Updated issue numbers and added absolute links *shrug.*
Per the Treasurer's team, it seems like this is in fact the correct way to do this calculation, but there may be some discrepancy between how it's done for the purpose of being shown on bills on how it's done to actually divvy up collections. So, without further info, I'm going to close this for now. |
PINs within the special RPM TIF district have slightly incorrect total tax amounts, especially compared to non-TIF PINS. The RPM TIF has the following disbursement:
The first two are correct, but calculating the correct proportional distribution for part 3 is challenging. Currently using the following formula:
agency_tax_rate / sum(agency_tax_rate (excluding CPS))
The following script yields the example data below:
The text was updated successfully, but these errors were encountered: