Options
All
  • Public
  • Public/Protected
  • All
Menu

One factor Markov Functional model class.

Some documentation is available here http://ssrn.com/abstract_id=2183721 http://quantlib.org/slides/qlws13/caspers.pdf

The model requires a suitable input smile which means it should be arbitrage free, smooth (at least implying a C^1 call price function) and with a call price function not decreasing too slow in strike direction.

A method for arbitrage free extra- and interpolation due to Kahale is provided and may be used to improve an input smile. Alternatively a SABR smile with arbitrage free wings can be fitted to the input smile to provide an appropriate input smile.

If you use the Kahale or SABR method for smile pretreatment then this implies zero density for negative underlying rates. This means that in this case the market yield term structure must imply positive underlying atm forward rates. In principle the mf model is able to produce negative rates. To make this work the smileSection provided as input must have an digitalOptionPrice (or an optionPrice) implementation that is consistent with such a yield term structure and the model setting lowerRateBound must be set appropriately as a lower limit for the underlying rates.

If you do not use a smile pretreatment you should ensure that the input smileSection is arbitrage free and that the input smileSection covers the strikes from lowerRateBound to upperRateBound.

During calibration a monocurve setup is assumed with the given yield term structure determining the rates throughout, no matter what curves are linked to the indices in the volatility term structures. The yield term structure should therefore be the main risk curve, i.e. the forwarding curve for the respective swaption or cap underlyings.

The model uses a simplified formula for the npv of a swaps floating leg namely $P(t,T_0)-P(t,T_1)$ with $T_0$ being the start date of the leg and $T_1$ being the last payment date, which is an approximation to the true npv.

The model calibrates to slightly modified market options in the sense that the start date is set equal to the fixing date, i.e. there is no delay. The model diagnostic outputs refer to this modified instrument. In general the actual market instrument including the delay is still matched very well though the calibration is done on a slightly different instrument.

AdjustYts and AdjustDigitals are experimental options. Specifying AdjustYts may have a negative impact on the volatility smile match, so it should be used with special care. For long term calibration it seems an interesting option though.

A bad fit to the initial yield term structure may be due to a non suitable input smile or accumulating numerical errors in very long term calibrations. The former point is adressed by smile pretreatment options. The latter point may be tackled by higher values for the numerical parameters possibly together with NTL high precision computing.

When using a shifted lognormal smile input the lower rate bound is adjusted by the shift so that a lower bound of 0.0 always corresponds to the lower bound of the shifted distribution.

Hierarchy

Implements

Index

Classes

Properties

Methods

Properties

_alwaysForward

_alwaysForward: boolean = false

Private _arbitrageIndices

_arbitrageIndices: Array<[Size, Size]>

_arguments

_arguments: Parameter[]

_calculated

_calculated: boolean = false

Private _calibrationPoints

_calibrationPoints: Map<Size, CalibrationPoint>

Private _capletCalibrated

_capletCalibrated: boolean

Private _capletExpiries

_capletExpiries: Date[]

Private _capletVol

_constraint

_constraint: Constraint

Private _discreteNumeraire

_discreteNumeraire: Matrix

_enforcesTodaysHistoricFixings

_enforcesTodaysHistoricFixings: boolean

_evaluationDate

_evaluationDate: Date

Private _forcedArbitrageIndices

_forcedArbitrageIndices: Array<[Size, Size]>

_frozen

_frozen: boolean = false

_functionEvaluation

_functionEvaluation: Integer

Private _iborIndex

_iborIndex: IborIndex

_isDisposed

_isDisposed: boolean = false

Private _modelOutputs

_modelOutputs: ModelOutputs

Private _modelSettings

_modelSettings: ModelSettings

Private _normalIntegralW

_normalIntegralW: Real[]

Private _normalIntegralX

_normalIntegralX: Real[]

Private _numeraire

_numeraire: Interpolation[]

Private _numeraireDate

_numeraireDate: Date

Private _numeraireTime

_numeraireTime: Time

_observables

_observables: Set<Observable> = new Set()

_observers

_observers: Set<Observer> = new Set()

_problemValues

_problemValues: Real[]

Private _reversion

_reversion: Parameter

_shortRateEndCriteria

_shortRateEndCriteria: Type

Private _sigma

_sigma: Parameter

_stateProcess

_stateProcess: StochasticProcess1D

_swapCache

Private _swapIndexBase

_swapIndexBase: SwapIndex

Private _swaptionExpiries

_swaptionExpiries: Date[]

Private _swaptionTenors

_swaptionTenors: Period[]

Private _swaptionVol

_termStructure

_termStructure: Handle<YieldTermStructure>

Private _times

_times: Real[]

Private _volatilities

_volatilities: Real[]

Private _volstepdates

_volstepdates: Date[]

Private _volsteptimes

_volsteptimes: Time[]

Private _volsteptimesArray

_volsteptimesArray: Real[]

Private _y

