Class SamplerCauchy
- Namespace
- NanoQL.Experimental
- Assembly
- NanoQL.dll
A sampler from the Cauchy distribution, x + T·c: for lower dimensions it can be faster than the Gaussian sampler,
especially with the Cauchy temperature: QuantLib's SamplerCauchy.
[Experimental("NQL0001")]
[WorkingType]
public sealed class SamplerCauchy : IAnnealingSampler<SamplerCauchy>
- Inheritance
-
SamplerCauchy
- Implements
- Inherited Members
Remarks
Its draws are std::cauchy_distribution<Real>(0.0, 1.0) on a std::mt19937, as MSVC draws them, on
the seed, which is required: QuantLib's default seeds from the clock. A working type.
Constructors
SamplerCauchy(long)
Initializes a new instance of the SamplerCauchy class.
public SamplerCauchy(long seed)
Parameters
seedlongThe seed, in [1, 4294967295].
Exceptions
- ArgumentOutOfRangeException
seedis outside [1, 4294967295].
Methods
Clone()
A copy, its state included: the copy's next draw equals this sampler's.
public SamplerCauchy Clone()
Returns
- SamplerCauchy
The copy.
Sample(Vector, Vector, Vector)
Draws a new point (QuantLib's operator()).
public void Sample(Vector newPoint, Vector currentPoint, Vector temp)
Parameters
newPointVectorThe new point, which it sets.
currentPointVectorThe current point.
tempVectorEach dimension's temperature.
Exceptions
- ArgumentException
The vectors' sizes differ, with QuantLib's text.