hasquant
Safe HaskellNone
LanguageHaskell2010

QuantLib.TermStructure.Yield

Synopsis

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 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 GenRateHelper rh Source #

RateHelper
  BondHelper
  SwapRateHelper
  OISRateHelper
  FuturesRateHelper
  OvernightIndexFutureRateHelper

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

data Reference Source #

A term-structure reference point. ReferenceDate stays fixed for the object's lifetime; SettlementDays follows the global evaluation date using the supplied calendar.

Instances

Instances details
Show Reference Source # 
Instance details

Defined in QuantLib.TermStructure

Eq Reference Source # 
Instance details

Defined in QuantLib.TermStructure

data TermPoint Source #

A date or year-fraction coordinate measured from a term structure's reference date.

Constructors

DatePoint !Day 
TimePoint !Double 

Instances

Instances details
Show TermPoint Source # 
Instance details

Defined in QuantLib.TermStructure

Eq TermPoint Source # 
Instance details

Defined in QuantLib.TermStructure

data RatePoint Source #

A date or year-fraction coordinate where a date needs its day-counting rule.

Instances

Instances details
Show RatePoint Source # 
Instance details

Defined in QuantLib.TermStructure

Eq RatePoint Source # 
Instance details

Defined in QuantLib.TermStructure

Bootstrap and contract configuration

data FittingMethod Source #

Constructors

CubicBSplines 

Fields

ExponentialSplines 

Fields

NelsonSiegel 

Fields

SimplePolynomial 

Fields

Svensson 

Fields

data FraTerms ibor Source #

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 others state them explicitly.

Constructors

FraMonths 

Fields

FraMonthsFromIndex 

Fields

FraPeriod 

Fields

FraPeriodFromIndex 

Fields

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 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.

data Bootstrap rh2 Source #

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]

accuracy, instrumentWeights

GlobalSimpleZeroLinear !Double ![Double]

accuracy, instrumentWeights

GlobalSimpleZeroLinearFull !(NonEmpty (GenRateHelper rh2)) ![Day] !Double

additionalHelpers, additionalDates, accuracy

GlobalForwardRateLinear !Double ![Double]

accuracy, instrumentWeights

GlobalZeroYieldLinear !Double ![Double]

accuracy, instrumentWeights

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.

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]

accuracy, instrumentWeights (empty for equal weights)

Constructors

Hierarchy and handles

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 resulting curve is valid only inside the continuation, which must span its whole use. QuantLib stores f and calls it whenever the curve is queried, including from any object that stores the curve. Leaving the continuation frees its function pointer; a later query crashes the process. f must be total: an exception escaping it crosses C++ unsafely.

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 #

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 #

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.

quantoTermStructure Source #

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

depositRateHelperFromIndex :: GenQuote q -> GenIborIndex ibor -> IO RateHelper Source #

Rate helper for bootstrapping over deposit rates, taking its conventions from an ibor index.

depositRateHelper Source #

Arguments

:: GenQuote q

rate

-> (Int, TimeUnit)

tenor

-> Word

fixingDays

-> Calendar

calendar

-> BusinessDayConvention

convention

-> Bool

endOfMonth

-> DayCounter 
-> IO RateHelper 

Rate helper for bootstrapping over deposit rates.

fixedRateBondHelper Source #

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).

swapRateHelperFromConventions Source #

Arguments

:: GenQuote q1

rate

-> (Int, TimeUnit)

tenor

-> Calendar

calendar

-> Frequency

fixedFrequency

-> BusinessDayConvention

fixedConvention

-> DayCounter

fixedDayCount

-> GenIborIndex ibor

iborIndex

-> Maybe (GenQuote q2)

spread

-> (Int, TimeUnit)

fwdStart

-> Maybe (GenYieldTermStructure y)

discountingCurve

-> Maybe Word

settlementDays

-> PillarChoice

pillar

-> Maybe Day

customPillarDate

-> Bool

endOfMonth

-> Maybe Bool

useIndexedCoupons

-> Maybe BusinessDayConvention

floatConvention

-> Maybe FloatingRateCouponPricer

couponPricer

-> IO SwapRateHelper 

Rate helper for bootstrapping over swap rates, built from explicit tenor/calendar/ frequency/day-count/index conventions rather than a GenSwapIndex bundling them (as swapRateHelper does).

fraRateHelper Source #

Arguments

:: GenQuote q 
-> FraTerms ibor 
-> PillarChoice

pillar

-> Maybe Day

customPillarDate

-> Bool

useIndexedCoupon

-> IO RateHelper 

Rate helper for bootstrapping over FRA rates.

