Class LsmBasisSystem
The basis systems of the Longstaff-Schwartz early-exercise Monte Carlo regressions.
public static class LsmBasisSystem
- Inheritance
-
LsmBasisSystem
- Inherited Members
Remarks
A static class, as QuantLib's static members: each system is an immutable array of functions, the polynomials of orders 0 to the order given, the orthogonal ones weighted by the square root of their weight function.
Methods
MultiPathBasisSystem(int, int, LsmBasisSystemPolynomialType)
The multi-factor basis: the products over the factors of the one-factor polynomials whose orders sum to at most
order, the constant first, then each total order's terms in increasing lexicographic order of
their orders.
public static ImmutableArray<Func<Vector, double>> MultiPathBasisSystem(int dim, int order, LsmBasisSystemPolynomialType type)
Parameters
dimintThe number of factors.
orderintThe highest total order.
typeLsmBasisSystemPolynomialTypeThe polynomial family.
Returns
- ImmutableArray<Func<Vector, double>>
The basis functions, each of a vector with one element per factor.
Exceptions
- ArgumentOutOfRangeException
orderis negative.- NanoQLException
dimisn't positive ("zero dimension"), or the family is unknown.
PathBasisSystem(int, LsmBasisSystemPolynomialType)
The one-factor basis: the polynomials of orders 0 to order.
public static ImmutableArray<Func<double, double>> PathBasisSystem(int order, LsmBasisSystemPolynomialType type)
Parameters
orderintThe highest order.
typeLsmBasisSystemPolynomialTypeThe polynomial family.
Returns
- ImmutableArray<Func<double, double>>
The basis functions,
order+ 1 of them.
Exceptions
- ArgumentOutOfRangeException
orderis negative.- NanoQLException
The family is unknown.