Class MarketModelDifferencesFunctions
The differences between two market models on the same initial rates and evolution: their rates' volatilities and
instantaneous volatilities. QuantLib's free functions in marketmodeldifferences.hpp.
public static class MarketModelDifferencesFunctions
- Inheritance
-
MarketModelDifferencesFunctions
- Inherited Members
Methods
RateInstVolDifferences(MarketModel, MarketModel, int)
A rate's instantaneous volatility difference at each step, √((C₁ − C₂)ᵢᵢ / Δt): the two models' covariances of the step, the rate's variance difference over the step's length.
public static ImmutableArray<double> RateInstVolDifferences(MarketModel marketModel1, MarketModel marketModel2, int index)
Parameters
marketModel1MarketModelThe first model.
marketModel2MarketModelThe second model.
indexintThe rate's index.
Returns
- ImmutableArray<double>
The differences, one a step.
Remarks
The rate's index is checked against the number of rates (a documented divergence): QuantLib checks it against
the number of steps (marketmodeldifferences.cpp:68), refusing valid rates on coarse steps and reading
past the covariance on fine ones.
Exceptions
- NanoQLException
The models' initial rates or evolution times differ, or the index is past the rates.
RateVolDifferences(MarketModel, MarketModel)
Each rate's volatility difference over its life, √((Σ₁ − Σ₂)ᵢᵢ / min(Tᵢ, tₙ)): the two models' total covariances to their last steps, the rate's variance difference over the time it accrues, to its reset time Tᵢ or to the evolution's last time tₙ, whichever comes first.
public static ImmutableArray<double> RateVolDifferences(MarketModel marketModel1, MarketModel marketModel2)
Parameters
marketModel1MarketModelThe first model.
marketModel2MarketModelThe second model.
Returns
- ImmutableArray<double>
The differences, one a rate.
Remarks
A rate's variance is divided by the time it accrues over (a documented divergence): QuantLib divides rate i's by
the i-th evolution time (marketmodeldifferences.cpp:50), √2 too high on quarterly steps over semi-annual
rates and a read past the evolution times where the rates outnumber the steps. The total covariance accrues
nothing past the evolution's last time, so on an evolution ending before a rate resets, the rate's reset time
alone would read it low (Divergences/MarketModelDifferencesTests.cs). Where the evolution times are the
rate times, QuantLib's value.
Exceptions
- NanoQLException
The models' initial rates or evolution times differ.