| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
QuantLib.TermStructure.Yield
Synopsis
- type GenYieldTermStructure y = GenTermStructure (AnyOf CYieldTermStructure' y)
- type YieldTermStructure = GenYieldTermStructure CYieldTermStructure
- type PiecewiseYieldCurve = GenYieldTermStructure CPiecewiseYieldCurve
- type RelinkableYieldTermStructure = GenYieldTermStructure CRelinkableYieldTermStructure
- type FittedBondDiscountCurve = GenYieldTermStructure CFittedBondDiscountCurve
- data MultiCurve
- data GenRateHelper rh
- type RateHelper = GenRateHelper CRateHelper
- type BondHelper = GenRateHelper CBondHelper
- type SwapRateHelper = GenRateHelper CSwapRateHelper
- type OISRateHelper = GenRateHelper COISRateHelper
- type FuturesRateHelper = GenRateHelper CFuturesRateHelper
- type OvernightIndexFutureRateHelper = GenRateHelper COvernightIndexFutureRateHelper
- data Reference
- data TermPoint
- data RatePoint
- = RateAtDate !Day !DayCounter
- | RateAtTime !Double
- data RateInterval
- data FittingMethod
- = CubicBSplines ![Double] !Bool ![Double] ![Double] !Double !Double !(Maybe Constraint) !(Maybe OptimizationMethod)
- | ExponentialSplines !Bool ![Double] ![Double] !Double !Double !Word !(Maybe Double) !(Maybe Constraint) !(Maybe OptimizationMethod)
- | NelsonSiegel ![Double] ![Double] !Double !Double !(Maybe Constraint) !(Maybe OptimizationMethod)
- | SimplePolynomial !Word !Bool ![Double] ![Double] !Double !Double !(Maybe Constraint) !(Maybe OptimizationMethod)
- | Svensson ![Double] ![Double] !Double !Double !(Maybe Constraint) !(Maybe OptimizationMethod)
- data BootstrapTrait
- data PillarChoice
- data FuturesType
- data DepositTerms ibor
- = DepositTenor !(Int, TimeUnit) !Word !Calendar !BusinessDayConvention !Bool !DayCounter
- | DepositFromIndex !(GenIborIndex ibor)
- | DepositOnFixingDate !Day !(GenIborIndex ibor)
- data FraTerms ibor
- = FraMonths !Word !Word !Word !Calendar !BusinessDayConvention !Bool !DayCounter
- | FraMonthsFromIndex !Word !(GenIborIndex ibor)
- | FraPeriod !(Int, TimeUnit) !Word !Word !Calendar !BusinessDayConvention !Bool !DayCounter
- | FraPeriodFromIndex !(Int, TimeUnit) !(GenIborIndex ibor)
- | FraImmOffsets !Word !Word !(GenIborIndex ibor)
- | FraBetweenDates !Day !Day !(GenIborIndex ibor)
- data SwapRateTerms sidx ibor
- = SwapRateFromIndex !(GenSwapIndex sidx) !(Int, TimeUnit)
- | SwapRateTenor !(Int, TimeUnit) !Calendar !Frequency !BusinessDayConvention !DayCounter !(GenIborIndex ibor) !(Int, TimeUnit) !(Maybe Word) !(Maybe BusinessDayConvention)
- | SwapRateBetweenDates !Day !Day !Calendar !Frequency !BusinessDayConvention !DayCounter !(GenIborIndex ibor) !(Maybe BusinessDayConvention)
- data OisTerms
- data FxSwapTerms
- = FxSwapTenor !(Int, TimeUnit) !Word !Calendar !BusinessDayConvention !Bool !Calendar
- | FxSwapBetweenDates !Day !Day
- data FundingTerms
- = FundingTenor !Word !(Int, TimeUnit)
- | FundingBetweenDates !Day !Day
- data FuturesTerms ibor
- = FuturesMonths !Day !Word !Calendar !BusinessDayConvention !Bool !DayCounter
- | FuturesBetweenDates !Day !Day !DayCounter
- | FuturesFromIndex !Day !(GenIborIndex ibor)
- data OISRateHelperOpts m p = OISRateHelperOpts {
- oisTelescopicValueDates :: Bool
- oisPaymentLag :: Int
- oisPaymentConvention :: BusinessDayConvention
- oisPaymentFrequency :: Frequency
- oisPaymentCalendar :: Maybe Calendar
- oisOvernightSpread :: Maybe (GenQuote m)
- oisPillar :: PillarChoice
- oisCustomPillarDate :: Maybe Day
- oisAveragingMethod :: RateAveragingType
- oisEndOfMonth :: Maybe Bool
- oisFixedPaymentFrequency :: Maybe Frequency
- oisFixedCalendar :: Maybe Calendar
- oisObservation :: OvernightObservation
- oisPricer :: Maybe (GenFloatingRateCouponPricer p)
- oisRule :: DateGenerationRule
- oisOvernightCalendar :: Maybe Calendar
- oisConvention :: BusinessDayConvention
- oisFixedDayCount :: Maybe DayCounter
- data OvernightObservation = OvernightObservation {
- lookbackDays :: !(Maybe Word)
- lockoutDays :: !Word
- applyObservationShift :: !Bool
- data IterativeBootstrapOpts = IterativeBootstrapOpts {}
- type BootstrapInitialGuess = RealVector -> RealVector -> IO RealVector
- data Bootstrap rh2
- = Iterative !BootstrapTrait !Interpolation !IterativeBootstrapOpts
- | GlobalDiscountLogLinear !Double ![Double] !(Maybe BootstrapInitialGuess)
- | GlobalSimpleZeroLinear !Double ![Double] !(Maybe BootstrapInitialGuess)
- | GlobalSimpleZeroLinearFull !(NonEmpty (GenRateHelper rh2)) ![Day] !Double ![Double] !(Maybe BootstrapInitialGuess)
- | GlobalForwardRateLinear !Double ![Double] !(Maybe BootstrapInitialGuess)
- | GlobalZeroYieldLinear !Double ![Double] !(Maybe BootstrapInitialGuess)
- | Local !LocalBootstrapTrait !Word !Bool !Double !Double !Double !Bool
- data LocalBootstrapTrait
- data SpreadBootstrap
- data StubIndexSelection ibor
- = ClosestStubIndex !(NonEmpty (GenIborIndex ibor))
- | InterpolatedStubIndexes !(NonEmpty (GenIborIndex ibor))
- asYieldTermStructure :: GenYieldTermStructure y -> IO YieldTermStructure
- asRateHelper :: GenRateHelper rh -> IO RateHelper
- relinkableYieldTermStructure :: Maybe (GenYieldTermStructure y) -> IO RelinkableYieldTermStructure
- fittedBondDiscountCurve :: Reference -> NonEmpty BondHelper -> DayCounter -> FittingMethod -> Double -> Word -> [Double] -> Double -> Bool -> IO FittedBondDiscountCurve
- flatForward :: Reference -> GenQuote q -> DayCounter -> Compounding -> Frequency -> IO YieldTermStructure
- forwardSpreadedTermStructure :: GenYieldTermStructure y -> GenQuote q -> IO YieldTermStructure
- zeroSpreadedTermStructure :: GenYieldTermStructure y -> GenQuote q -> Compounding -> Frequency -> IO YieldTermStructure
- withCompositeZeroYieldStructure :: (Double -> Double -> Double) -> GenYieldTermStructure y1 -> GenYieldTermStructure y2 -> Compounding -> Frequency -> (YieldTermStructure -> IO a) -> IO a
- impliedTermStructureMoving :: GenYieldTermStructure y -> Word -> Calendar -> IO YieldTermStructure
- impliedTermStructure :: GenYieldTermStructure y -> Day -> IO YieldTermStructure
- piecewiseZeroSpreadedTermStructure :: GenYieldTermStructure y -> NonEmpty (Day, GenQuote q) -> Compounding -> Frequency -> Interpolation -> IO YieldTermStructure
- piecewiseForwardSpreadedTermStructure :: GenYieldTermStructure y -> NonEmpty (Day, GenQuote q) -> Interpolation -> IO YieldTermStructure
- quantoTermStructure :: GenYieldTermStructure y1 -> GenYieldTermStructure y2 -> GenYieldTermStructure y3 -> GenBlackVolTermStructure bv1 -> Double -> GenBlackVolTermStructure bv2 -> Double -> Double -> IO YieldTermStructure
- ultimateForwardTermStructure :: GenYieldTermStructure y -> GenQuote q1 -> GenQuote q2 -> (Int, TimeUnit) -> Double -> Maybe Int -> Compounding -> Frequency -> IO YieldTermStructure
- depositRateHelper :: GenQuote q -> DepositTerms ibor -> IO RateHelper
- fixedRateBondHelper :: GenQuote q -> Word -> Double -> Schedule -> NonEmpty Double -> DayCounter -> BusinessDayConvention -> Double -> Maybe Day -> IO BondHelper
- fraRateHelper :: GenQuote q -> FraTerms ibor -> PillarChoice -> Maybe Day -> Bool -> IO RateHelper
- bondHelper :: GenQuote q -> GenBond b -> BondPriceType -> IO BondHelper
- oisRateHelper :: OisTerms -> GenQuote q -> OvernightIborIndex -> Maybe (GenYieldTermStructure y) -> IO OISRateHelper
- defaultOisRateHelperOpts :: OISRateHelperOpts m p
- defaultOvernightObservation :: OvernightObservation
- oisRateHelperWithOptions :: OisTerms -> GenQuote q -> OvernightIborIndex -> Maybe (GenYieldTermStructure y) -> OISRateHelperOpts m p -> IO OISRateHelper
- swapRateHelper :: GenQuote q1 -> SwapRateTerms sidx ibor -> Maybe (GenQuote q2) -> Maybe (GenYieldTermStructure y) -> PillarChoice -> Maybe Day -> Bool -> Maybe Bool -> Maybe (GenFloatingRateCouponPricer frcp) -> IO SwapRateHelper
- bmaSwapRateHelper :: GenQuote q -> (Int, TimeUnit) -> Word -> Calendar -> (Int, TimeUnit) -> BusinessDayConvention -> DayCounter -> BMAIndex -> GenIborIndex ibor -> IO RateHelper
- multipleResetsSwapRateHelper :: Word -> (Int, TimeUnit) -> GenQuote q1 -> GenIborIndex ibor -> Word -> Maybe (GenYieldTermStructure y) -> RateAveragingType -> Double -> Frequency -> DayCounter -> BusinessDayConvention -> IO RateHelper
- futuresRateHelper :: GenQuote q1 -> FuturesTerms ibor -> Maybe (GenQuote q2) -> FuturesType -> IO FuturesRateHelper
- overnightIndexFutureRateHelper :: GenQuote q1 -> Day -> Day -> OvernightIborIndex -> Maybe (GenQuote q2) -> RateAveragingType -> PillarChoice -> Maybe Day -> IO OvernightIndexFutureRateHelper
- sofrFutureRateHelper :: GenQuote q1 -> Month -> Int -> Frequency -> Maybe (GenQuote q2) -> PillarChoice -> Maybe Day -> IO RateHelper
- piecewiseYieldCurve :: Reference -> NonEmpty (GenRateHelper rh) -> DayCounter -> [(Day, GenQuote q)] -> Bootstrap rh2 -> Bool -> IO PiecewiseYieldCurve
- piecewiseSpreadYieldCurve :: GenYieldTermStructure y -> NonEmpty (GenRateHelper rh) -> SpreadBootstrap -> Bool -> IO PiecewiseYieldCurve
- defaultIterativeBootstrapOpts :: IterativeBootstrapOpts
- interpolatedZeroCurve :: NonEmpty (Day, Double) -> DayCounter -> Calendar -> [(Day, GenQuote q)] -> Interpolation -> IO YieldTermStructure
- interpolatedSimpleZeroCurve :: NonEmpty (Day, Double) -> DayCounter -> Calendar -> [(Day, GenQuote q)] -> Interpolation -> IO YieldTermStructure
- interpolatedForwardCurve :: NonEmpty (Day, Double) -> DayCounter -> Calendar -> [(Day, GenQuote q)] -> Interpolation -> IO YieldTermStructure
- interpolatedDiscountCurve :: NonEmpty (Day, Double) -> DayCounter -> Calendar -> [(Day, GenQuote q)] -> Interpolation -> Bool -> IO YieldTermStructure
- interpolatedSpreadDiscountCurve :: GenYieldTermStructure y -> NonEmpty (Day, Double) -> Interpolation -> IO YieldTermStructure
- multiCurve :: Double -> IO MultiCurve
- iborIborBasisSwapRateHelper :: GenQuote q -> (Int, TimeUnit) -> Word -> Calendar -> BusinessDayConvention -> Bool -> GenIborIndex ibor1 -> GenIborIndex ibor2 -> GenYieldTermStructure y -> Bool -> Maybe Bool -> DateGenerationRule -> Int -> Maybe (StubIndexSelection ibor3) -> Maybe (StubIndexSelection ibor4) -> IO RateHelper
- overnightOvernightBasisSwapRateHelper :: GenQuote q -> (Int, TimeUnit) -> Word -> Calendar -> BusinessDayConvention -> Bool -> OvernightIborIndex -> OvernightIborIndex -> Maybe (GenYieldTermStructure y) -> Bool -> Int -> Frequency -> RateAveragingType -> RateAveragingType -> Bool -> DateGenerationRule -> IO RateHelper
- overnightIndexedFundingRateHelper :: FundingTerms -> GenQuote q -> Calendar -> BusinessDayConvention -> Bool -> OvernightIborIndex -> (Int, TimeUnit) -> DayCounter -> Int -> Bool -> DateGenerationRule -> PillarChoice -> Maybe Day -> IO RateHelper
- overnightIborBasisSwapRateHelper :: GenQuote q -> (Int, TimeUnit) -> Word -> Calendar -> BusinessDayConvention -> Bool -> OvernightIborIndex -> GenIborIndex ibor -> Maybe (GenYieldTermStructure y) -> Bool -> Int -> Maybe Frequency -> Maybe Bool -> DateGenerationRule -> RateAveragingType -> Bool -> Bool -> Maybe (StubIndexSelection ibor2) -> IO RateHelper
- constNotionalCrossCurrencyBasisSwapRateHelper :: GenQuote q -> (Int, TimeUnit) -> Word -> Calendar -> BusinessDayConvention -> Bool -> GenIborIndex ibor1 -> GenIborIndex ibor2 -> GenYieldTermStructure y -> Bool -> Bool -> Maybe Frequency -> Int -> Maybe Frequency -> Maybe Bool -> Bool -> Maybe (StubIndexSelection ibor3) -> Maybe (StubIndexSelection ibor4) -> IO RateHelper
- mtmCrossCurrencyBasisSwapRateHelper :: GenQuote q -> (Int, TimeUnit) -> Word -> Calendar -> BusinessDayConvention -> Bool -> GenIborIndex ibor1 -> GenIborIndex ibor2 -> GenYieldTermStructure y -> Bool -> Bool -> Bool -> Maybe Frequency -> Int -> Maybe Frequency -> Word -> Maybe Calendar -> Maybe Bool -> Maybe (StubIndexSelection ibor3) -> Maybe (StubIndexSelection ibor4) -> IO RateHelper
- constNotionalCrossCurrencySwapRateHelper :: GenQuote q -> (Int, TimeUnit) -> Word -> Calendar -> BusinessDayConvention -> Bool -> Frequency -> DayCounter -> GenIborIndex ibor -> GenYieldTermStructure y -> Bool -> Int -> Maybe Bool -> Maybe Frequency -> Maybe (StubIndexSelection ibor2) -> IO RateHelper
- fxSwapRateHelper :: GenQuote q1 -> GenQuote q2 -> FxSwapTerms -> Bool -> GenYieldTermStructure y -> IO RateHelper
- linkTo :: RelinkableYieldTermStructure -> GenYieldTermStructure y -> IO ()
- addBootstrappedCurve :: MultiCurve -> RelinkableYieldTermStructure -> PiecewiseYieldCurve -> IO YieldTermStructure
- addNonBootstrappedCurve :: MultiCurve -> RelinkableYieldTermStructure -> GenYieldTermStructure y -> IO YieldTermStructure
- class HasHelperUnderlying h where
- type HelperUnderlying h
- helperInstrument :: h -> IO (HelperUnderlying h)
- class HasNodes c where
- bootstrappedNodes :: c -> IO [(Day, Double)]
- rateHelperFixingDependencies :: GenRateHelper rh -> IO (Maybe [(String, Day)])
- forwardRate :: GenYieldTermStructure y -> RateInterval -> Compounding -> Frequency -> Bool -> IO InterestRate
- zeroRate :: GenYieldTermStructure y -> RatePoint -> Compounding -> Frequency -> Bool -> IO InterestRate
- discount :: GenYieldTermStructure y -> TermPoint -> Bool -> IO Double
- rateHelperPillarDate :: GenRateHelper rh -> IO Day
- impliedQuote :: GenRateHelper rh -> IO Double
- impliedQuoteOn :: GenRateHelper rh -> GenYieldTermStructure y -> IO Double
- class HasConvexityAdjustment h where
- convexityAdjustment :: h -> IO Double
- minimumCostValue :: FittedBondDiscountCurve -> IO Double
- numberOfIterations :: FittedBondDiscountCurve -> IO Int
- fittingMethodSize :: FittedBondDiscountCurve -> IO Word
- fittingMethodErrorCode :: FittedBondDiscountCurve -> IO EndCriteriaType
- fittingMethodSolution :: FittedBondDiscountCurve -> IO RealVector
- fittingMethodDiscount :: FittedBondDiscountCurve -> [Double] -> Double -> IO Double
Types
Curves and helpers
type GenYieldTermStructure y = GenTermStructure (AnyOf CYieldTermStructure' y) Source #
A YieldTermStructure or one of its leaves; see the hierarchy under GenTermStructure.
type YieldTermStructure = GenYieldTermStructure CYieldTermStructure Source #
A TermStructure; see the hierarchy under GenTermStructure.
type PiecewiseYieldCurve = GenYieldTermStructure CPiecewiseYieldCurve Source #
A bootstrapped yield curve retaining its concrete native node accessor.
type RelinkableYieldTermStructure = GenYieldTermStructure CRelinkableYieldTermStructure Source #
A curve held behind a relinkable handle. It is a YieldTermStructure -- pass it
anywhere a curve is expected and it upcasts like any other hierarchy member, sharing its
Link so that a later linkTo reaches everything already
built on it.
See the hierarchy under GenTermStructure.
type FittedBondDiscountCurve = GenYieldTermStructure CFittedBondDiscountCurve Source #
A YieldTermStructure; see the hierarchy under GenTermStructure.
data MultiCurve Source #
data GenRateHelper rh Source #
RateHelper BondHelper SwapRateHelper OISRateHelper FuturesRateHelper OvernightIndexFutureRateHelper
Instances
type RateHelper = GenRateHelper CRateHelper Source #
The root of the hierarchy shown under GenRateHelper.
type BondHelper = GenRateHelper CBondHelper Source #
A RateHelper; see the hierarchy under GenRateHelper.
type SwapRateHelper = GenRateHelper CSwapRateHelper Source #
A RateHelper; see the hierarchy under GenRateHelper.
type OISRateHelper = GenRateHelper COISRateHelper Source #
A RateHelper; see the hierarchy under GenRateHelper.
type FuturesRateHelper = GenRateHelper CFuturesRateHelper Source #
A RateHelper; see the hierarchy under GenRateHelper.
type OvernightIndexFutureRateHelper = GenRateHelper COvernightIndexFutureRateHelper Source #
A RateHelper; see the hierarchy under GenRateHelper.
Coordinates
A term-structure reference point. ReferenceDate stays fixed for the object's lifetime;
SettlementDays follows the global evaluation date using the supplied calendar.
Constructors
| ReferenceDate !Day | |
| SettlementDays !Word !Calendar |
A date or year-fraction coordinate measured from a term structure's reference date.
A date or year-fraction coordinate where a date needs its day-counting rule.
Constructors
| RateAtDate !Day !DayCounter | |
| RateAtTime !Double |
data RateInterval Source #
A same-representation interval where dates need their day-counting rule; times use the curve's own.
Constructors
| RateBetweenDates !Day !Day !DayCounter | |
| RateBetweenTimes !Double !Double |
Instances
| Show RateInterval Source # | |
Defined in QuantLib.TermStructure Methods showsPrec :: Int -> RateInterval -> ShowS # show :: RateInterval -> String # showList :: [RateInterval] -> ShowS # | |
| Eq RateInterval Source # | |
Defined in QuantLib.TermStructure | |
Bootstrap and contract configuration
data FittingMethod Source #
Constructors
| CubicBSplines | |
Fields
| |
| ExponentialSplines | |
| NelsonSiegel | |
Fields
| |
| SimplePolynomial | |
Fields
| |
| Svensson | |
Fields
| |
data BootstrapTrait Source #
Constructors
| Discount | |
| ZeroYield | |
| ForwardRate | |
| SimpleZeroYield |
Instances
| Enum BootstrapTrait Source # | |
Defined in QuantLib.TermStructure.Yield Methods succ :: BootstrapTrait -> BootstrapTrait # pred :: BootstrapTrait -> BootstrapTrait # toEnum :: Int -> BootstrapTrait # fromEnum :: BootstrapTrait -> Int # enumFrom :: BootstrapTrait -> [BootstrapTrait] # enumFromThen :: BootstrapTrait -> BootstrapTrait -> [BootstrapTrait] # enumFromTo :: BootstrapTrait -> BootstrapTrait -> [BootstrapTrait] # enumFromThenTo :: BootstrapTrait -> BootstrapTrait -> BootstrapTrait -> [BootstrapTrait] # | |
| Read BootstrapTrait Source # | |
Defined in QuantLib.TermStructure.Yield Methods readsPrec :: Int -> ReadS BootstrapTrait # readList :: ReadS [BootstrapTrait] # | |
| Show BootstrapTrait Source # | |
Defined in QuantLib.TermStructure.Yield Methods showsPrec :: Int -> BootstrapTrait -> ShowS # show :: BootstrapTrait -> String # showList :: [BootstrapTrait] -> ShowS # | |
| Eq BootstrapTrait Source # | |
Defined in QuantLib.TermStructure.Yield Methods (==) :: BootstrapTrait -> BootstrapTrait -> Bool # (/=) :: BootstrapTrait -> BootstrapTrait -> Bool # | |
data PillarChoice Source #
Constructors
| MaturityDate | |
| LastRelevantDate | |
| CustomDate |
Instances
| Enum PillarChoice Source # | |
Defined in QuantLib.TermStructure.Yield Methods succ :: PillarChoice -> PillarChoice # pred :: PillarChoice -> PillarChoice # toEnum :: Int -> PillarChoice # fromEnum :: PillarChoice -> Int # enumFrom :: PillarChoice -> [PillarChoice] # enumFromThen :: PillarChoice -> PillarChoice -> [PillarChoice] # enumFromTo :: PillarChoice -> PillarChoice -> [PillarChoice] # enumFromThenTo :: PillarChoice -> PillarChoice -> PillarChoice -> [PillarChoice] # | |
| Read PillarChoice Source # | |
Defined in QuantLib.TermStructure.Yield Methods readsPrec :: Int -> ReadS PillarChoice # readList :: ReadS [PillarChoice] # | |
| Show PillarChoice Source # | |
Defined in QuantLib.TermStructure.Yield Methods showsPrec :: Int -> PillarChoice -> ShowS # show :: PillarChoice -> String # showList :: [PillarChoice] -> ShowS # | |
| Eq PillarChoice Source # | |
Defined in QuantLib.TermStructure.Yield | |
data FuturesType Source #
Instances
| Enum FuturesType Source # | |
Defined in QuantLib.TermStructure.Yield Methods succ :: FuturesType -> FuturesType # pred :: FuturesType -> FuturesType # toEnum :: Int -> FuturesType # fromEnum :: FuturesType -> Int # enumFrom :: FuturesType -> [FuturesType] # enumFromThen :: FuturesType -> FuturesType -> [FuturesType] # enumFromTo :: FuturesType -> FuturesType -> [FuturesType] # enumFromThenTo :: FuturesType -> FuturesType -> FuturesType -> [FuturesType] # | |
| Read FuturesType Source # | |
Defined in QuantLib.TermStructure.Yield Methods readsPrec :: Int -> ReadS FuturesType # readList :: ReadS [FuturesType] # readPrec :: ReadPrec FuturesType # readListPrec :: ReadPrec [FuturesType] # | |
| Show FuturesType Source # | |
Defined in QuantLib.TermStructure.Yield Methods showsPrec :: Int -> FuturesType -> ShowS # show :: FuturesType -> String # showList :: [FuturesType] -> ShowS # | |
| Eq FuturesType Source # | |
Defined in QuantLib.TermStructure.Yield | |
data DepositTerms ibor Source #
How a deposit's period and fixing conventions are given. DepositTenor and DepositFromIndex
are relative to the evaluation date: the deposit starts at spot and its dates move when the
evaluation date does. DepositFromIndex takes the tenor and conventions from the ibor index;
DepositTenor states them and fixes on an index QuantLib names "no-fix".
DepositOnFixingDate is the deposit the index fixes on the given date. Its dates never move, and
once that date is before the evaluation date its implied quote is the stored fixing, so
rateHelperFixingDependencies reports it.
Constructors
| DepositTenor | |
Fields
| |
| DepositFromIndex !(GenIborIndex ibor) | |
| DepositOnFixingDate | |
Fields
| |
How a FRA's period and fixing conventions are given. The FromIndex variants take the
FRA's length and its calendar/convention/day-count from the ibor index; the months and
period variants without an index state them explicitly. FraImmOffsets starts and ends the
FRA on the given IMM dates after spot, counting the first as 1, and takes the rest from the
index. All of these are relative to the evaluation date. FraBetweenDates is not: it runs from
the start date to the end date and fixes where the index fixes for the start date, and, with
useIndexedCoupon, its implied quote is the stored fixing once that date is before the
evaluation date, which rateHelperFixingDependencies reports.
Constructors
| FraMonths | |
Fields
| |
| FraMonthsFromIndex | |
Fields
| |
| FraPeriod | |
Fields
| |
| FraPeriodFromIndex | |
Fields
| |
| FraImmOffsets | |
Fields
| |
| FraBetweenDates | |
Fields
| |
data SwapRateTerms sidx ibor Source #
How a swap helper's schedule and legs are given. SwapRateFromIndex takes every convention
from a swap index, SwapRateTenor states them for a swap of the given tenor starting at spot
plus fwdStart, and both are relative to the evaluation date: the swap's dates move when it
does. SwapRateBetweenDates is the swap between two fixed dates; once a coupon's fixing date is
before the evaluation date that coupon reads the stored fixing, which
rateHelperFixingDependencies reports with the rest. settlementDays (Nothing takes the
index's fixing days) and floatConvention (Nothing takes the index's convention) exist only
in the forms that state their conventions.
Constructors
| SwapRateFromIndex !(GenSwapIndex sidx) !(Int, TimeUnit) | fwdStart |
| SwapRateTenor | |
Fields
| |
| SwapRateBetweenDates | |
Fields
| |
How an OIS helper's dates are given. OisTenor is relative to the evaluation date: the swap
starts settlementDays after it plus forwardStart and runs for tenor. OisBetweenDates
runs between two fixed dates; every overnight fixing it compounds over that is before the
evaluation date is read from the store. forwardStart is a field of OisTenor rather than
of OISRateHelperOpts because QuantLib's dated constructor has none.
data FxSwapTerms Source #
How an FX swap helper's dates are given. FxSwapTenor is relative to the evaluation date:
the swap starts fixingDays business days after it on calendar and runs for tenor, and
tradingCalendar (QuantLib's null calendar for none) is joined with calendar for the spot
date. FxSwapBetweenDates runs between two fixed dates.
Constructors
| FxSwapTenor | |
| FxSwapBetweenDates | |
data FundingTerms Source #
Dates for a funding-margin helper: settlement days and tenor, or fixed endpoints.
Constructors
| FundingTenor !Word !(Int, TimeUnit) | |
| FundingBetweenDates !Day !Day |
data FuturesTerms ibor Source #
How an IborIndex futures contract's underlying deposit is given. FuturesFromIndex takes
the deposit's length and its calendar/convention/day-count from the ibor index; the others
state them explicitly.
Constructors
| FuturesMonths | |
Fields
| |
| FuturesBetweenDates | |
Fields
| |
| FuturesFromIndex | |
Fields
| |
data OISRateHelperOpts m p Source #
Constructors
| OISRateHelperOpts | |
Fields
| |
data OvernightObservation Source #
Constructors
| OvernightObservation | |
Fields
| |
Instances
| Show OvernightObservation Source # | |
Defined in QuantLib.Internal.Common Methods showsPrec :: Int -> OvernightObservation -> ShowS # show :: OvernightObservation -> String # showList :: [OvernightObservation] -> ShowS # | |
| Eq OvernightObservation Source # | |
Defined in QuantLib.Internal.Common Methods (==) :: OvernightObservation -> OvernightObservation -> Bool # (/=) :: OvernightObservation -> OvernightObservation -> Bool # | |
data IterativeBootstrapOpts Source #
Every constructor parameter of QuantLib's curve-generic IterativeBootstrap.
The first three fields are Maybe because Nothing preserves QuantLib's
Null<Real>() sentinel, which selects a suitable value for each curve pillar.
Constructors
| IterativeBootstrapOpts | |
Fields
| |
type BootstrapInitialGuess = RealVector -> RealVector -> IO RealVector Source #
Whole-curve initial guess: node times (including time zero), previous data (empty on first bootstrap), and one trait-specific guess per non-reference pillar. Inputs are borrowed: copy them before retaining them past the callback. Ignored, without execution, on QuantLib 1.43.
Selects the bootstrapper used by piecewiseYieldCurve and carries exactly the
parameters valid for that choice. Iterative uses the selected trait, interpolation, and
full iterative settings. The Global* constructors solve all instruments together; their
list field contains instrument weights, with an empty list selecting equal weights.
GlobalSimpleZeroLinearFull additionally takes helper instruments, their interpolation
dates (exactly two fewer than the helpers), and accuracy. Local uses ConvexMonotone
interpolation and restricts the trait to LocalBootstrapTrait, because Discount produces
invalid results with QuantLib's local bootstrapper.
Constructors
| Iterative !BootstrapTrait !Interpolation !IterativeBootstrapOpts | |
| GlobalDiscountLogLinear !Double ![Double] !(Maybe BootstrapInitialGuess) | accuracy, instrumentWeights (empty for equal weights), initialGuess |
| GlobalSimpleZeroLinear !Double ![Double] !(Maybe BootstrapInitialGuess) | accuracy, instrumentWeights (empty for equal weights), initialGuess |
| GlobalSimpleZeroLinearFull !(NonEmpty (GenRateHelper rh2)) ![Day] !Double ![Double] !(Maybe BootstrapInitialGuess) | additionalHelpers, additionalDates, accuracy, instrumentWeights, initialGuess |
| GlobalForwardRateLinear !Double ![Double] !(Maybe BootstrapInitialGuess) | accuracy, instrumentWeights (empty for equal weights), initialGuess |
| GlobalZeroYieldLinear !Double ![Double] !(Maybe BootstrapInitialGuess) | accuracy, instrumentWeights (empty for equal weights), initialGuess |
| Local !LocalBootstrapTrait !Word !Bool !Double !Double !Double !Bool | trait, localisation, forcePositive (LocalBootstrap's), accuracy, quadraticity, monotonicity, convexForcePositive (ConvexMonotone's) |
data LocalBootstrapTrait Source #
Bootstrap traits that are numerically usable with LocalBootstrap and
ConvexMonotone. Discount is intentionally unrepresentable.
Constructors
| LForwardRate | |
| LZeroYield | |
| LSimpleZeroYield |
Instances
| Read LocalBootstrapTrait Source # | |
Defined in QuantLib.TermStructure.Yield Methods readsPrec :: Int -> ReadS LocalBootstrapTrait # readList :: ReadS [LocalBootstrapTrait] # | |
| Show LocalBootstrapTrait Source # | |
Defined in QuantLib.TermStructure.Yield Methods showsPrec :: Int -> LocalBootstrapTrait -> ShowS # show :: LocalBootstrapTrait -> String # showList :: [LocalBootstrapTrait] -> ShowS # | |
| Eq LocalBootstrapTrait Source # | |
Defined in QuantLib.TermStructure.Yield Methods (==) :: LocalBootstrapTrait -> LocalBootstrapTrait -> Bool # (/=) :: LocalBootstrapTrait -> LocalBootstrapTrait -> Bool # | |
data SpreadBootstrap Source #
Bootstrapper for piecewiseSpreadYieldCurve, whose nodes are always discount-factor spreads.
LogLinear interpolation gives piecewise-constant forward spreads, upstream's canonical choice.
Constructors
| SpreadIterative !Interpolation !IterativeBootstrapOpts | |
| SpreadGlobalLogLinear !Double ![Double] !(Maybe BootstrapInitialGuess) | accuracy, instrumentWeights (empty for equal weights), initialGuess |
data StubIndexSelection ibor Source #
Candidate indices for broken IBOR periods, selected by nearest maturity or interpolated between bracketing maturities in calendar days. Candidates keep their own curves and histories. Their currency, fixing days/calendar and day counter must match; enable indexed coupons when supplying a selection. Requires QuantLib 1.44.
Constructors
| ClosestStubIndex !(NonEmpty (GenIborIndex ibor)) | |
| InterpolatedStubIndexes !(NonEmpty (GenIborIndex ibor)) |
Constructors
Hierarchy and handles
asRateHelper :: GenRateHelper rh -> IO RateHelper Source #
relinkableYieldTermStructure :: Maybe (GenYieldTermStructure y) -> IO RelinkableYieldTermStructure Source #
A curve behind a relinkable handle. The result is a YieldTermStructure: pass it to
any curve-taking function and everything built on it keeps tracking whatever the handle
currently points at, so a later linkTo reprices already-constructed instruments
without rebuilding them. Nothing gives an empty handle -- meaningful rather than an
error, since that is what makes a rate helper discount off the curve being bootstrapped
-- but reading a curve value through one throws until it is linked.
Flat, fitted and derived curves
fittedBondDiscountCurve :: Reference -> NonEmpty BondHelper -> DayCounter -> FittingMethod -> Double -> Word -> [Double] -> Double -> Bool -> IO FittedBondDiscountCurve Source #
Construct a fitted bond discount curve with either a fixed or moving reference point.
flatForward :: Reference -> GenQuote q -> DayCounter -> Compounding -> Frequency -> IO YieldTermStructure Source #
Flat interest-rate curve with either a fixed or evaluation-date-relative reference point.
forwardSpreadedTermStructure :: GenYieldTermStructure y -> GenQuote q -> IO YieldTermStructure Source #
A yield curve offset from baseCurve by a spread added to its instantaneous forward rate,
remaining linked to changes in either.
zeroSpreadedTermStructure :: GenYieldTermStructure y -> GenQuote q -> Compounding -> Frequency -> IO YieldTermStructure Source #
A yield curve offset from baseCurve by a spread added to its zero-yield rate, remaining
linked to changes in either.
withCompositeZeroYieldStructure Source #
Arguments
| :: (Double -> Double -> Double) | f(rate1, rate2) |
| -> GenYieldTermStructure y1 | curve1 |
| -> GenYieldTermStructure y2 | curve2 |
| -> Compounding | |
| -> Frequency | |
| -> (YieldTermStructure -> IO a) | |
| -> IO a |
A yield curve whose zero rate is f rate1 rate2, where rate1 and rate2 are the
input curves' zero rates expressed with the given compounding and frequency. The result is
live in both inputs.
The curve and its native dependents retain f after the continuation returns.
Callback exceptions are rethrown by the enclosing Haskell call.
impliedTermStructureMoving Source #
Arguments
| :: GenYieldTermStructure y | curve |
| -> Word | settlementDays |
| -> Calendar | calendar |
| -> IO YieldTermStructure |
An implied curve whose reference date moves with the evaluation date by settlement days. Shares the original curve's observable handle. Requires QuantLib 1.44.
impliedTermStructure :: GenYieldTermStructure y -> Day -> IO YieldTermStructure Source #
A yield curve identical to baseCurve but reporting a different reference date; observes
and stays linked to baseCurve.
piecewiseZeroSpreadedTermStructure Source #
Arguments
| :: GenYieldTermStructure y | |
| -> NonEmpty (Day, GenQuote q) | spreads |
| -> Compounding | |
| -> Frequency | |
| -> Interpolation | |
| -> IO YieldTermStructure |
A yield curve with a vector of zero-yield spreads added to baseCurve, interpolating
between the given dates with the given Interpolation. Remains linked to changes in
baseCurve or the spread quotes.
piecewiseForwardSpreadedTermStructure Source #
Arguments
| :: GenYieldTermStructure y | |
| -> NonEmpty (Day, GenQuote q) | spreads |
| -> Interpolation | |
| -> IO YieldTermStructure |
A yield curve adding interpolated instantaneous-forward spreads to baseCurve, flat outside
the spread dates. Linked to the base curve and quotes; its max date is the earlier of the base
curve's and the last spread date. LogLinear and LogCubic throw: the spread is integrated.
Arguments
| :: GenYieldTermStructure y1 | underlyingDividendTS |
| -> GenYieldTermStructure y2 | riskFreeTS |
| -> GenYieldTermStructure y3 | foreignRsikFreeTS |
| -> GenBlackVolTermStructure bv1 | underlyingBlackVolTS |
| -> Double | strike |
| -> GenBlackVolTermStructure bv2 | exchRateBlackVolTS |
| -> Double | exchRateATMlevel |
| -> Double | underlyingExchRateCorrelation |
| -> IO YieldTermStructure |
Quanto term structure, modelling the quanto effect in option pricing. Stays linked to all four inputs.
ultimateForwardTermStructure Source #
Arguments
| :: GenYieldTermStructure y | originalCurve |
| -> GenQuote q1 | lastLiquidForwardRate |
| -> GenQuote q2 | ultimateForwardRate |
| -> (Int, TimeUnit) | firstSmoothingPoint |
| -> Double | alpha |
| -> Maybe Int | roundingDigits |
| -> Compounding | |
| -> Frequency | |
| -> IO YieldTermStructure |
Blends originalCurve with an ultimate forward rate beyond the last liquid point, per the
"UFR" methodology used for extrapolating long-dated (e.g. Solvency II) curves.
Rate helpers
depositRateHelper :: GenQuote q -> DepositTerms ibor -> IO RateHelper Source #
Rate helper for bootstrapping over deposit rates.
Arguments
| :: GenQuote q | |
| -> Word | settlementDays |
| -> Double | faceAmount |
| -> Schedule | |
| -> NonEmpty Double | coupons |
| -> DayCounter | |
| -> BusinessDayConvention | paymentConvention |
| -> Double | redemption |
| -> Maybe Day | issueDate |
| -> IO BondHelper |
Fixed-coupon bond helper for curve bootstrap: builds the underlying bond internally from a
schedule and coupons (unlike bondHelper, which takes an existing Bond).
Arguments
| :: GenQuote q | |
| -> FraTerms ibor | |
| -> PillarChoice | pillar |
| -> Maybe Day | customPillarDate |
| -> Bool | useIndexedCoupon |
| -> IO RateHelper |
Rate helper for bootstrapping over FRA rates.
bondHelper :: GenQuote q -> GenBond b -> BondPriceType -> IO BondHelper Source #
Warning Setting a pricing engine to the passed bond from external code will cause the bootstrap to fail or to give wrong results. It is advised to discard the bond after creating the helper, so that the helper has sole ownership of it.
BondPriceType is marshalled as an Int to avoid a c2hs cross-module enum-import cycle.
oisRateHelper :: OisTerms -> GenQuote q -> OvernightIborIndex -> Maybe (GenYieldTermStructure y) -> IO OISRateHelper Source #
Rate helper for bootstrapping over overnight-indexed swap rates, with QuantLib's defaults for
everything oisRateHelperWithOptions can set. Both share the same full-arity bindings.
defaultOvernightObservation :: OvernightObservation Source #
Upstream's own defaults: index fixing days, no lockout, no observation shift.
oisRateHelperWithOptions :: OisTerms -> GenQuote q -> OvernightIborIndex -> Maybe (GenYieldTermStructure y) -> OISRateHelperOpts m p -> IO OISRateHelper Source #
oisRateHelper with every trailing QuantLib parameter taken from an options record.
Arguments
| :: GenQuote q1 | rate |
| -> SwapRateTerms sidx ibor | |
| -> Maybe (GenQuote q2) | spread |
| -> Maybe (GenYieldTermStructure y) | discountingCurve |
| -> PillarChoice | pillar |
| -> Maybe Day | customPillarDate |
| -> Bool | endOfMonth |
| -> Maybe Bool | useIndexedCoupons |
| -> Maybe (GenFloatingRateCouponPricer frcp) | couponPricer |
| -> IO SwapRateHelper |
Rate helper for bootstrapping over swap rates: a fixed-vs-ibor swap whose fair rate is the quote.
Arguments
| :: GenQuote q | liborFraction |
| -> (Int, TimeUnit) | tenor |
| -> Word | settlementDAys |
| -> Calendar | |
| -> (Int, TimeUnit) | bmpPeriod |
| -> BusinessDayConvention | |
| -> DayCounter | |
| -> BMAIndex | |
| -> GenIborIndex ibor | |
| -> IO RateHelper |
Rate helper for bootstrapping over BMA swap rates.
multipleResetsSwapRateHelper Source #
Arguments
| :: Word | settlementDays |
| -> (Int, TimeUnit) | tenor |
| -> GenQuote q1 | fixedRate |
| -> GenIborIndex ibor | |
| -> Word | resetsPerCoupon |
| -> Maybe (GenYieldTermStructure y) | discountingCurve |
| -> RateAveragingType | averagingMethod |
| -> Double | spread |
| -> Frequency | fixedFrequency |
| -> DayCounter | fixedDayCount |
| -> BusinessDayConvention | fixedConvention |
| -> IO RateHelper |
Rate helper for bootstrapping from multiple-resets swap quotes (a floating leg that resets several times per fixed-leg coupon period).
Arguments
| :: GenQuote q1 | price |
| -> FuturesTerms ibor | |
| -> Maybe (GenQuote q2) | convexityAdjustment |
| -> FuturesType | type |
| -> IO FuturesRateHelper |
Rate helper for bootstrapping over IborIndex futures prices.
overnightIndexFutureRateHelper Source #
Arguments
| :: GenQuote q1 | |
| -> Day | valueDate |
| -> Day | maturityDate |
| -> OvernightIborIndex | |
| -> Maybe (GenQuote q2) | convexityAdjustment |
| -> RateAveragingType | averagingMethod |
| -> PillarChoice | pillar |
| -> Maybe Day | customPillarDate |
| -> IO OvernightIndexFutureRateHelper |
Rate helper for bootstrapping over overnight-index compounding futures.
Arguments
| :: GenQuote q1 | |
| -> Month | referenceMonth |
| -> Int | referenceYear |
| -> Frequency | referenceFreq |
| -> Maybe (GenQuote q2) | convexityAdjustment |
| -> PillarChoice | pillar |
| -> Maybe Day | customPillarDate |
| -> IO RateHelper |
Rate helper for bootstrapping over CME SOFR futures. Compounds overnight SOFR from the third
Wednesday of referenceMonth/referenceYear (inclusive) to the third Wednesday of the
following month or quarter (exclusive), per referenceFreq.
Bootstrapped and interpolated curves
Arguments
| :: Reference | |
| -> NonEmpty (GenRateHelper rh) | instruments |
| -> DayCounter | dayCounter |
| -> [(Day, GenQuote q)] | jumps |
| -> Bootstrap rh2 | bootstrapper choice |
| -> Bool | extrapolate past the curve's max date |
| -> IO PiecewiseYieldCurve |
Bootstraps a term structure with either a fixed or evaluation-date-relative reference point.
Bootstrap selects iterative, global, or local construction; the final flag controls
extrapolation past the curve's maximum date.
piecewiseSpreadYieldCurve Source #
Arguments
| :: GenYieldTermStructure y | baseCurve |
| -> NonEmpty (GenRateHelper rh) | instruments |
| -> SpreadBootstrap | bootstrapper choice |
| -> Bool | extrapolate past the curve's max date |
| -> IO PiecewiseYieldCurve |
Bootstraps multiplicative discount-factor spreads over baseCurve so that each instrument
reprices on the combined curve. Reference date, calendar and day counter come from the linked
base curve; past the last node the forward spread stays flat. bootstrappedNodes
reads the calibrated spread geometry for both bootstrap choices. Upcast explicitly with
asYieldTermStructure when a concrete parent type is required.
interpolatedZeroCurve Source #
Arguments
| :: NonEmpty (Day, Double) | dates, yields |
| -> DayCounter | dayCounter |
| -> Calendar | cal |
| -> [(Day, GenQuote q)] | jumps, jumpDates |
| -> Interpolation | interpolator |
| -> IO YieldTermStructure |
Yield curve interpolating zero-yield rates directly between the given dates. Always uses
upstream's own default compounding (Continuous, Annual); use interpolatedSimpleZeroCurve
for simple compounding.
interpolatedSimpleZeroCurve Source #
Arguments
| :: NonEmpty (Day, Double) | dates, yields |
| -> DayCounter | dayCounter |
| -> Calendar | cal |
| -> [(Day, GenQuote q)] | jumps, jumpDates |
| -> Interpolation | interpolator |
| -> IO YieldTermStructure |
Yield curve interpolating simply-compounded zero rates directly between the given dates.
interpolatedForwardCurve Source #
Arguments
| :: NonEmpty (Day, Double) | dates, forwards |
| -> DayCounter | dayCounter |
| -> Calendar | cal |
| -> [(Day, GenQuote q)] | jumps |
| -> Interpolation | interpolator |
| -> IO YieldTermStructure |
Yield curve interpolating instantaneous forward rates directly between the given dates.
interpolatedDiscountCurve Source #
Arguments
| :: NonEmpty (Day, Double) | dates, dfs |
| -> DayCounter | dayCounter |
| -> Calendar | cal |
| -> [(Day, GenQuote q)] | jumps |
| -> Interpolation | interpolator |
| -> Bool | extrapolate past the curve's max date |
| -> IO YieldTermStructure |
Yield curve interpolating discount factors directly between the given dates.
interpolatedSpreadDiscountCurve Source #
Arguments
| :: GenYieldTermStructure y | |
| -> NonEmpty (Day, Double) | dates, dfs |
| -> Interpolation | interpolator |
| -> IO YieldTermStructure |
Discount factors interpolated as a multiplicative spread applied on top of baseCurve.
Upstream requires the first discount factor to be exactly 1.0, flagging its date as the
curve's own reference date; a mismatched leading value throws a Error.
Multi-curve bootstrapping
Arguments
| :: Double | accuracy |
| -> IO MultiCurve |
Builds a set of curves that form a genuine dependency cycle -- the scenario
RelinkableYieldTermStructure exists for. Protocol (see the class's own upstream doc
comment): build each member curve's rate helpers off an empty relinkableYieldTermStructure
(the internal handle), construct the curves themselves (e.g. via
piecewiseYieldCurve), then hand each pair of (internal handle, curve) to
addBootstrappedCurve -- which returns an external handle to reference the curve by from
then on, and links the internal handle to it (with ownership/observability stripped to avoid
shared_ptr and notification cycles) so the curves' own cross-references resolve.
Only the MultiCurve value and the returned external handles keep the group alive, so
instruments outside the cycle must use indexes built on the external handles. An original
member handle keeps only its own curve, and internal handles keep nothing: once the group is
released, anything reached through either raises an error instead of pricing.
Leak hazard: members must reference each other through internal handles. A member curve, rate helper, or index inside the cycle built on an external handle makes the group own itself, so it is never freed. Original member handles do not create such a cycle.
Basis and cross-currency helpers
iborIborBasisSwapRateHelper Source #
Arguments
| :: GenQuote q | basis |
| -> (Int, TimeUnit) | tenor |
| -> Word | settlementDays |
| -> Calendar | calendar |
| -> BusinessDayConvention | convention |
| -> Bool | endOfMonth |
| -> GenIborIndex ibor1 | baseIndex |
| -> GenIborIndex ibor2 | otherIndex |
| -> GenYieldTermStructure y | discountHandle |
| -> Bool | bootstrapBaseCurve |
| -> Maybe Bool | useIndexedCoupons (1.44; QuantLib 1.43 requires |
| -> DateGenerationRule | rule (1.44; QuantLib 1.43 requires |
| -> Int | paymentLag (1.44; QuantLib 1.43 requires 0) |
| -> Maybe (StubIndexSelection ibor3) | baseStub (1.44; QuantLib 1.43 requires |
| -> Maybe (StubIndexSelection ibor4) | otherStub (1.44; QuantLib 1.43 requires |
| -> IO RateHelper |
Bootstrapping helper for an ibor-ibor basis swap: pays baseIndex + basis, receives
otherIndex. Pass bootstrapBaseCurve = True (with otherIndex carrying a forecast curve)
to bootstrap the forecast curve for baseIndex, or False (with baseIndex carrying a
forecast curve) to bootstrap the forecast curve for otherIndex. An exogenous discount curve
is always required.
overnightOvernightBasisSwapRateHelper Source #
Arguments
| :: GenQuote q | basis |
| -> (Int, TimeUnit) | tenorLen |
| -> Word | settlementDays |
| -> Calendar | calendar |
| -> BusinessDayConvention | convention |
| -> Bool | endOfMonth |
| -> OvernightIborIndex | baseIndex |
| -> OvernightIborIndex | otherIndex |
| -> Maybe (GenYieldTermStructure y) | discount |
| -> Bool | bootstrapBaseCurve |
| -> Int | paymentLag |
| -> Frequency | paymentFrequency |
| -> RateAveragingType | baseAveragingMethod |
| -> RateAveragingType | otherAveragingMethod |
| -> Bool | telescopicValueDates |
| -> DateGenerationRule | rule |
| -> IO RateHelper |
Basis helper paying base overnight plus basis and receiving the other overnight rate. Empty discount handle uses the bootstrapped curve; averaging is independent per leg. NoFrequency creates one coupon per leg. Requires QuantLib 1.44.
overnightIndexedFundingRateHelper Source #
Arguments
| :: FundingTerms | contract dates |
| -> GenQuote q | margin |
| -> Calendar | calendar |
| -> BusinessDayConvention | convention |
| -> Bool | endOfMonth |
| -> OvernightIborIndex | index |
| -> (Int, TimeUnit) | paymentTenor |
| -> DayCounter | paymentDayCounter |
| -> Int | paymentLag |
| -> Bool | telescopicValueDates |
| -> DateGenerationRule | rule |
| -> PillarChoice | pillar |
| -> Maybe Day | customPillarDate |
| -> IO RateHelper |
Funding-margin helper with principal exchanges and compounded overnight coupons. The index projects from an exogenous curve; the bootstrapped curve discounts every flow. Payment lag also applies to principal exchanges. Requires QuantLib 1.44.
overnightIborBasisSwapRateHelper Source #
Arguments
| :: GenQuote q | basis |
| -> (Int, TimeUnit) | tenor |
| -> Word | settlementDays |
| -> Calendar | calendar |
| -> BusinessDayConvention | convention |
| -> Bool | endOfMonth |
| -> OvernightIborIndex | baseIndex |
| -> GenIborIndex ibor | otherIndex |
| -> Maybe (GenYieldTermStructure y) | discountHandle |
| -> Bool | bootstrapBaseCurve (1.44; QuantLib 1.43 requires |
| -> Int | paymentLag (1.44; QuantLib 1.43 requires 0) |
| -> Maybe Frequency | overnightPaymentFrequency (1.44; QuantLib 1.43 requires |
| -> Maybe Bool | useIndexedCoupons (1.44; QuantLib 1.43 requires |
| -> DateGenerationRule | rule (1.44; QuantLib 1.43 requires |
| -> RateAveragingType | averagingMethod (1.44; QuantLib 1.43 requires |
| -> Bool | telescopicValueDates (1.44; QuantLib 1.43 requires |
| -> Bool | basisOnIborLeg (1.44; QuantLib 1.43 requires |
| -> Maybe (StubIndexSelection ibor2) | iborStub (1.44; QuantLib 1.43 requires |
| -> IO RateHelper |
Bootstrapping helper for an overnight-ibor basis swap: pays baseIndex + basis, receives
otherIndex. Bootstraps the forecast curve for otherIndex; baseIndex needs an existing
forecast curve on 1.43. On 1.44, bootstrapBaseCurve chooses the projected leg; an empty
discount handle uses the bootstrapped curve (1.43 uses the overnight curve).
constNotionalCrossCurrencyBasisSwapRateHelper Source #
Arguments
| :: GenQuote q | basis |
| -> (Int, TimeUnit) | tenor |
| -> Word | fixingDays |
| -> Calendar | calendar |
| -> BusinessDayConvention | convention |
| -> Bool | endOfMonth |
| -> GenIborIndex ibor1 | baseCurrencyIndex |
| -> GenIborIndex ibor2 | quoteCurrencyIndex |
| -> GenYieldTermStructure y | collateralCurve |
| -> Bool | isFxBaseCurrencyCollateralCurrency |
| -> Bool | isBasisOnFxBaseCurrencyLeg |
| -> Maybe Frequency | paymentFrequency |
| -> Int | paymentLag |
| -> Maybe Frequency | quoteCurrencyPaymentFrequency |
| -> Maybe Bool | useIndexedCoupons (1.44; QuantLib 1.43 requires |
| -> Bool | paymentLagOnNotionalExchanges (1.44; QuantLib 1.43 requires |
| -> Maybe (StubIndexSelection ibor3) | baseStub (1.44; QuantLib 1.43 requires |
| -> Maybe (StubIndexSelection ibor4) | quoteStub (1.44; QuantLib 1.43 requires |
| -> IO RateHelper |
Bootstrapping helper for a constant-notional cross-currency basis swap: the collateral is
paid in the quote currency, the basis is given on the base-currency leg. Nothing for either
frequency parameter derives the corresponding leg's schedule from its index tenor (or, for the
quote-currency leg, falls back to the base-currency frequency if that is given).
mtmCrossCurrencyBasisSwapRateHelper Source #
Arguments
| :: GenQuote q | basis |
| -> (Int, TimeUnit) | tenor |
| -> Word | fixingDays |
| -> Calendar | calendar |
| -> BusinessDayConvention | convention |
| -> Bool | endOfMonth |
| -> GenIborIndex ibor1 | baseCurrencyIndex |
| -> GenIborIndex ibor2 | quoteCurrencyIndex |
| -> GenYieldTermStructure y | collateralCurve |
| -> Bool | isFxBaseCurrencyCollateralCurrency |
| -> Bool | isBasisOnFxBaseCurrencyLeg |
| -> Bool | isFxBaseCurrencyLegResettable |
| -> Maybe Frequency | paymentFrequency |
| -> Int | paymentLag |
| -> Maybe Frequency | quoteCurrencyPaymentFrequency |
| -> Word | fxResetFixingDays (1.44; QuantLib 1.43 requires 0) |
| -> Maybe Calendar | fxResetFixingCalendar (1.44; QuantLib 1.43 requires |
| -> Maybe Bool | useIndexedCoupons (1.44; QuantLib 1.43 requires |
| -> Maybe (StubIndexSelection ibor3) | baseStub (1.44; QuantLib 1.43 requires |
| -> Maybe (StubIndexSelection ibor4) | quoteStub (1.44; QuantLib 1.43 requires |
| -> IO RateHelper |
Bootstrapping helper for a marked-to-market cross-currency basis swap: like
constNotionalCrossCurrencyBasisSwapRateHelper, but the notional on the MtM leg resets at
each payment to reflect the FX rate.
constNotionalCrossCurrencySwapRateHelper Source #
Arguments
| :: GenQuote q | fixedRate |
| -> (Int, TimeUnit) | tenor |
| -> Word | fixingDays |
| -> Calendar | calendar |
| -> BusinessDayConvention | convention |
| -> Bool | endOfMonth |
| -> Frequency | fixedFrequency |
| -> DayCounter | fixedDayCount |
| -> GenIborIndex ibor | floatIndex |
| -> GenYieldTermStructure y | collateralCurve |
| -> Bool | collateralOnFixedLeg |
| -> Int | paymentLag |
| -> Maybe Bool | useIndexedCoupons (1.44; QuantLib 1.43 requires |
| -> Maybe Frequency | floatPaymentFrequency (1.44; QuantLib 1.43 requires |
| -> Maybe (StubIndexSelection ibor2) | floatStub (1.44; QuantLib 1.43 requires |
| -> IO RateHelper |
Bootstrapping helper for a fixed-vs-floating cross-currency par swap: quoted at par, so the
FX spot cancels out and isn't required. collateralOnFixedLeg selects which leg is discounted
with collateralCurve -- the other leg's discount curve is the one being bootstrapped.
Arguments
| :: GenQuote q1 | fwdPoint |
| -> GenQuote q2 | spotFx |
| -> FxSwapTerms | |
| -> Bool | isFxBaseCurrencyCollateralCurrency |
| -> GenYieldTermStructure y | collateralCurve |
| -> IO RateHelper |
Bootstrapping helper from FX swap points. collateralCurve discounts the collateral
currency; the curve being bootstrapped is for the other currency. fwdPoint and spotFx must
be quoted in the same units (points already scaled to match the spot).
Mutators
linkTo :: RelinkableYieldTermStructure -> GenYieldTermStructure y -> IO () Source #
Point a relinkable handle at a different curve. Everything already built on the handle reprices against the new curve, with no object rebuilt.
This is the one mutator in the module. The API rules here otherwise forbid new setters and prefer constructing a fresh object, but relinking is the capability being bound: a forecast curve is cloned into every floating coupon of every instrument, so without it a curve scenario means rebuilding the whole portfolio.
Arguments
| :: MultiCurve | |
| -> RelinkableYieldTermStructure | internalHandle |
| -> PiecewiseYieldCurve | curve |
| -> IO YieldTermStructure |
Add a curve built by piecewiseYieldCurve to the cycle; QuantLib accepts only its global
bootstrappers here. See multiCurve for the protocol.
addNonBootstrappedCurve Source #
Arguments
| :: MultiCurve | |
| -> RelinkableYieldTermStructure | internalHandle |
| -> GenYieldTermStructure y | curve |
| -> IO YieldTermStructure |
Add a curve that isn't built with a bootstrapper (e.g. a spreaded curve) to the cycle. See
multiCurve for the protocol.
Inspectors
class HasHelperUnderlying h where Source #
Bootstrap and calibration helpers that build and hold the instrument whose market quote they match. The class lives here, in the term-structure root module, because its instances span QuantLib.TermStructure.Yield, ".Inflation" and QuantLib.Model, and an instance must share a module with its class to stay non-orphan.
Associated Types
type HelperUnderlying h Source #
Methods
helperInstrument :: h -> IO (HelperUnderlying h) Source #
The instrument the helper prices. For helpers that build it internally --
fixedRateBondHelper and
cpiBondHelper among them -- this is the only way to reach it.
Instances
| HasHelperUnderlying BondHelper Source # | |||||
Defined in QuantLib.TermStructure Associated Types
Methods helperInstrument :: BondHelper -> IO (HelperUnderlying BondHelper) Source # | |||||
| HasHelperUnderlying OISRateHelper Source # | |||||
Defined in QuantLib.TermStructure Associated Types
Methods helperInstrument :: OISRateHelper -> IO (HelperUnderlying OISRateHelper) Source # | |||||
| HasHelperUnderlying SwapRateHelper Source # | |||||
Defined in QuantLib.TermStructure Associated Types
Methods helperInstrument :: SwapRateHelper -> IO (HelperUnderlying SwapRateHelper) Source # | |||||
| HasHelperUnderlying SwaptionHelper Source # | |||||
Defined in QuantLib.TermStructure Associated Types
Methods helperInstrument :: SwaptionHelper -> IO (HelperUnderlying SwaptionHelper) Source # | |||||
| HasHelperUnderlying YearOnYearInflationSwapHelper Source # | |||||
Defined in QuantLib.TermStructure Associated Types
| |||||
| HasHelperUnderlying ZeroCouponInflationSwapHelper Source # | |||||
Defined in QuantLib.TermStructure Associated Types
| |||||
class HasNodes c where Source #
Bootstrapped curve leaves that retain their native nodes. The class lives in this root module
for the same reason as HasHelperUnderlying: its instances span the topical curve modules.
Methods
bootstrappedNodes :: c -> IO [(Day, Double)] Source #
The curve's (date, value) nodes; reading them runs the bootstrap. The first node is the
reference date (inflation curves: the base date), the rest are helper pillars. Each value is
what the curve interpolates: the trait's quantity for yield and default curves, a
discount-factor spread for piecewiseSpreadYieldCurve, and
the rate before seasonality for inflation curves. Jump factors are applied separately and
are not part of the nodes.
An interpolated curve of the same kind on these nodes, with the original day counter, interpolation, jumps and seasonality, reproduces the bootstrapped curve. The exception is a local bootstrap, whose convex-monotone shape also depends on state the nodes do not carry.
Instances
| HasNodes PiecewiseDefaultCurve Source # | |
Defined in QuantLib.TermStructure Methods bootstrappedNodes :: PiecewiseDefaultCurve -> IO [(Day, Double)] Source # | |
| HasNodes PiecewiseYieldCurve Source # | |
Defined in QuantLib.TermStructure Methods bootstrappedNodes :: PiecewiseYieldCurve -> IO [(Day, Double)] Source # | |
| HasNodes PiecewiseYoYInflationCurve Source # | |
Defined in QuantLib.TermStructure Methods bootstrappedNodes :: PiecewiseYoYInflationCurve -> IO [(Day, Double)] Source # | |
| HasNodes PiecewiseZeroInflationCurve Source # | |
Defined in QuantLib.TermStructure Methods bootstrappedNodes :: PiecewiseZeroInflationCurve -> IO [(Day, Double)] Source # | |
rateHelperFixingDependencies :: GenRateHelper rh -> IO (Maybe [(String, Day)]) Source #
Every fixing this rate helper reads from the store, as (index name, fixing date) pairs. A
bootstrapped curve cannot be asked what it was built from -- PiecewiseYieldCurve is a
template with no instruments accessor, and an Observer does not expose the observables it
registered with -- so a curve's fixing dependencies are the union of its helpers', and this
answers for one helper. It walks the helper's underlying instrument the way
fixingDependencies walks a leg, and names each index by
name, the key QuantLib's process-global fixing store uses.
A swap, OIS, basis-swap, BMA, multiple-resets, cross-currency or bond helper answers from its
underlying; an IBOR futures or FX swap helper, and a deposit or FRA relative to the evaluation
date, reads no stored fixing: Just []. A DepositOnFixingDate deposit, or a FraBetweenDates
FRA with an indexed coupon, reads its fixing once the fixing date is before the evaluation date,
and reports it from then on; on the fixing date itself it still forecasts.
An overnight-index or SOFR futures helper reports each business-day fixing from its period start
up to the evaluation date, that date's included because the future reads it when stored. On
QuantLib 1.43, which keeps the future private, it instead reports Nothing from two weeks before
its period starts. Any helper type the walk has no case for reports Nothing too: "cannot see
it", which is not the same as "needs nothing".
The dates follow the evaluation date, because a relative-date helper re-initialises its schedule when that date moves: call this under the date whose fixings are being asked about. Duplicates are not removed, the same as for a leg.
forwardRate :: GenYieldTermStructure y -> RateInterval -> Compounding -> Frequency -> Bool -> IO InterestRate Source #
The forward rate over a date or year-fraction interval. Dates are not adjusted for holidays; a time interval's rate carries the curve's own day-counting rule.
zeroRate :: GenYieldTermStructure y -> RatePoint -> Compounding -> Frequency -> Bool -> IO InterestRate Source #
The zero rate at a date or year-fraction coordinate.
discount :: GenYieldTermStructure y -> TermPoint -> Bool -> IO Double Source #
Returns a discount factor at a date or year-fraction coordinate.
Arguments
| :: GenRateHelper rh | helper |
| -> IO Day |
The date of this helper's bootstrap pillar, computed from its instrument's conventions. This can differ from contractual maturity. Relative-date helpers update it when the evaluation date changes; no curve needs to be attached to inspect the date.
impliedQuote :: GenRateHelper rh -> IO Double Source #
The quote value implied by the current bootstrapped state of the curve the helper was last used against, i.e. what the helper's own market quote would need to be to make it reprice exactly.
impliedQuoteOn :: GenRateHelper rh -> GenYieldTermStructure y -> IO Double Source #
The quote that would make the helper reprice exactly on the given curve: a par rate read with the helper's own schedule and conventions on any curve, bootstrapped from it or not. The helper keeps a non-owning reference to the curve until it is next used, so a bootstrap may still take it afterwards.
class HasConvexityAdjustment h where Source #
Futures rate helpers built with an optional futures-vs-forward convexity adjustment.
Methods
convexityAdjustment :: h -> IO Double Source #
The convexity adjustment this helper was built with (0 if none was given).
Instances
| HasConvexityAdjustment FuturesRateHelper Source # | |
Defined in QuantLib.TermStructure.Yield Methods convexityAdjustment :: FuturesRateHelper -> IO Double Source # | |
| HasConvexityAdjustment OvernightIndexFutureRateHelper Source # | |
Defined in QuantLib.TermStructure.Yield Methods convexityAdjustment :: OvernightIndexFutureRateHelper -> IO Double Source # | |
minimumCostValue :: FittedBondDiscountCurve -> IO Double Source #
final value of cost function after optimization
numberOfIterations :: FittedBondDiscountCurve -> IO Int Source #
final number of iterations used in the optimization problem
fittingMethodSize :: FittedBondDiscountCurve -> IO Word Source #
number of unknown parameters found by the fit
fittingMethodErrorCode :: FittedBondDiscountCurve -> IO EndCriteriaType Source #
why the optimization stopped
fittingMethodSolution :: FittedBondDiscountCurve -> IO RealVector Source #
the fitted parameters found by the optimization
fittingMethodDiscount :: FittedBondDiscountCurve -> [Double] -> Double -> IO Double Source #
the discount factor at time t implied by a given parameter vector, without rebuilding the curve