Percentage of Interest on Price

Asked

Viewed 120 times

0

All right?

I’m having trouble finding the interest rate of a plot (read funding), knowing some final values. Given the following formula:

pmt = (PV.i) / (1 / (1 - (1+i)^n) )

This is standard Price formula, for if discovered the value of the plot. The values I have are:

pmt = 61,45

PV = 234,00

n = 4

I need to figure out the value of i - percentage of interest. I’ve searched the Internet a lot, but since I’m a layman in financial mathematics, I couldn’t find anything that would help me.

Information: for these values, I know that the interest rate is equal to 0,02, or 2%, however I need a formula that I can apply to other values, and with that get the value of i.

  • you want to apply this calculation in some specific programming language?

  • Yes, I need to apply this in Genexus, version 9. But if I have the formula, I will not implicate myself with language. If you have an example in some programming language, and can pass me, I thank you, so I will have more material to analyze.

  • If you want to solve your problem in some specific language or something like that, you should edit and put that in your question.

  • I actually want a solution to the formula, specifically. The program - programming language - will be affected by this, but for me it will not do a program that brings me a result, if I can not explain, or understand how this result is calculated - maybe this is not the best argument, but we can take it as an example. I will wait a while, and see if anyone can answer me on the formula, if I do not get an objective return, I will follow your advice. I thank you for the guidance ;)

1 answer

0


It is not possible to isolate the interest rate ("i") in this formula. It is necessary to find the interest rate using linear interpolation or the bisection method. The bisection method works more or less like this:

i_minimo = 0
i_maximo = 100%

faça enquanto verdadeiro:
    pmt_minimo = formula_pmt(i_minimo)
    pmt_medio = formula_pmt((i_minimo + i_maximo) / 2)
    pmt_maximo = formula_pmt(i_maximo)
    if pmt < pmt_minimo || pmt > pmt_maximo:
        retorna erro
    diferenca = pmt_medio - pmt

    if abs(diferenca) < 0.00001: # aqui você escolhe a precisão desejada
        return i_medio

    if diferenca < 0:
        pmt_minimo = pmt_medio
    else if diferenca > 0:
        pmt_maximo = pmt_medio
  • Thanks for the feedback! I had already arrived at a similar solution. Along with some colleagues of mine we came to call this "method" "brute force", because keep trying a percentage until it gives the same result, or very close. As I said, I am a layman in financial mathematics, so I am looking for a way out of this solution, but I believe this is the only possible one. Just out of curiosity, you could explain to me why it is not possible to isolate ("i") from this formula?

  • The solution is efficient because it solves a bit of the result every cycle. A double floating point number has 56 bits of accuracy, but maybe you don’t even need all that. It is possible that linear interpolation is more efficient, but depending on the financial formula the "i" can have two solutions and then the interpolation gets messed up. I really do not know the exact mathematical reason why the "i" cannot be isolated; colloquially speaking it is because it appears twice on the right side and in one of them is within a non-arithmetic function (the power).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.