I have a Mathematical equation that cannot be solved linearly. Can some one help me find a simple logic to calculate yield.
Given a financial instrument which offers the annual payments
Years from NowPromised Annual Payments
1$2,000=c1
2$2,000=c2
3$2,500=c3
4$4,000=c4
The price of the financial instrument is :$7,704=P
Use the equation below to calculate the yield y:
P = (c1/((1+y)^1)) + (c2/((1+y)^2)) + (c3/((1+y)^3)) + (c4/((1+y)^4))
where P, c1, c2, c3, and c4 are above
and y is the yield of the financial instrument
Find the yield y which satisfies the above equation.
Write a
JAVA console or windows program to do this.
Input :
input for c1
input for c2
input for c3
input for c4
input for price
Output:
yield y
There has to be a way to start from the approx. value. I need some advice on this.
Thanks for your help,
Vinay