Skip to content

Instantly share code, notes, and snippets.

@Natim
Last active January 15, 2024 21:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Natim/e4f16d5bbdc485c5f001c1e7706d9bba to your computer and use it in GitHub Desktop.
Save Natim/e4f16d5bbdc485c5f001c1e7706d9bba to your computer and use it in GitHub Desktop.
From TAEG to Commission

From TAEG to Commission

Understanding TAEG

TAEG is the Taux Annuel Effectif Global, it is the cost of money for a year with the current fees on the loan.

From an amortization table, you can compute it like that:

+------------+--------------+
| Date       +  Cash flow   |
+------------+--------------+
| 2024-01-01 | - 10 000.00  |
| 2024-02-01 | +  3 360.53  |
| 2024-03-01 | +  3 360.53  |
| 2024-04-01 | +  3 360.53  |
+------------+--------------+
>>> import numpy_financial as npf
>>> round(((1 + npf.irr([-10000, 3360.53, 3360.53, 3360.53])) ** 12 - 1) * 100, 2)
5.0

Difference between TAEG and TEG

The TAEG is the indicator used in France for loans contracted with people (B2C). It is the internal rate of return of the money.

The TEG is the indicator used in France for loans contracted with companies (B2B). It is interest rate of the money.

TAEG describe money that once collected is revinvested again (investment of money). TEG describe money that once collected is not reinvested again (cost of money).

  >>> import numpy_financial as npf
  >>> TAEG = round(((1 + npf.irr([-10000, 3360.53, 3360.53, 3360.53])) ** 12 - 1) * 100, 2)
  >>> TEG = round(npf.irr([-10000, 3360.53, 3360.53, 3360.53]) * 12 * 100, 2)
  >>> (10000, 10081.59, TAEG, TEG)
(10000, 10081.59, 5.0, 4.89)

How to compute the commission or fees for a given TAEG and a given period

The TAEG is based on the time in between repayment collection. In France we take that a year is 360 days and a month is 30 days.

If we want to be precise, we can compute the exact number of days between two recollection.

For monthly repayment the formula is much easier:

>>> from decimal import Decimal

>>> TAEG = Decimal(5.00) / 100
>>> installments_count = 3  # Number of months

>>> monthly_rate = (1 / (1 + TAEG)) ** Decimal(1/12)
>>> commission_percentage = ((1 - monthly_rate) / (monthly_rate - monthly_rate ** (installments_count + 1))) * installments_count - 1
>>> round(commission_percentage * 10_000, 2)
Decimal('81.59')

Normalized vs Extended

If you want to be more specific and rather than using the Normalized months convention use the real number of days in between two installments, you need to use this computation method:

>>> from dateutil.relativedelta import relativedelta
>>> from decimal import Decimal
>>> import datetime as dt

>>> TAEG = Decimal(5.00) / 100
>>> installments_count = 3  # Number of months
>>> payout_date = dt.date(2024, 1, 1)

>>> sk = Decimal(0)
>>> for i in range(1, installments_count + 1):
...     current_date = payout_date + relativedelta(months=i)
...     sk += 1 / ((1 + TAEG) ** (Decimal((current_date - payout_date).days) / 365))
...
>>> installments_count / sk - 1
Decimal('0.008136979965497172560519382')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment