Table of Contents

Excel functions: models and calibration

nqlBlackCalibrationHelperCalibrationError

The error resulting from the model's valuation, by the helper's error type: the relative or absolute price error, or the difference between the volatility the model value implies and the quoted one.

Argument Description
self a BlackCalibrationHelper handle
model The model the instrument is priced against (a ICalibratedModel handle)
context The evaluation context (a EvaluationContext handle)

Returns double. C#: CalibrationError

nqlBlackCalibrationHelperImpliedVolatility

The Black volatility a value implies: the volatility whose BlackCalibrationHelper.BlackPrice is the target, solved by Brent from the quoted volatility as its guess.

Argument Description
self a BlackCalibrationHelper handle
targetValue The value (a number)
accuracy The solver's accuracy (a number)
maxEvaluations The solver's maximum number of evaluations (a whole number)
minVol The bracket's lower end (a number)
maxVol The bracket's upper end (a number)
context The evaluation context (a EvaluationContext handle)

Returns double. C#: ImpliedVolatility

nqlBlackCalibrationHelperMarketValue

Gets the instrument's market value, its Black price at the quoted volatility, which a derived constructor computes through BlackCalibrationHelper.ComputeMarketValue.

Argument Description
self a BlackCalibrationHelper handle

Returns double. C#: MarketValue

nqlBlackCalibrationHelperVolatility

Gets the quoted volatility.

Argument Description
self a BlackCalibrationHelper handle

Returns double. C#: Volatility

nqlBlackCalibrationHelperVolatilityType

Gets the volatility's type.

Argument Description
self a BlackCalibrationHelper handle

Returns enum. C#: VolatilityType

nqlBlackScholesMertonProcess

Initializes a new instance of the BlackScholesMertonProcess class.

Argument Description
x0 The underlying's value (a number)
dividendTS The dividend curve (a YieldTermStructure handle)
riskFreeTS The risk-free curve (a YieldTermStructure handle)
blackVolTS The Black volatility (a BlackVolTermStructure handle)
d Optional. The discretization, or null for QuantLib's default, Euler's (a StochasticProcess1DDiscretization handle)
forceDiscretization Optional. Whether to use the discretization even where the local volatility is strike-independent (TRUE or FALSE)

Returns handle. C#: BlackScholesMertonProcess

nqlBlackScholesProcessCreate

A Black-Scholes process, its zero dividend curve a flat zero rate on Actual/365 (Fixed) from the context's evaluation date.

Argument Description
x0 The underlying's value (a number)
riskFreeTS The risk-free curve (a YieldTermStructure handle)
blackVolTS The Black volatility (a BlackVolTermStructure handle)
context The evaluation context, which dates the dividend curve (a EvaluationContext handle)
d Optional. The discretization, or null for QuantLib's default, Euler's (a StochasticProcess1DDiscretization handle)
forceDiscretization Optional. Whether to use the discretization even where the local volatility is strike-independent (TRUE or FALSE)

Returns handle. C#: Create

nqlCalibratedModelArguments

Gets the model's arguments, the parameters calibration works on, in order.

Argument Description
self a CalibratedModel handle

Returns array:handle. C#: Arguments

nqlCalibratedModelConstraint

Gets the constraint the model imposes on its parameters: each argument's own, on its slice.

Argument Description
self a CalibratedModel handle

Returns handle. C#: Constraint

nqlCalibratedModelExtensionsCalibrate

