Yields

Yields.AbstractYieldType

An AbstractYield is an object which can be called with:

  • rate(yield,time) for the spot rate at a given time
  • discount(yield,time) for the spot discount rate at a given time
source
Yields.ConstantType
Constant(rate)

Construct a yield object where the spot rate is constant for all maturities.

Examples

julia> y = Yields.Constant(0.05)
julia> discount(y,2)
0.9070294784580498     # 1 / (1.05) ^ 2
source
Yields.StepType
Step(rates,times)

Create a yield curve object where the applicable rate is the effective rate of interest applicable until corresponding time.

Examples

julia>y = Yields.Step([0.02,0.05], [1,2])

julia>rate(y,0.5)
0.02

julia>rate(y,1.5)
0.05

julia>rate(y,2.5)
0.05
source
Base.:+Method
Yields.AbstractYield + Yields.AbstractYield

The addition of two yields will create a RateCombination. For rate, discount, and accumulation purposes the spot rates of the two curves will be added together.

source
Base.:-Method
Yields.AbstractYield - Yields.AbstractYield

The subtraction of two yields will create a RateCombination. For rate, discount, and accumulation purposes the spot rates of the second curves will be subtracted from the first.

source
Base.accumulateMethod
accumulate(yield,time)

The accumulation factor for the yield from time zero through time.

source
Yields.ForwardMethod
Forward(rate_vector)

Takes a vector of 1-period forward rates and constructs a discount curve.

source
Yields.ParMethod

Construct a curve given a set of bond yields priced at par with a single coupon per period.

source
Yields.discountMethod
discount(yield,from,to)

The discount factor for the yield from time from through to.

source
Yields.discountMethod
discount(yield,time)

The discount factor for the yield from time zero through time. If yield is a Real number, will assume a Constant interest rate.

source
Yields.rateMethod
rate(yield,time)

The spot rate at time for the given yield.

source