Table of Contents

Class MCHullWhiteCapFloorEngine

Namespace
NanoQL.PricingEngines
Assembly
NanoQL.dll

The Monte Carlo Hull-White cap/floor engine: the short rate simulated in the forward measure of the last payment, each path priced by NanoQL.PricingEngines.HullWhiteCapFloorPricer.

public static class MCHullWhiteCapFloorEngine
Inheritance
MCHullWhiteCapFloorEngine
Inherited Members

Remarks

A static class: Calculate runs QuantLib's four steps (playbook §2.1) on the model, an argument where QuantLib's engine holds it, through McSimulation<TPath, TStats>: a HullWhiteForwardProcess on the model's curve and parameters at the last payment's time, on a grid of the fixings after the reference date and the last payment; the NPV is the samples' mean, and the error estimate is theirs where the random-number traits allow one. The type parameters, the traits and the accumulator, are QuantLib's template parameters, whose defaults are PseudoRandom and GeneralStatistics.

The seed is explicit: QuantLib's 0, a seed from the clock, is refused.

Methods

Calculate<TRng, TStats>(CapFloor, EvaluationContext, HullWhite, bool, bool, int?, double?, int?, long)

Prices a cap, floor or collar by Monte Carlo on a Hull-White model.

public static InstrumentResults Calculate<TRng, TStats>(CapFloor capFloor, EvaluationContext context, HullWhite model, bool brownianBridge, bool antitheticVariate, int? requiredSamples, double? requiredTolerance, int? maxSamples, long seed) where TRng : IRngTraits where TStats : IStatistics, new()

Parameters

capFloor CapFloor

The cap, floor or collar.

context EvaluationContext

The evaluation context.

model HullWhite

The Hull-White model.

brownianBridge bool

Whether the paths are drawn through a Brownian bridge.

antitheticVariate bool

Whether antithetic variates are used.

requiredSamples int?

The number of samples, or null, QuantLib's null.

requiredTolerance double?

The absolute tolerance, or null; it takes precedence over the number of samples.

maxSamples int?

The most samples for a tolerance, or null for no limit.

seed long

The seed, in [1, 4294967295].

Returns

InstrumentResults

The instrument's results, the NPV and, where the traits allow one, the error estimate: the expired results when it has expired.

Type Parameters

TRng

The random-number traits.

TStats

The statistics accumulator.

Exceptions

ArgumentNullException

The cap, the context or the model is null.

ArgumentOutOfRangeException

requiredSamples or maxSamples is negative, or seed is outside its range.

NanoQLException

The cap's terms are inconsistent, a cash flow isn't a floating-rate coupon, a forward can't be computed, neither a tolerance nor a number of samples is given, or the samples can't reach the tolerance.