CalibratedModelExtensions.Calibrate(ICalibratedModel model, IEnumerable helpers, OptimizationMethod method, EndCriteria endCriteria, EvaluationContext context, Constraint constraint = null, ReadOnlySpan weights = null,…

Argument Description
model a ICalibratedModel handle
helpers a row or column
method a OptimizationMethod handle
endCriteria a EndCriteria handle
context a EvaluationContext handle
constraint Optional. a Constraint handle
weights Optional. a row or column
fixParameters Optional. a row or column

Returns handle. C#: Calibrate

nqlCalibratedModelExtensionsSetParams

CalibratedModelExtensions.SetParams(ICalibratedModel model, Vector parameters) -> ICalibratedModel

Argument Description
model a ICalibratedModel handle
parameters a row or column of numbers

Returns handle. C#: SetParams

nqlCalibratedModelExtensionsValue

The calibration's cost at the given parameters, with unit weights: QuantLib's value , which leaves the model at the parameters, while here nothing changes.

Argument Description
model The model, which doesn't change (a ICalibratedModel handle)
parameters The parameters, as many as the model's ICalibratedModel.Params gives (a row or column of numbers)
helpers The instruments; none gives a cost of 0 (a row or column)
context The evaluation context the helpers price under (a EvaluationContext handle)

Returns double. C#: Value

nqlCalibratedModelParams

The parameters calibration works on: every argument's parameters, in order.

Argument Description
self a CalibratedModel handle

Returns vector. C#: Params

nqlCalibratedModelWithParams

A new model, of the receiver's type, with the given parameters: QuantLib's setParams .

Argument Description
self a CalibratedModel handle
parameters The parameters, as many as CalibratedModel.Params gives (a row or column of numbers)

Returns handle. C#: WithParams

nqlCalibrationHelperCalibrationError

The error resulting from the model's valuation of the instrument.

Argument Description
self a CalibrationHelper handle
model The model the instrument is priced against (a ICalibratedModel handle)
context The evaluation context (a EvaluationContext handle)

Returns double. C#: CalibrationError

nqlCmsMarket

Initializes a new instance of the CmsMarket class, and computes it.

Argument Description
swapLengths The CMS swaps' lengths, increasing (a row or column)
swapIndexes The swap indexes (a row or column)
iborIndex The Ibor legs' index (a IborIndex handle)
bidAskSpreads A row per swap length, with a bid and an ask spread per swap index, in that order (a range, a row per element)
pricers A CMS coupon pricer per swap index (a row or column)
discountingTS The discounting curve (a YieldTermStructure handle)
context The evaluation context the swaps are built and priced under (a EvaluationContext handle)

Returns handle. C#: CmsMarket

nqlCmsMarketBrowse

The market's table: QuantLib's browse .

Argument Description
self a CmsMarket handle

Returns matrix. C#: Browse

nqlCmsMarketCalibration

Initializes a new instance of the CmsMarketCalibration class.

Argument Description
volCube The SABR swaption cube whose βs are calibrated (a XabrSwaptionVolatilityCube handle)
cmsMarket The CMS market (a CmsMarket handle)
weights The errors' weights: a row per swap length and a column per swap index (a range of numbers by rows)
calibrationType What the calibration fits (a CmsMarketCalibrationCalibrationType name)

Returns handle. C#: CmsMarketCalibration

nqlCmsMarketCalibrationBetaTransformDirect

The β of a y: exp(−y²) for |y| below 10, else 0, clamped to [1e-6, 0.999999].

Argument Description
y The y (a number)

Returns double. C#: BetaTransformDirect

nqlCmsMarketCalibrationBetaTransformInverse

The y of a β: √(−ln β).

Argument Description
beta The β (a number)

Returns double. C#: BetaTransformInverse

nqlCmsMarketCalibrationCompute

Calibrates a β per swap index and, unless it is fixed, the mean reversion: QuantLib's compute with a vector guess.

Argument Description
self a CmsMarketCalibration handle
endCriteria The optimizer's end criteria (a EndCriteria handle)
method The optimizer (a OptimizationMethod handle)
guess The βs' guesses, one per swap index, then the reversion's guess, or with the reversion fixed the reversion itself, which may be left out to keep the pricers' (a row or column of numbers)
isMeanReversionFixed Whether the reversion is fixed (TRUE or FALSE)
context The evaluation context the cube and the market are calibrated under (a EvaluationContext handle)

Returns handle. C#: Compute

nqlCmsMarketCalibrationCompute2

Calibrates a β term structure per swap index, a β per swap length, and, unless it is fixed, the mean reversion: QuantLib's compute with a matrix guess.

Argument Description
self a CmsMarketCalibration handle
endCriteria The optimizer's end criteria (a EndCriteria handle)
method The optimizer (a OptimizationMethod handle)
guess The βs' guesses: a row per swap length and a column per swap index (a range of numbers by rows)
isMeanReversionFixed Whether the reversion is fixed (TRUE or FALSE)
context The evaluation context the cube and the market are calibrated under (a EvaluationContext handle)
meanReversionGuess Optional. The reversion's guess, or with the reversion fixed the reversion itself; null, QuantLib's Null() , to keep the pricers' with the reversion fixed (a number)

Returns handle. C#: Compute

nqlCmsMarketCalibrationComputeParametric

Calibrates a parametric β term structure per swap index, β(t) = β∞ + (β₀ − β∞)·exp(−decay·t) at each swap length's option time, and, unless it is fixed, the mean reversion: QuantLib's computeParametric .

Argument Description
self a CmsMarketCalibration handle
endCriteria The optimizer's end criteria (a EndCriteria handle)
method The optimizer (a OptimizationMethod handle)
guess The parameters' guesses: the rows β∞, β₀ and the decay, a column per swap index (a range of numbers by rows)
isMeanReversionFixed Whether the reversion is fixed (TRUE or FALSE)
context The evaluation context the cube and the market are calibrated under (a EvaluationContext handle)
meanReversionGuess Optional. The reversion's guess, or with the reversion fixed the reversion itself; null to keep the pricers' with the reversion fixed (a number)

Returns handle. C#: ComputeParametric

nqlCmsMarketCalibrationReversionTransformDirect

The reversion of a y: √|y|, which QuantLib's √y is for every y at or above 0.

Argument Description
y The y (a number)

Returns double. C#: ReversionTransformDirect

nqlCmsMarketCalibrationReversionTransformInverse

The y of a reversion: its square.

Argument Description
reversion The reversion (a number)

Returns double. C#: ReversionTransformInverse

nqlCmsMarketImpliedCmsSpreads

The model's spreads over the Ibor leg.

Argument Description
self a CmsMarket handle

Returns matrix. C#: ImpliedCmsSpreads

nqlCmsMarketReprice

A market repriced on another volatility and mean reversion: QuantLib's reprice , each pricer given the volatility and, unless it is null, the mean reversion.

Argument Description
self a CmsMarket handle
volStructure The swaption volatility (a SwaptionVolatilityStructure handle)
meanReversion The mean reversion, or null, QuantLib's Null() , to keep each pricer's (a number)
context The evaluation context the new market is computed under (a EvaluationContext handle)

Returns handle. C#: Reprice

nqlCmsMarketSpreadErrors

The model's spreads less the market's mid spreads.

Argument Description
self a CmsMarket handle

Returns matrix. C#: SpreadErrors

nqlCmsMarketSwapLengths

Gets the CMS swaps' lengths.

Argument Description
self a CmsMarket handle

Returns array:period. C#: SwapLengths

nqlCmsMarketSwapTenors

Gets the swap indexes' tenors.

Argument Description
self a CmsMarket handle

Returns array:period. C#: SwapTenors

nqlCmsMarketWeightedFwdNpvError

The weighted root-mean-square of the forward CMS legs' NPV errors.

Argument Description
self a CmsMarket handle
w The weights: a row per swap length and a column per swap index (a range of numbers by rows)

Returns double. C#: WeightedFwdNpvError

nqlCmsMarketWeightedFwdNpvErrors

The forward CMS legs' NPV errors, each times the square root of its weight, for a least-squares fit.

Argument Description
self a CmsMarket handle
w The weights: a row per swap length and a column per swap index (a range of numbers by rows)

Returns vector. C#: WeightedFwdNpvErrors

nqlCmsMarketWeightedSpotNpvError

The weighted root-mean-square of the spot CMS legs' NPV errors.

Argument Description
self a CmsMarket handle
w The weights: a row per swap length and a column per swap index (a range of numbers by rows)

Returns double. C#: WeightedSpotNpvError

nqlCmsMarketWeightedSpotNpvErrors

The spot CMS legs' NPV errors, each times the square root of its weight, for a least-squares fit.

Argument Description
self a CmsMarket handle
w The weights: a row per swap length and a column per swap index (a range of numbers by rows)

Returns vector. C#: WeightedSpotNpvErrors

nqlCmsMarketWeightedSpreadError

The weighted root-mean-square of the spread errors.

Argument Description
self a CmsMarket handle
w The weights: a row per swap length and a column per swap index (a range of numbers by rows)

Returns double. C#: WeightedSpreadError

nqlCmsMarketWeightedSpreadErrors

The spread errors, each times the square root of its weight, for a least-squares fit.

Argument Description
self a CmsMarket handle
w The weights: a row per swap length and a column per swap index (a range of numbers by rows)

Returns vector. C#: WeightedSpreadErrors

nqlConjugateGradient

Initializes a new instance of the ConjugateGradient class.

Returns handle. C#: ConjugateGradient

nqlConstraintLowerBound

The lower bound for the given parameters, element by element.

Argument Description
self a Constraint handle
parameters The parameters (a row or column of numbers)

Returns vector. C#: LowerBound

nqlConstraintUpperBound

The upper bound for the given parameters, element by element.

Argument Description
self a Constraint handle
parameters The parameters (a row or column of numbers)

Returns vector. C#: UpperBound

nqlEndCriteria

Initializes a new instance of the EndCriteria class.

Argument Description
maxIterations The maximum number of iterations (a whole number)
maxStationaryStateIterations The maximum number of iterations in a stationary state, more than 1 and fewer than maxIterations; null (QuantLib's Null() ) for half of maxIterations, at most 100 (a whole number)
rootEpsilon The epsilon on the independent variable's change (a number)
functionEpsilon The epsilon on the function value and its change (a number)
gradientNormEpsilon The epsilon on the gradient's norm; null (QuantLib's Null() ) for functionEpsilon (a number)

Returns handle. C#: EndCriteria

nqlEndCriteriaCheckMaxIterations

Whether the number of iterations has reached the maximum, so MaxIterations holds.

Argument Description
self a EndCriteria handle
iteration The iteration (a whole number)

Returns bool. C#: CheckMaxIterations

nqlEndCriteriaCheckStationaryFunctionAccuracy

Whether, in a positive optimization, the function value is below the function epsilon, so StationaryFunctionAccuracy holds.

Argument Description
self a EndCriteria handle
f The function value (a number)
positiveOptimization Whether the function is known to be positive (TRUE or FALSE)

Returns bool. C#: CheckStationaryFunctionAccuracy

nqlEndCriteriaCheckStationaryFunctionValue

Whether the function value has been stationary for more than the maximum number of stationary iterations: a change below the function epsilon adds a stationary iteration, and any other change resets the count to 0.

Argument Description
self a EndCriteria handle
fxOld The previous function value (a number)
fxNew The new function value (a number)
stationaryStateIterations The count of stationary iterations so far (a whole number)

Returns boxed. C#: CheckStationaryFunctionValue

nqlEndCriteriaCheckStationaryPoint

Whether the root has been stationary for more than the maximum number of stationary iterations: a change below the root epsilon adds a stationary iteration, and any other change resets the count to 0.

Argument Description
self a EndCriteria handle
xOld The previous root (a number)
xNew The new root (a number)
stationaryStateIterations The count of stationary iterations so far (a whole number)

Returns boxed. C#: CheckStationaryPoint

nqlEndCriteriaCheckZeroGradientNorm

Whether the gradient's norm is below the gradient-norm epsilon, so ZeroGradientNorm holds.

Argument Description
self a EndCriteria handle
gradientNorm The gradient's norm (a number)

Returns bool. C#: CheckZeroGradientNorm

nqlEndCriteriaEvaluate

Whether the optimization stops, QuantLib's operator() : the checks in turn, the first met deciding, as EndCriteria.CheckMaxIterations, then EndCriteria.CheckStationaryFunctionValue, then EndCriteria.CheckStationaryFunctionAccuracy on the new value,…

Argument Description
self a EndCriteria handle
iteration The iteration (a whole number)
stationaryStateIterations The count of stationary iterations so far (a whole number)
positiveOptimization Whether the function is known to be positive (TRUE or FALSE)
fOld The previous function value (a number)
normGOld The previous gradient's norm, which no check reads (a number)
fNew The new function value (a number)
normGNew The new gradient's norm (a number)

Returns boxed. C#: Evaluate

nqlEndCriteriaFunctionEpsilon

Gets the epsilon on the function value and its change.

Argument Description
self a EndCriteria handle

Returns double. C#: FunctionEpsilon

nqlEndCriteriaGradientNormEpsilon

Gets the epsilon on the gradient's norm.

Argument Description
self a EndCriteria handle

Returns double. C#: GradientNormEpsilon

nqlEndCriteriaMaxIterations

Gets the maximum number of iterations.

Argument Description
self a EndCriteria handle

Returns int32. C#: MaxIterations

nqlEndCriteriaMaxStationaryStateIterations

Gets the maximum number of iterations in a stationary state.

Argument Description
self a EndCriteria handle

Returns int32. C#: MaxStationaryStateIterations

nqlEndCriteriaRootEpsilon

Gets the epsilon on the independent variable's change.

Argument Description
self a EndCriteria handle

Returns double. C#: RootEpsilon

nqlEndCriteriaSucceeded

Whether an optimization that ended for a given reason succeeded: at a stationary point, value or accuracy.

Argument Description
ecType The reason (a EndCriteriaType name)

Returns bool. C#: Succeeded

nqlG2

Initializes a new instance of the G2 class.

Argument Description
termStructure The curve the model fits (a YieldTermStructure handle)
a Optional. The first factor's mean reversion, positive (a number)
sigma Optional. The first factor's volatility, positive (a number)
b Optional. The second factor's mean reversion, positive (a number)
eta Optional. The second factor's volatility, positive (a number)
rho Optional. The factors' correlation, in [−1, 1] (a number)

Returns handle. C#: G2

nqlG2A

The first factor's mean reversion a.

Argument Description
self a G2 handle

Returns double. C#: A

nqlG2B

The second factor's mean reversion b.

Argument Description
self a G2 handle

Returns double. C#: B

nqlG2Discount

The implied discount curve: the curve's own discount factor.

Argument Description
self a G2 handle
t The time (a number)

Returns double. C#: Discount

nqlG2DiscountBond

The price at a time of a unit discount bond maturing later, given the two factors then.

Argument Description
self a G2 handle
now The time (a number)
maturity The bond's maturity (a number)
factors The factors' values at now, at least two (a row or column of numbers)

Returns double. C#: DiscountBond

nqlG2DiscountBond2

The price at a time of a unit discount bond maturing later: A(t, T)·exp(−B(a, T − t)x − B(b, T − t)y).

Argument Description
self a G2 handle
t The time (a number)
T The bond's maturity (a number)
x The first factor at t (a number)
y The second factor at t (a number)

Returns double. C#: DiscountBond

nqlG2DiscountBondOption

The price of an option on a discount bond, by Black's formula on the curve's discount factors.

Argument Description
self a G2 handle
type The option's type (a OptionType name)
strike The strike (a number)
maturity The option's maturity (a number)
bondMaturity The bond's maturity (a number)

Returns double. C#: DiscountBondOption

nqlG2DiscountBondOption2

The price of an option on a discount bond that starts later than the option's maturity: as QuantLib's AffineModel default, the option on the bond from the option's maturity, bondStart ignored.

Argument Description
self a G2 handle
type The option's type (a OptionType name)
strike The strike (a number)
maturity The option's maturity (a number)
bondStart The bond's start, unused (a number)
bondMaturity The bond's maturity (a number)

Returns double. C#: DiscountBondOption

nqlG2Dynamics

The model's short-rate dynamics: r = φ(t) + x + y, x and y Ornstein-Uhlenbeck processes.

Argument Description
self a G2 handle

Returns handle. C#: Dynamics

nqlG2Eta

Gets the second factor's volatility η.

Argument Description
self a G2 handle

Returns double. C#: Eta

nqlG2Rho

Gets the factors' correlation ρ.

Argument Description
self a G2 handle

Returns double. C#: Rho

nqlG2Sigma

Gets the first factor's volatility σ.

Argument Description
self a G2 handle

Returns double. C#: Sigma

nqlG2TermStructure

Gets the curve the model fits.

Argument Description
self a G2 handle

Returns handle. C#: TermStructure

nqlGeneralizedBlackScholesProcess

Initializes a new instance of the GeneralizedBlackScholesProcess class, its local volatility derived from its Black volatility.

Argument Description
x0 The underlying's value (a number)
dividendTS The dividend curve (a YieldTermStructure handle)
riskFreeTS The risk-free curve (a YieldTermStructure handle)
blackVolTS The Black volatility (a BlackVolTermStructure handle)
d Optional. The discretization, or null for QuantLib's default, Euler's (a StochasticProcess1DDiscretization handle)
forceDiscretization Optional. Whether to use the discretization even where the local volatility is strike-independent (TRUE or FALSE)

Returns handle. C#: GeneralizedBlackScholesProcess

nqlGeneralizedBlackScholesProcess2

Initializes a new instance of the GeneralizedBlackScholesProcess class with a given local volatility, and Euler's discretization.

Argument Description
x0 The underlying's value (a number)
dividendTS The dividend curve (a YieldTermStructure handle)
riskFreeTS The risk-free curve (a YieldTermStructure handle)
blackVolTS The Black volatility (a BlackVolTermStructure handle)
localVolTS The local volatility (a LocalVolTermStructure handle)

Returns handle. C#: GeneralizedBlackScholesProcess

nqlGeneralizedBlackScholesProcessApply

Applies a change of ln S: x0 eᵈˣ.

Argument Description
self a GeneralizedBlackScholesProcess handle
x0 The underlying's value (a number)
dx The change of its logarithm (a number)

Returns double. C#: Apply

nqlGeneralizedBlackScholesProcessBlackVolatility

Gets the Black volatility.

Argument Description
self a GeneralizedBlackScholesProcess handle

Returns handle. C#: BlackVolatility

nqlGeneralizedBlackScholesProcessDiffusion

The diffusion: the local volatility at the time and value, extrapolated; on another clock than the risk-free curve's, at the instant's own time, per unit of the risk-free curve's time, and nothing before its reference date.

Argument Description
self a GeneralizedBlackScholesProcess handle
t The time (a number)
x The underlying's value (a number)

Returns double. C#: Diffusion

nqlGeneralizedBlackScholesProcessDividendYield

Gets the dividend curve.

Argument Description
self a GeneralizedBlackScholesProcess handle

Returns handle. C#: DividendYield

nqlGeneralizedBlackScholesProcessDrift

The drift of ln S: r − q − σ²/2, the rates instantaneous forwards over 0.0001 years.

Argument Description
self a GeneralizedBlackScholesProcess handle
t The time (a number)
x The underlying's value (a number)

Returns double. C#: Drift

nqlGeneralizedBlackScholesProcessEvolve

The value after a time interval and a Brownian increment: exactly where the local volatility is strike-independent and the discretization isn't forced, by the discretization otherwise.

Argument Description
self a GeneralizedBlackScholesProcess handle
t0 The start of the interval (a number)
x0 The underlying's value at its start (a number)
dt The interval's length (a number)
dw The Brownian increment (a number)

Returns double. C#: Evolve

nqlGeneralizedBlackScholesProcessExpectation

The expectation of S after a time interval, exactly, from the forward rates over it; only where the local volatility is strike-independent and the discretization isn't forced.

Argument Description
self a GeneralizedBlackScholesProcess handle
t0 The start of the interval (a number)
x0 The underlying's value at its start (a number)
dt The interval's length (a number)

Returns double. C#: Expectation

nqlGeneralizedBlackScholesProcessLocalVolatility

Gets the local volatility: the one given, or the one derived from the Black volatility.

Argument Description
self a GeneralizedBlackScholesProcess handle

Returns handle. C#: LocalVolatility

nqlGeneralizedBlackScholesProcessRiskFreeRate

Gets the risk-free curve.

Argument Description
self a GeneralizedBlackScholesProcess handle

Returns handle. C#: RiskFreeRate

nqlGeneralizedBlackScholesProcessStateVariable

Gets the underlying's value: QuantLib's state variable, a quote there and a number here.

Argument Description
self a GeneralizedBlackScholesProcess handle

Returns double. C#: StateVariable

nqlGeneralizedBlackScholesProcessStdDeviation

The standard deviation after a time interval: the square root of the exact variance where the local volatility is strike-independent and the discretization isn't forced, the discretization's otherwise.

Argument Description
self a GeneralizedBlackScholesProcess handle
t0 The start of the interval (a number)
x0 The underlying's value at its start (a number)
dt The interval's length (a number)

Returns double. C#: StdDeviation

nqlGeneralizedBlackScholesProcessTime

The time of a date, by the risk-free curve's day counter from its reference date.

Argument Description
self a GeneralizedBlackScholesProcess handle
date The date (a date)

Returns double. C#: Time

nqlGeneralizedBlackScholesProcessVariance

The variance after a time interval: the Black variance's increment over it, at a strike of 0.01, where the local volatility is strike-independent and the discretization isn't forced; the discretization's otherwise.

Argument Description
self a GeneralizedBlackScholesProcess handle
t0 The start of the interval (a number)
x0 The underlying's value at its start (a number)
dt The interval's length (a number)

Returns double. C#: Variance

nqlGeneralizedBlackScholesProcessX0

Gets the initial value of the state variable.

Argument Description
self a GeneralizedBlackScholesProcess handle

Returns double. C#: X0

nqlHestonModel

Initializes a new instance of the HestonModel class.

Argument Description
process The process whose curves, spot and parameters the model starts from (a HestonProcess handle)

Returns handle. C#: HestonModel

nqlHestonModelKappa

Gets the variance's mean-reversion speed κ.

Argument Description
self a HestonModel handle

Returns double. C#: Kappa

nqlHestonModelProcess

Gets the underlying process, on the model's parameters.

Argument Description
self a HestonModel handle

Returns handle. C#: Process

nqlHestonModelRho

Gets the correlation ρ.

Argument Description
self a HestonModel handle

Returns double. C#: Rho

nqlHestonModelSigma

Gets the variance's volatility σ.

Argument Description
self a HestonModel handle

Returns double. C#: Sigma

nqlHestonModelTheta

Gets the variance's long-run mean θ.

Argument Description
self a HestonModel handle

Returns double. C#: Theta

nqlHestonModelV0

Gets the variance's value v₀.

Argument Description
self a HestonModel handle

Returns double. C#: V0

nqlHestonProcess

Initializes a new instance of the HestonProcess class.

Argument Description
riskFreeRate The risk-free curve (a YieldTermStructure handle)
dividendYield The dividend curve (a YieldTermStructure handle)
s0 The underlying's value (a number)
v0 The variance's value (a number)
kappa The variance's mean-reversion speed κ (a number)
theta The variance's long-run mean θ (a number)
sigma The variance's volatility σ (a number)
rho The correlation ρ of the two Brownian motions (a number)
d Optional. The discretization HestonProcess.Evolve steps by (a HestonProcessDiscretization name)

Returns handle. C#: HestonProcess

nqlHestonProcessApply

Applies a change to the state; by default x + Δx.

Argument Description
self a HestonProcess handle
x0 The state (a row or column of numbers)
dx The change (a row or column of numbers)

Returns vector. C#: Apply

nqlHestonProcessDiffusion

The diffusion part of the equation, σ(t, x_t).

Argument Description
self a HestonProcess handle
t The time (a number)
x The state (a row or column of numbers)

Returns matrix. C#: Diffusion

nqlHestonProcessDividendYield

Gets the dividend curve.

Argument Description
self a HestonProcess handle

Returns handle. C#: DividendYield

nqlHestonProcessDrift

The drift part of the equation, μ(t, x_t).

Argument Description
self a HestonProcess handle
t The time (a number)
x The state (a row or column of numbers)

Returns vector. C#: Drift

nqlHestonProcessEvolve

The state after a time interval Δt; by default E(x0, t0, Δt) + S(x0, t0, Δt) · Δw, where E is the expectation and S the standard deviation, applied to the expectation by StochasticProcess.Apply.

Argument Description
self a HestonProcess handle
t0 The start of the interval (a number)
x0 The state at its start (a row or column of numbers)
dt The interval's length (a number)
dw The Brownian increments, one per factor (a row or column of numbers)

Returns vector. C#: Evolve

nqlHestonProcessFactors

Gets the number of independent factors of the process; by default, its Size.

Argument Description
self a HestonProcess handle

Returns int32. C#: Factors

nqlHestonProcessInitialValues

The initial values of the state variables.

Argument Description
self a HestonProcess handle

Returns vector. C#: InitialValues

nqlHestonProcessKappa

Gets the mean-reversion speed κ.

Argument Description
self a HestonProcess handle

Returns double. C#: Kappa

nqlHestonProcessPdf

The joint density of the log spot x and the variance v at time t: the variance's non-central chi-squared density times the log spot's conditional density given it, from the integrated variance's characteristic function (Broadie and Kaya).

Argument Description
self a HestonProcess handle
x The log spot (a number)
v The variance (a number)
t The time, on the risk-free curve's clock (a number)
eps Optional. QuantLib's accuracy for a tail search whose result its own code overwrites ( hestonprocess.cpp:307-323 ): the density depends on it neither there nor here (a number)

Returns double. C#: Pdf

nqlHestonProcessRho

Gets the correlation ρ.

Argument Description
self a HestonProcess handle

Returns double. C#: Rho

nqlHestonProcessRiskFreeRate

Gets the risk-free curve.

Argument Description
self a HestonProcess handle

Returns handle. C#: RiskFreeRate

nqlHestonProcessS0

Gets the underlying's value.

Argument Description
self a HestonProcess handle

Returns double. C#: S0

nqlHestonProcessSigma

Gets the variance's volatility σ.

Argument Description
self a HestonProcess handle

Returns double. C#: Sigma

nqlHestonProcessSize

Gets the number of dimensions of the process.

Argument Description
self a HestonProcess handle

Returns int32. C#: Size

nqlHestonProcessTheta

Gets the long-run mean θ.

Argument Description
self a HestonProcess handle

Returns double. C#: Theta

nqlHestonProcessTime

The time of a date: the risk-free curve's year fraction from its reference date.

Argument Description
self a HestonProcess handle
date The date (a date)

Returns double. C#: Time

nqlHestonProcessV0

Gets the variance's value.

Argument Description
self a HestonProcess handle

Returns double. C#: V0

nqlHullWhite

Initializes a new instance of the HullWhite class.

Argument Description
termStructure The curve the model fits (a YieldTermStructure handle)
a Optional. The mean-reversion speed α, positive (a number)
sigma Optional. The volatility σ, positive (a number)

Returns handle. C#: HullWhite

nqlHullWhiteConvexityBias

The convexity bias of a futures rate: the difference between the futures-implied rate and the forward rate, as in G. Kirikos and D. Novak, "Convexity Conundrums", Risk Magazine, March 1997.

Argument Description
futurePrice The futures' market price (a number)
t The futures' maturity, as a year fraction of the deposit's day counter (a number)
T The underlying deposit's maturity, likewise (a number)
sigma The volatility (a number)
a The mean-reversion speed (a number)

Returns double. C#: ConvexityBias

nqlHullWhiteDiscountBondOption

The price of an option on a discount bond, by Black's formula on the curve's discount factors.

Argument Description
self a HullWhite handle
type The option's type (a OptionType name)
strike The strike (a number)
maturity The option's maturity (a number)
bondMaturity The bond's maturity (a number)

Returns double. C#: DiscountBondOption

nqlHullWhiteDiscountBondOption2

The price of an option on a discount bond that starts later than the option's maturity.

Argument Description
self a HullWhite handle
type The option's type (a OptionType name)
strike The strike (a number)
maturity The option's maturity (a number)
bondStart The bond's start (a number)
bondMaturity The bond's maturity (a number)

Returns double. C#: DiscountBondOption

nqlHullWhiteDynamics

The model's short-rate dynamics, with the analytical fitting parameter.

Argument Description
self a HullWhite handle

Returns handle. C#: Dynamics

nqlHullWhiteFixedReversion

The fixed-parameter specification that fixes the reversion α and frees σ, for a calibration.

Returns array:bool. C#: FixedReversion

nqlHullWhiteTermStructure

Gets the curve the model fits.

Argument Description
self a HullWhite handle

Returns handle. C#: TermStructure

nqlICalibratedModelDefaultFixParameters

Gets the parameters a calibration fixes when its caller fixes none: one flag per parameter, or empty, the default, for all free.

Argument Description
self a ICalibratedModel handle

Returns array:bool. C#: DefaultFixParameters

nqlLevenbergMarquardt

Initializes a new instance of the LevenbergMarquardt class.

Argument Description
epsfcn Optional. The functions' relative errors, which set the forward-difference step (a number)
xtol Optional. The relative error desired in the solution, non-negative (a number)
gtol Optional. The orthogonality desired between the values and the Jacobian's columns, non-negative (a number)
useCostFunctionsJacobian Optional. Whether to use the cost function's Jacobian rather than forward differences (TRUE or FALSE)

Returns handle. C#: LevenbergMarquardt

nqlNoConstraint

new NoConstraint()

Returns handle. C#: NoConstraint

nqlNoConstraintTest

Whether the parameters satisfy the constraint.

Argument Description
self a NoConstraint handle
p The parameters (a row or column of numbers)

Returns bool. C#: Test

nqlOneFactorAffineModelDiscount

The implied discount curve: the discount bond from 0 at the short rate of the state variable's start.

Argument Description
self a OneFactorAffineModel handle
t The time (a number)

Returns double. C#: Discount

nqlOneFactorAffineModelDiscountBond

The price at a time of a unit discount bond maturing later, given the factor then.

Argument Description
self a OneFactorAffineModel handle
now The time (a number)
maturity The bond's maturity (a number)
factors The factor's value at now, the vector's first element (a row or column of numbers)

Returns double. C#: DiscountBond

nqlOneFactorAffineModelDiscountBond2

The price at a time of a unit discount bond maturing later, given the short rate then: A·exp(−B·r).

Argument Description
self a OneFactorAffineModel handle
now The time (a number)
maturity The bond's maturity (a number)
rate The short rate at now (a number)

Returns double. C#: DiscountBond

nqlOneFactorAffineModelDiscountBondOption2

The price of an option on a discount bond that starts later than the option's maturity: by default, as QuantLib's, the option on the bond from the option's maturity, bondStart ignored.

Argument Description
self a OneFactorAffineModel handle
type The option's type (a OptionType name)
strike The strike (a number)
maturity The option's maturity (a number)
bondStart The bond's start (a number)
bondMaturity The bond's maturity (a number)

Returns double. C#: DiscountBondOption

nqlSimplex

Initializes a new instance of the Simplex class.

Argument Description
lambda The characteristic length, λ (a number)

Returns handle. C#: Simplex

nqlSimplexLambda

Gets the characteristic length, λ.

Argument Description
self a Simplex handle

Returns double. C#: Lambda

nqlSphereCylinderOptimizer

Initializes a new instance of the SphereCylinderOptimizer class.

Argument Description
r The sphere's radius, positive (a number)
s The cylinder's radius; a negative one is 0 (a number)
alpha The cylinder centre's first coordinate, positive (a number)
z1 Z's first coordinate (a number)
z2 Z's second coordinate (a number)
z3 Z's third coordinate (a number)
zweight Optional. The third coordinate's weight in the distance (a number)

Returns handle. C#: SphereCylinderOptimizer

nqlSphereCylinderOptimizerIsIntersectionNonEmpty

Whether the sphere and the cylinder intersect.

Argument Description
self a SphereCylinderOptimizer handle

Returns bool. C#: IsIntersectionNonEmpty

nqlSteepestDescent

Initializes a new instance of the SteepestDescent class.

Returns handle. C#: SteepestDescent

nqlStochasticProcess1DApply2

The changed state, as a vector of size 1, from the 1-D StochasticProcess1D.Apply.

Argument Description
self a StochasticProcess1D handle
x0 The state, of size 1 (a row or column of numbers)
dx The change, of size 1 (a row or column of numbers)

Returns vector. C#: Apply

nqlStochasticProcess1DCovariance

The covariance, as a 1 × 1 matrix holding the variance, from the state's first element.

Argument Description
self a StochasticProcess1D handle
t0 The start of the interval (a number)
x0 The state at its start, of size 1 (a row or column of numbers)
dt The interval's length (a number)

Returns matrix. C#: Covariance

nqlStochasticProcess1DDiffusion2

The diffusion, as a 1 × 1 matrix, at the state's first element.

Argument Description
self a StochasticProcess1D handle
t The time (a number)
x The state, of size 1 (a row or column of numbers)

Returns matrix. C#: Diffusion

nqlStochasticProcess1DDrift2

The drift, as a vector of size 1, at the state's first element.

Argument Description
self a StochasticProcess1D handle
t The time (a number)
x The state, of size 1 (a row or column of numbers)

Returns vector. C#: Drift

nqlStochasticProcess1DEvolve2

The state after a time interval, as a vector of size 1, from the 1-D evolution.

Argument Description
self a StochasticProcess1D handle
t0 The start of the interval (a number)
x0 The state at its start, of size 1 (a row or column of numbers)
dt The interval's length (a number)
dw The Brownian increment, of size 1 (a row or column of numbers)

Returns vector. C#: Evolve

nqlStochasticProcess1DExpectation2

The expectation, as a vector of size 1, from the state's first element.

Argument Description
self a StochasticProcess1D handle
t0 The start of the interval (a number)
x0 The state at its start, of size 1 (a row or column of numbers)
dt The interval's length (a number)

Returns vector. C#: Expectation

nqlStochasticProcess1DInitialValues

The initial value, as a vector of size 1.

Argument Description
self a StochasticProcess1D handle

Returns vector. C#: InitialValues

nqlStochasticProcess1DSize

Gets 1, the number of dimensions of a 1-D process.

Argument Description
self a StochasticProcess1D handle

Returns int32. C#: Size

nqlStochasticProcess1DStdDeviation2

The standard deviation, as a 1 × 1 matrix, from the state's first element.

Argument Description
self a StochasticProcess1D handle
t0 The start of the interval (a number)
x0 The state at its start, of size 1 (a row or column of numbers)
dt The interval's length (a number)

Returns matrix. C#: StdDeviation

nqlStochasticProcessCovariance

The covariance V(x_{t0 + Δt} | x_{t0} = x0) of the process after a time interval Δt; by default, the discretization's covariance.

Argument Description
self a StochasticProcess handle
t0 The start of the interval (a number)
x0 The state at its start (a row or column of numbers)
dt The interval's length (a number)

Returns matrix. C#: Covariance

nqlStochasticProcessExpectation

The expectation E(x_{t0 + Δt} | x_{t0} = x0) of the process after a time interval Δt; by default, the discretization's drift applied to x0 by StochasticProcess.Apply.

Argument Description
self a StochasticProcess handle
t0 The start of the interval (a number)
x0 The state at its start (a row or column of numbers)
dt The interval's length (a number)

Returns vector. C#: Expectation

nqlStochasticProcessFactors

Gets the number of independent factors of the process; by default, its Size.

Argument Description
self a StochasticProcess handle

Returns int32. C#: Factors

nqlStochasticProcessStdDeviation

The standard deviation S(x_{t0 + Δt} | x_{t0} = x0) of the process after a time interval Δt; by default, the discretization's diffusion.

Argument Description
self a StochasticProcess handle
t0 The start of the interval (a number)
x0 The state at its start (a row or column of numbers)
dt The interval's length (a number)

Returns matrix. C#: StdDeviation

nqlSwaptionHelper

Initializes a new instance of the SwaptionHelper class, exercising a period after the curve's reference date.

Argument Description
maturity The time from the term structure's reference date to the exercise date (a period such as "6M")
length The swap's length from its start date (a period such as "6M")
volatility The quoted volatility (a number)
index The floating leg's index; an overnight index builds an overnight-indexed swap (a IborIndex handle)
fixedLegTenor The fixed leg's tenor (a period such as "6M")
fixedLegDayCounter The fixed leg's day counter; the index's when null (a DayCounter handle or its name)
floatingLegDayCounter The floating leg's day counter; the index's when null. An overnight-indexed swap doesn't read it (a DayCounter handle or its name)
termStructure The curve the swaps and the Black price discount on (a YieldTermStructure handle)
context The evaluation context, whose at-par switch the Ibor legs read and under which the market value is computed (a EvaluationContext handle)
errorType Optional. How the helper measures its error (a BlackCalibrationHelperCalibrationErrorType name)
strike Optional. The strike; null for the forward, at the money (a number)
nominal Optional. The swaps' nominal (a number)
type Optional. The volatility's type (a VolatilityType name)
shift Optional. The shift of a shifted lognormal volatility (a number)
settlementDays Optional. Whether the start date is the index's fixing days after the exercise date, when not null; its value isn't read (a whole number)
averagingMethod Optional. The overnight-indexed swap's averaging method (a RateAveragingType name)

Returns handle. C#: SwaptionHelper

nqlSwaptionHelper2

Initializes a new instance of the SwaptionHelper class, exercising on a date.

Argument Description
exerciseDate The exercise date (a date)
length The swap's length from its start date (a period such as "6M")
volatility The quoted volatility (a number)
index The floating leg's index; an overnight index builds an overnight-indexed swap (a IborIndex handle)
fixedLegTenor The fixed leg's tenor (a period such as "6M")
fixedLegDayCounter The fixed leg's day counter; the index's when null (a DayCounter handle or its name)
floatingLegDayCounter The floating leg's day counter; the index's when null. An overnight-indexed swap doesn't read it (a DayCounter handle or its name)
termStructure The curve the swaps and the Black price discount on (a YieldTermStructure handle)
context The evaluation context, whose at-par switch the Ibor legs read and under which the market value is computed (a EvaluationContext handle)
errorType Optional. How the helper measures its error (a BlackCalibrationHelperCalibrationErrorType name)
strike Optional. The strike; null for the forward, at the money (a number)
nominal Optional. The swaps' nominal (a number)
type Optional. The volatility's type (a VolatilityType name)
shift Optional. The shift of a shifted lognormal volatility (a number)
settlementDays Optional. Whether the start date is the index's fixing days after the exercise date, when not null; its value isn't read (a whole number)
averagingMethod Optional. The overnight-indexed swap's averaging method (a RateAveragingType name)

Returns handle. C#: SwaptionHelper

nqlSwaptionHelper3

Initializes a new instance of the SwaptionHelper class, exercising on a date into a swap ending on a date.

Argument Description
exerciseDate The exercise date (a date)
endDate The swap's end date (a date)
volatility The quoted volatility (a number)
index The floating leg's index; an overnight index builds an overnight-indexed swap (a IborIndex handle)
fixedLegTenor The fixed leg's tenor (a period such as "6M")
fixedLegDayCounter The fixed leg's day counter; the index's when null (a DayCounter handle or its name)
floatingLegDayCounter The floating leg's day counter; the index's when null. An overnight-indexed swap doesn't read it (a DayCounter handle or its name)
termStructure The curve the swaps and the Black price discount on (a YieldTermStructure handle)
context The evaluation context, whose at-par switch the Ibor legs read and under which the market value is computed (a EvaluationContext handle)
errorType Optional. How the helper measures its error (a BlackCalibrationHelperCalibrationErrorType name)
strike Optional. The strike; null for the forward, at the money (a number)
nominal Optional. The swaps' nominal (a number)
type Optional. The volatility's type (a VolatilityType name)
shift Optional. The shift of a shifted lognormal volatility (a number)
settlementDays Optional. Whether the start date is the index's fixing days after the exercise date, when not null; its value isn't read (a whole number)
averagingMethod Optional. The overnight-indexed swap's averaging method (a RateAveragingType name)

Returns handle. C#: SwaptionHelper

nqlSwaptionHelperBlackPrice

The swaption's Black price at a volatility: a BlackSwaptionEngine on the volatility with the helper's shift for a shifted lognormal type, a BachelierSwaptionEngine for a normal one, each on the term structure with an Actual/365 (Fixed) volatility.

Argument Description
self a SwaptionHelper handle
volatility The volatility (a number)
context The evaluation context (a EvaluationContext handle)

Returns double. C#: BlackPrice

nqlSwaptionHelperModelValue

The swaption's price according to a model, through the pricing engine.

Argument Description
self a SwaptionHelper handle
model The model (a ICalibratedModel handle)
context The evaluation context (a EvaluationContext handle)

Returns double. C#: ModelValue

nqlSwaptionHelperSetPricingEngine

SwaptionHelper.SetPricingEngine(Func<Swaption, EvaluationContext, ICalibratedModel, InstrumentResults> engine) -> SwaptionHelper

Argument Description
self a SwaptionHelper handle
engine a bound engine's handle

Returns handle. C#: SetPricingEngine

nqlSwaptionHelperSwaption

Gets the European swaption on the underlying swap, physically settled over the counter.

Argument Description
self a SwaptionHelper handle

Returns handle. C#: Swaption

nqlSwaptionHelperTimes

The times a lattice for the swaption must stop at: the mandatory times of its DiscretizedSwaption, on the term structure's reference date and day counter.

Argument Description
self a SwaptionHelper handle
context The evaluation context, whose at-par switch the discretized swaption's snapped swap reads (a EvaluationContext handle)

Returns array:double. C#: Times

nqlSwaptionHelperUnderlying

Gets the underlying swap, at the exercise rate.

Argument Description
self a SwaptionHelper handle

Returns handle. C#: Underlying

nqlVasicek

Initializes a new instance of the Vasicek class.

Argument Description
r0 Optional. The initial short rate (a number)
a Optional. The mean-reversion speed, positive (a number)
b Optional. The mean-reversion level (a number)
sigma Optional. The volatility, positive (a number)
lambda Optional. The risk premium (a number)

Returns handle. C#: Vasicek

nqlVasicekA

The mean-reversion speed a.

Argument Description
self a Vasicek handle

Returns double. C#: A

nqlVasicekB

The mean-reversion level b.

Argument Description
self a Vasicek handle

Returns double. C#: B

nqlVasicekDiscountBondOption

The price of an option on a discount bond, by Black's formula on the bond's forward price.

Argument Description
self a Vasicek handle
type The option's type (a OptionType name)
strike The strike (a number)
maturity The option's maturity (a number)
bondMaturity The bond's maturity (a number)

Returns double. C#: DiscountBondOption

nqlVasicekDynamics

The model's short-rate dynamics: an Ornstein-Uhlenbeck process of r − b.

Argument Description
self a Vasicek handle

Returns handle. C#: Dynamics

nqlVasicekLambda

Gets the risk premium λ.

Argument Description
self a Vasicek handle

Returns double. C#: Lambda

nqlVasicekR0

Gets the initial short rate, which a derived model may compute in its CalibratedModel.GenerateArguments: its setter is for a model under construction or a fresh copy only, as CalibratedModel's writes are.

Argument Description
self a Vasicek handle

Returns double. C#: R0

nqlVasicekSigma

Gets the volatility σ.

Argument Description
self a Vasicek handle

Returns double. C#: Sigma