Class GaussLaguerreTrigonometricBase
The base of the Gauss-Laguerre cosine and sine polynomials: the moments of e^(−x) times cos(ux) or sin(ux), by their recurrence mₙ = (2n·mₙ₋₁ − n(n − 1)·mₙ₋₂)/(1 + u²), and the factorials.
public abstract class GaussLaguerreTrigonometricBase : MomentBasedGaussianPolynomial
- Inheritance
-
GaussLaguerreTrigonometricBase
- Derived
- Inherited Members
Remarks
QuantLib keeps the moments and factorials in NaN-filled memos; here each call computes moment n and n! by a loop, the same products in QuantLib's order, so QuantLib's values, in O(n) with nothing kept.
Constructors
GaussLaguerreTrigonometricBase(double)
Initializes a new instance of the GaussLaguerreTrigonometricBase class.
protected GaussLaguerreTrigonometricBase(double u)
Parameters
udoubleThe frequency u.
Properties
U
Gets the frequency u.
protected double U { get; }
Property Value
Methods
Fact(int)
The factorial n!, as QuantLib's products.
protected static double Fact(int n)
Parameters
nintThe argument, non-negative.
Returns
- double
The factorial.
Exceptions
- ArgumentOutOfRangeException
nis negative.
M0()
The zeroth moment of the trigonometric weight, the recurrence's start.
protected abstract double M0()
Returns
- double
The moment.
M1()
The first moment of the trigonometric weight, the recurrence's second start.
protected abstract double M1()
Returns
- double
The moment.
TrigonometricMoment(int)
protected double TrigonometricMoment(int n)
Parameters
nintThe order, non-negative.
Returns
- double
The moment.
Exceptions
- ArgumentOutOfRangeException
nis negative.