help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help resolving the following equation...


From: Stefan Neumann
Subject: Re: Help resolving the following equation...
Date: Tue, 16 Mar 2010 17:16:11 +0100



2010/3/16 Julien Martin <address@hidden>
Hello,
I am trying to determine an interest rate by solving the following equation:
fsolve(@(r) 200*(1+r)^(4)+300*(1+r)^(3)+400*(1+r)^(2)+500*(1+r)^(1)-1000,0)
What really puzzles me is that Octave will not give me a solution that makes sense: it gives me a negative interest rate!!
In plain English, the problem is as follows: one invests 1000$ at year 1, and receives 200 at year 2, 300 at year 3, 400 at year 4 and 500 at year 5.
I have to find out the interest rate of this investment...
Can anyone please help?
Thanks in advance,
Julien.


There is no single interest-rate.

You can only get those payoffs if the interest-rate varies every year.

This calculates the _average_ rate for 2 years, 3 years, .... :

octave:11> fsolve(@(r) (1000*(1+r)^(1))-(1000+200),0)
ans =  0.20000
octave:12> fsolve(@(r) (1000*(1+r)^(2))-(1000+200+300),0)
ans =  0.22474
octave:13> fsolve(@(r) (1000*(1+r)^(3))-(1000+200+300+400),0)
ans =  0.23856
octave:14> fsolve(@(r) (1000*(1+r)^(4))-(1000+200+300+400+500),0)
ans =  0.24467


 

_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave



reply via email to

[Prev in Thread] Current Thread [Next in Thread]