Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
- class YieldCurve a where
- disc :: YieldCurve a => a -> Double -> Double
- forward :: YieldCurve a => a -> Double -> Double -> Double
- spot :: YieldCurve a => a -> Double -> Double
- data FlatCurve = FlatCurve Double
- data NetYC a = NetYC a a
Documentation
class YieldCurve a where Source
The YieldCurve
class defines the
basic operations of a yield curve.
Minimal complete definition: disc
.
disc :: YieldCurve a => a -> Double -> Double Source
Calculate the discount factor for a given maturity.
forward :: YieldCurve a => a -> Double -> Double -> Double Source
Calculate the forward rate between a t1 and t2
spot :: YieldCurve a => a -> Double -> Double Source
Calculate the spot rate for a given maturity.
YieldCurve FlatCurve | |
YieldCurve a => YieldCurve (NetYC a) |
A flat curve is just a flat curve with one continuously compounded rate at all points on the curve.
YieldCurve
that represents the difference between two YieldCurve
s.
NetYC a a |
YieldCurve a => YieldCurve (NetYC a) |