_y: Real[]

alwaysForwardNotifications

alwaysForwardNotifications: () => void

Type declaration

    • (): void
    • Returns void

calculate

calculate: () => void

Type declaration

    • (): void
    • Returns void

calibrate1

calibrate1: (instruments: CalibrationHelperBase[], method: OptimizationMethod, endCriteria: EndCriteria, additionalConstraint?: Constraint, weights?: Real[], fixParameters?: boolean[]) => void

Type declaration

calibrate2

calibrate2: (instruments: BlackCalibrationHelper[], method: OptimizationMethod, endCriteria: EndCriteria, additionalConstraint?: Constraint, weights?: Real[], fixParameters?: boolean[]) => void

Type declaration

cmInit

cmInit: (nArguments: Size) => CalibratedModel

Type declaration

constraint

constraint: () => Constraint

Type declaration

deepUpdate

deepUpdate: () => void

Type declaration

    • (): void
    • Returns void

dispose

dispose: () => void

Type declaration

    • (): void
    • Returns void

endCriteria

endCriteria: () => Type

Type declaration

forwardRate

forwardRate: (fixing: Date, referenceDate?: Date, y?: Real, iborIdx?: IborIndex) => Real

Type declaration

    • Parameters

      • fixing: Date
      • Optional referenceDate: Date
      • Optional y: Real
      • Optional iborIdx: IborIndex

      Returns Real

freeze

freeze: () => void

Type declaration

    • (): void
    • Returns void

functionEvaluation

functionEvaluation: () => Integer

Type declaration

g1dmInit

g1dmInit: (yieldTermStructure: Handle<YieldTermStructure>) => Gaussian1dModel

Type declaration

isDisposed

isDisposed: boolean

notifyObservers

notifyObservers: () => void

Type declaration

    • (): void
    • Returns void

numeraire1

numeraire1: (t: Time, y?: Real, yts?: Handle<YieldTermStructure>) => Real

Type declaration

numeraire2

numeraire2: (referenceDate: Date, y?: Real, yts?: Handle<YieldTermStructure>) => Real

Type declaration

params

params: () => Real[]

Type declaration

problemValues

problemValues: () => Real[]

Type declaration

recalculate

recalculate: () => void

Type declaration

    • (): void
    • Returns void

registerObserver

registerObserver: (o: Observer) => void

Type declaration

registerWith

registerWith: (h: Observable) => void

Type declaration

registerWithObservables

registerWithObservables: (o: Observer) => void

Type declaration

setParams

setParams: (params: Real[]) => void

Type declaration

    • (params: Real[]): void
    • Parameters

      Returns void

stateProcess

stateProcess: () => StochasticProcess1D

Type declaration

swapAnnuity

swapAnnuity: (fixing: Date, tenor: Period, referenceDate?: Date, y?: Real, swapIdx?: SwapIndex) => Real

Type declaration

swapRate

swapRate: (fixing: Date, tenor: Period, referenceDate?: Date, y?: Real, swapIdx?: SwapIndex) => Real

Type declaration

tcmInit

Type declaration

termStructure

termStructure: () => Handle<YieldTermStructure>

Type declaration

underlyingSwap

underlyingSwap: (index: SwapIndex, expiry: Date, tenor: Period) => VanillaSwap

Type declaration

unfreeze

unfreeze: () => void

Type declaration

    • (): void
    • Returns void

unregisterObserver

unregisterObserver: (o: Observer) => void

Type declaration

unregisterWith

unregisterWith: (h: Observable) => Size

Type declaration

unregisterWithAll

unregisterWithAll: () => void

Type declaration

    • (): void
    • Returns void

value1

value1: (params: Real[], instruments: CalibrationHelperBase[]) => Real

Type declaration

value2

value2: (params: Real[], instruments: BlackCalibrationHelper[]) => Real

Type declaration

yGrid

yGrid: (stdDevs: Real, gridPoints: Size, T?: Real, t?: Real, y?: Real) => Real[]

Type declaration

zerobond1

zerobond1: (T: Time, t?: Time, y?: Real, yts?: Handle<YieldTermStructure>) => Real

Type declaration

zerobond2

zerobond2: (maturity: Date, referenceDate?: Date, y?: Real, yts?: Handle<YieldTermStructure>) => Real

Type declaration

zerobondOption

zerobondOption: (type: Type, expiry: Date, valueDate: Date, maturity: Date, strike: Rate, referenceDate?: Date, y?: Real, yts?: Handle<YieldTermStructure>, yStdDevs?: Real, yGridPoints?: Size, extrapolatePayoff?: boolean, flatPayoffExtrapolation?: boolean) => Real

