Percentage of Interest on Price

0

Alright?

I find it difficult to find the interest percentage of a installment ( read finance ), knowing some final values. Given the following formula:

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

This is the default formula Price, to find out 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 - interest percentage . I've looked a lot on the net, but since I'm a layman in financial mathematics, I have not located anything that will help me.

Information: For these amounts, I know that the interest percentage equals 0.02 , or 2% , however I need a formula that I can apply to other values, and thus get the value of i .

    
asked by anonymous 02.09.2016 / 14:23

1 answer

0

It is not possible to isolate the interest rate ("i") in this formula. You need to find the interest rate using linear interpolation or the bisection method. The bisection method works something 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
    
02.09.2016 / 15:03