bondHelper :: GenQuote q -> Bond -> 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.

defaultOvernightObservation :: OvernightObservation Source #

Upstream's own defaults: index fixing days, no lockout, no observation shift.

swapRateHelper Source #

Arguments

:: GenQuote q1

rate

-> GenSwapIndex sidx 
-> Maybe (GenQuote q2)

spread

-> (Int, TimeUnit)

fwdStart

-> Maybe (GenYieldTermStructure y)

discountingCurve

-> PillarChoice

pillar

-> Maybe Day

customPillarDate

-> Bool

endOfMonth

-> Maybe Bool

useIndexedCoupons

-> Maybe FloatingRateCouponPricer

couponPricer

-> IO SwapRateHelper 

Rate helper for bootstrapping over swap rates, built from a GenSwapIndex bundling the swap's conventions.

bmaSwapRateHelper Source #

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).

futuresRateHelper Source #

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.

sofrFutureRateHelper Source #

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

piecewiseYieldCurve Source #

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 YieldTermStructure 

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 YieldTermStructure 

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.

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

multiCurve Source #

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.

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

-> 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.

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

-> 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. If Nothing, the overnight index's own curve is used as the discount 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

-> 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

-> 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

-> 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.

fxSwapRateHelper Source #

Arguments

:: GenQuote q1

fwdPoint

-> GenQuote q2

spotFx

-> (Int, TimeUnit)

tenor

-> Word

fixingDays

-> Calendar

calendar

-> BusinessDayConvention

convention

-> Bool

endOfMonth

-> Bool

isFxBaseCurrencyCollateralCurrency

-> GenYieldTermStructure y

collateralCurve

-> Calendar

tradingCalendar

-> IO RateHelper 

Bootstrapping helper from FX swap points, tenor-relative. 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).

fxSwapRateHelperBetweenDates Source #

Arguments

:: GenQuote q1

fwdPoint

-> GenQuote q2

spotFx

-> Day

startDate

-> Day

endDate

-> Bool

isFxBaseCurrencyCollateralCurrency

-> GenYieldTermStructure y

collateralCurve

-> IO RateHelper 

Bootstrapping helper from FX swap points, explicit start/end date.

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.

addBootstrappedCurve Source #

Add a curve built with a bootstrapper (e.g. piecewiseYieldCurve) to the cycle. See multiCurve for the protocol.

addNonBootstrappedCurve Source #

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

Instances details
HasHelperUnderlying BondHelper Source # 
Instance details

Defined in QuantLib.TermStructure

Associated Types

type HelperUnderlying BondHelper 
Instance details

Defined in QuantLib.TermStructure

HasHelperUnderlying OISRateHelper Source # 
Instance details

Defined in QuantLib.TermStructure

HasHelperUnderlying SwapRateHelper Source # 
Instance details

Defined in QuantLib.TermStructure

Associated Types

type HelperUnderlying SwapRateHelper 
Instance details

Defined in QuantLib.TermStructure

HasHelperUnderlying SwaptionHelper Source # 
Instance details

Defined in QuantLib.TermStructure

HasHelperUnderlying YearOnYearInflationSwapHelper Source # 
Instance details

Defined in QuantLib.TermStructure

HasHelperUnderlying ZeroCouponInflationSwapHelper Source # 
Instance details

Defined in QuantLib.TermStructure

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 or bond helper answers from its underlying. A deposit, FRA or futures helper reads no stored fixing and correctly reports Just []. A cross-currency helper keeps no legs for QuantLib to hand back, so it reports Nothing: "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 Source #

Arguments

:: GenYieldTermStructure y 
-> Day 
-> Day 
-> DayCounter 
-> Compounding 
-> Frequency 
-> Bool

extrapolate

-> IO InterestRate 

The forward rate between two dates, in the given day-counting rule. Warning Dates are not adjusted for holidays.

forwardRateBetweenTimes Source #

Arguments

:: GenYieldTermStructure y 
-> Double 
-> Double 
-> Compounding 
-> Frequency 
-> Bool

extrapolate

-> IO InterestRate 

The resulting interest rate has the same day-counting rule used by the term structure. The same rule should be used for calculating the passed times t1 and t2.

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.

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.

futuresRateHelperConvexityAdjustment :: FuturesRateHelper -> IO Double Source #

The futures-vs-forward convexity adjustment this helper was built with (0 if none was given).

overnightIndexFutureRateHelperConvexityAdjustment :: OvernightIndexFutureRateHelper -> IO Double Source #

The futures-vs-forward convexity adjustment this helper was built with (0 if none was given).

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

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