Type declaration

    • (type: Type, expiry: Date, valueDate: Date, maturity: Date, strike: Rate, referenceDate?: Date, y?: Real, yts?: Handle<YieldTermStructure>, yStdDevs?: Real, yGridPoints?: Size, extrapolatePayoff?: boolean, flatPayoffExtrapolation?: boolean): Real
    • Parameters

      • type: Type
      • expiry: Date
      • valueDate: Date
      • maturity: Date
      • strike: Rate
      • Optional referenceDate: Date
      • Optional y: Real
      • Optional yts: Handle<YieldTermStructure>
      • Optional yStdDevs: Real
      • Optional yGridPoints: Size
      • Optional extrapolatePayoff: boolean
      • Optional flatPayoffExtrapolation: boolean

      Returns Real

Methods

FixedFirstVolatility

  • FixedFirstVolatility(): boolean[]
  • Returns boolean[]

arbitrageIndices

  • arbitrageIndices(): Array<[Size, Size]>
  • Returns Array<[Size, Size]>

calibrate

  • Parameters

    Returns void

capletPriceInternal

  • capletPriceInternal(type: Type, expiry: Date, strike: Rate, referenceDate?: Date, y?: Real, zeroFixingDays?: boolean, iborIdx?: IborIndex): Real
  • Parameters

    • type: Type
    • expiry: Date
    • strike: Rate
    • Default value referenceDate: Date = null
    • Default value y: Real = 0
    • Default value zeroFixingDays: boolean = false
    • Default value iborIdx: IborIndex = null

    Returns Real

deflatedZerobond

  • Parameters

    • T: Time
    • Default value t: Time = 0
    • Default value y: Real = 0

    Returns Real

deflatedZerobondArray

  • Parameters

    Returns Real[]

forceArbitrageIndices

  • forceArbitrageIndices(indices: Array<[Size, Size]>): void
  • Parameters

    Returns void

forwardRateInternal

  • forwardRateInternal(fixing: Date, referenceDate?: Date, y?: Real, zeroFixingDays?: boolean, iborIdx?: IborIndex): Real
  • Parameters

    • fixing: Date
    • Default value referenceDate: Date = null
    • Default value y: Real = 0
    • Default value zeroFixingDays: boolean = false
    • Default value iborIdx: IborIndex = null

    Returns Real

generateArguments

  • generateArguments(): void

initialize

  • initialize(): void
  • Returns void

makeCapletCalibrationPoint

  • makeCapletCalibrationPoint(expiry: Date): void
  • Parameters

    • expiry: Date

    Returns void

makeSwaptionCalibrationPoint

  • makeSwaptionCalibrationPoint(expiry: Date, tenor: Period): void
  • Parameters

    Returns void

marketDigitalPrice

  • Parameters

    Returns Real

marketSwapRate

  • Parameters

    Returns Real

mfInit1

mfInit2

modelOutputs

  • Returns ModelOutputs

modelSettings

  • Returns ModelSettings

numeraireArray

  • Parameters

    Returns Real[]

numeraireDate

  • numeraireDate(): Date
  • Returns Date

numeraireImpl

numeraireTime

  • numeraireTime(): Time
  • Returns Time

performCalculations

  • performCalculations(): void

swapAnnuityInternal

  • swapAnnuityInternal(fixing: Date, tenor: Period, referenceDate?: Date, y?: Real, zeroFixingDays?: boolean, swapIdx?: SwapIndex): Real
  • Parameters

    • fixing: Date
    • tenor: Period
    • Default value referenceDate: Date = null
    • Default value y: Real = 0
    • Default value zeroFixingDays: boolean = false
    • Default value swapIdx: SwapIndex = null

    Returns Real

swapRateInternal

  • swapRateInternal(fixing: Date, tenor: Period, referenceDate?: Date, y?: Real, zeroFixingDays?: boolean, swapIdx?: SwapIndex): Real
  • Parameters

    • fixing: Date
    • tenor: Period
    • Default value referenceDate: Date = null
    • Default value y: Real = 0
    • Default value zeroFixingDays: boolean = false
    • Default value swapIdx: SwapIndex = null

    Returns Real

swaptionPriceInternal

  • swaptionPriceInternal(type: Type, expiry: Date, tenor: Period, strike: Rate, referenceDate?: Date, y?: Real, zeroFixingDays?: boolean, swapIdx?: SwapIndex): Real
  • Parameters

    • type: Type
    • expiry: Date
    • tenor: Period
    • strike: Rate
    • Default value referenceDate: Date = null
    • Default value y: Real = 0
    • Default value zeroFixingDays: boolean = false
    • Default value swapIdx: SwapIndex = null

    Returns Real

update

  • update(): void

updateNumeraireTabulation

  • updateNumeraireTabulation(): void
  • Returns void

updateSmiles

  • updateSmiles(): void
  • Returns void

updateTimes

  • updateTimes(): void
  • Returns void

updateTimes1

  • updateTimes1(): void
  • Returns void

updateTimes2

  • updateTimes2(): void
  • Returns void

volatility

  • volatility(): Real[]
  • Returns Real[]

zerobondArray

  • Parameters

    Returns Real[]

zerobondImpl