Language Reference

YIELD Function

calculates yield-to-maturity of a cash-flow stream and returns a scalar

YIELD( times,flows,freq,value)

The YIELD function returns a scalar containing yield-to-maturity of a cash-flow stream based on frequency and value specified.



times
is an n-dimensional column vector of times. Elements should be nonnegative.
flows
is an n-dimensional column vector of cash flows.
freq
is a scalar that represents the base of the rates to be used for discounting the cash flows. If positive, it represents discrete compounding as the reciprocal of the number of compoundings. If zero, it represents continuous compounding. No negative values are accepted.
value
is a scalar that is the discounted present value of the cash flows.

The present value relationship can be written as
   p=\sum_{k=1}^k c(k) d(t_k)
where p is the present value of the asset, \{c(k)\}{k=1,..k} is the sequence of cash flows from the asset, t_k is the time to the kth cash flow in periods from the present, and d(t) is the discount function for time t.

With continuous compounding:
d(t) = e^{-y t}
With discrete compounding:
d(t) = (1+fy)^{-t/f}
where f \gt 0 is the frequency, the reciprocal of the number of compoundings per unit time period, and y is the yield-to-maturity. The YIELD function solves for y.

For example, the following code produces the output shown:

  
    timesn=T(do(1,100,1)); 
    flows=repeat(10,100); 
    freq=50; 
    value=682.31027; 
    yield=yield(timesn,flows,freq,value); 
    print yield;
 

  
                              YIELD 
                             0.0100001
 

Previous Page | Next Page | Top of Page