Skip to content
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

Calculate indemnity fee #399

Open
5 tasks done
arekmano opened this issue Mar 16, 2018 · 2 comments
Open
5 tasks done

Calculate indemnity fee #399

arekmano opened this issue Mar 16, 2018 · 2 comments

Comments

@arekmano
Copy link
Collaborator

arekmano commented Mar 16, 2018

Description
As a user, I make a claim about non payment which predicts that I am eligible for additional indemnity money. The system returns to me how much indemnity I can receive which is a value separate from the total money received.

Scope of Work

  • Change additional_indemnity_fees regex to boolean
  • Tag precedents
  • Train model
  • Upload model to CJL
  • Add static formula to regressor

Demo requirement

  1. The user does x
  2. The system does y
    n. Rest of a use case of a flow chart

Acceptance Criteria

  • The user is able to x
  • The user sees y
  • The user hears z
@eeveecc
Copy link

eeveecc commented Mar 17, 2018

Here is what we know:

  • Based on http://legisquebec.gouv.qc.ca/en/ShowDoc/cs/A-6.002 section 28, the interest applies every quarter.
  • Assume the tenant hasn't pay for 22 months, which means he hasn't paid for 7 quarters (without remainder, since the payment is calculated on the first day of the third month of each quarter) -> n = 7
  • The annual interest rate is at 6%, therefore the quarter interest rate = Portion of a quarter of a year * Annual interest rate = 91/365 * 0.06 = 0.01496 -> i = 0.01496
  • Assume the rent is $1000. Because the interest rate applies every quarter, the basic value/portion for the interest rate to be applied = rent * 3 months per quarter = 1000 * 3 = 3000 -> PMT= 3000

Therefore, since every 3 months/a quarter the tenant owns another $3000, we use future value formula to calculate the total amount, and we can subtract the interest part out

  • The total owing = PV(1+i)^n + (PMT/i)((1+i)^n-1) = 0+(3000/0.01496)*((1+0.01496)^7-1) = 21966.33
  • The total interest = total owing - quarter rent * number of quarter = 21966.33 - (3000*7) = $966.33
  • note that in our case, the present value in the formula is 0. Imagine you are the landlord 22 months ago, the tenant didn't owe you anything, so the balance was 0. Three months after the formula starts applying.

@eeveecc
Copy link

eeveecc commented Mar 17, 2018

To sum up:

  • n = total months of owing / 4
  • i = 0.01496 (fixed)
  • PMT = rent * 3
  • PV = 0
  • total owing = PV(1+i)^n + (PMT/i)((1+i)^n-1)
  • total interest = total owing - PMT*n

@Samuel-Campbell Samuel-Campbell added this to the Iteration 12 milestone Mar 22, 2018
@Samuel-Campbell Samuel-Campbell self-assigned this Mar 22, 2018
Samuel-Campbell added a commit that referenced this issue Mar 22, 2018
Samuel-Campbell added a commit that referenced this issue Mar 22, 2018
Samuel-Campbell added a commit that referenced this issue Mar 22, 2018
@eeveecc eeveecc self-assigned this Mar 22, 2018
Samuel-Campbell added a commit that referenced this issue Mar 26, 2018
Samuel-Campbell added a commit that referenced this issue Mar 26, 2018
Samuel-Campbell added a commit that referenced this issue Mar 26, 2018
[#399] changed regex from days to months, finished additional indemni…
Vynny added a commit that referenced this issue Mar 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants