ebuckley / legislation_as_code Goto Github PK
View Code? Open in Web Editor NEWAn example implementation of legislation as code, using the rates rebate legislation as an example
License: MIT License
An example implementation of legislation as code, using the rates rebate legislation as an example
License: MIT License
Hello,
The formula you used in your code is quite straightforward:
(household_income - base_rate) / (dependants_number * 0.1 * rate)
However, disregarding the constants which change on a regular basis, the law specify a wealth of other conditions:
And so, the formula used does not: 1) take into account 2/3 of amounts exceeding a threshold; 2) consider $1 for each $8 exceeding a threshold,; 3) adjust it for each dependent by $500, etc.
A formula much closer to the text would appear to be:
I've been digging through the minutes and documents published but could not find any explanation as to the choice of the formula, despite it being a crucial element in encoding the Rates Rebate Act. Would you be able to let us know how you came to choosing this formula? Why did you disregard certain elements in the original legal text?
Using the example which you have in your code (household income of 45000, 2 dependents, 2000 rate), your output gives a rate of 75, whereas the closed formula from above yields 0---quite a notable difference in other words.
We're in the midst of writing an academic book on the subject and would very much appreciate being able to include a rationale behind this discrepancy.
Many thanks in advance for your answer!
Best wishes,
Clement
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.