1

I am VERY NEW to all this industry, so I apologize in advance if my question is too simple.

I am given the formula to calculate the compounded rate, where Ri is the effective rate and k is the compounding period.

If I understood correctly from this source:

enter image description here

GREEK CAPITAL LETTER PI means a product in my formula, k = compounding period (days), i = 1 means that I start from 1 go till k.

Does it mean that my formula in a programming language should be (for instance):

  • rate = 10%

  • k = 100

Then I will have:

(1 * 2 * 3 ... * 99 * 100 * (1 + 0.1/360) - 1) * 360/100

How the initial formula above is different from this general formula

Thanks!

  • 1
    1st formula is looking for the Interest Rate and 2nd formula is looking for the Future Value. They don't serve the same purpose. And no, you had the capital pi completely wrong. – base64 Jun 23 '20 at 06:01
  • 1
    Instead of gathering different formula scattered across different Wikipedia pages, tell us what exactly you are trying to achieve. What were the business user's requirements. – base64 Jun 23 '20 at 06:03
  • @base64, many thanks! This is my first interaction with this topic ever. I am trying to understand how to write a chunk of code for the first formula. – Anakin Skywalker Jun 23 '20 at 06:19

1 Answers1

2

The 1st formula could be described as Nominal Interest Rate of 1 Year annualized from Effective Interest Rate over k number of days.

A potential use case is this:

We are a bank that gives customers loans that are repaid after k number of days. We charge an interest rate based on the overnight rate of the central bank and compounded daily. We have to display a annualized interest rate instead of the interest rate over k days.

Descriptive Example: A customer wants to borrow $P for 3 days. The annualized overnight interest rate quoted by Federal Reserve for each of the 3 days is 0.25%, 0.30%, 0.20%. What is the annualized interest rate for the customer to get an idea of the annual intrest rate?

(((1 + r1/360) x (1 + r2/360) x (1 + r3/360)) - 1) x (360 / 3)

= (((1 + 0.25%/360) x (1 + 0.30%/360) x (1 + 0.20%/360)) - 1) x (360 / 3)

= (((1 + 0.0025/360) x (1 + 0.0030/360) x (1 + 0.0020/360)) - 1) x (360 / 3)

= 0.002500017129668209876543 = 0.25%

The Python code with this example is:

R = [0.0025, 0.0030, 0.0020]
k = len(R)
pi = 1
for i in R:
  pi = pi * (1 + i/360)
result = (pi - 1)*(360/k)
print(str(round(result*100,2)) + "%")
base64
  • 10,440
  • 2
  • 26
  • 39
  • 1
    You may test the Python at https://repl.it/languages/python3 – base64 Jun 23 '20 at 06:35
  • Fantastic! Thanks for such detailed explanation! It is much more valuable than just a code. I will write it in a different language, based on your example and explanation. Again thanks a lot! Really appreciate your time! This is my first interaction with the financial analytics ever. – Anakin Skywalker Jun 23 '20 at 06:53