Math

Overview

Math utility functions.

Function List

qlCholeskyDecomposition ()
qlCovarianceDecomposition ()
qlCovarianceDecompositionCorrelationMatrix ()
qlCovarianceDecompositionStandardDeviations ()
qlCovarianceDecompositionVariances ()
qlGetCovariance ()
qlNormDist ()
qlNormInv ()
qlNormSDist ()
qlNormSInv ()
qlPrimeNumber ()
qlPseudoSqrt ()
qlRankReducedSqrt ()
qlSymmetricSchurDecomposition ()
qlSymmetricSchurDecompositionEigenvalues ()
qlSymmetricSchurDecompositionEigenvectors ()

Function Documentation

qlCholeskyDecomposition

vector<vector<double> > returnValue
qlCholeskyDecomposition(
vector<vector<double> > Matrix
bool Flexible
any Trigger)
Description:

Returns the Cholesky decomposition of a real symmetric matrix.

Supported Platforms:

Excel

Parameters
Matrixsymmetric matrix (hopefully positive semi-definite at least).
FlexibleIf TRUE it returns a result also for positive semi-definite matrix. Default value = false.
Triggerdependency tracking trigger

qlCovarianceDecomposition

string returnValue
qlCovarianceDecomposition(
string ObjectId
vector<vector<double> > SymmetricMatrix
double Tolerance
bool Permanent
any Trigger
bool Overwrite)
Description:

Construct an object of class CovarianceDecomposition and return its id

Supported Platforms:

Excel

Parameters
ObjectIdid of object to be created
SymmetricMatrixSymmetrix covariance matrix to be decomposed.
Tolerancenumerical tolerance for non symmetric matrix. Default value = 1.0e12.
Permanentobject permanent/nonpermanent
Triggerdependency tracking trigger
Overwriteoverwrite flag

qlCovarianceDecompositionCorrelationMatrix

vector<vector<double> > returnValue
qlCovarianceDecompositionCorrelationMatrix(
string ObjectId
any Trigger)
Description:

Returns the correlation matrix for the given CovarianceDecomposition object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::CovarianceDecomposition object
Triggerdependency tracking trigger

qlCovarianceDecompositionStandardDeviations

vector<double> returnValue
qlCovarianceDecompositionStandardDeviations(
string ObjectId
any Trigger)
Description:

Returns the standard deviation (i.e. volatility times square root of time) vector for the given CovarianceDecomposition object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::CovarianceDecomposition object
Triggerdependency tracking trigger

qlCovarianceDecompositionVariances

vector<double> returnValue
qlCovarianceDecompositionVariances(
string ObjectId
any Trigger)
Description:

Returns the variance vector for the given CovarianceDecomposition object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::CovarianceDecomposition object
Triggerdependency tracking trigger

qlGetCovariance

vector<vector<double> > returnValue
qlGetCovariance(
vector<double> Vols
vector<vector<double> > Matrix
double Tolerance
any Trigger)
Description:

Returns the covariance matrix generated using the correlation matrix and the standard deviation (i.e. volatility times square root of time) array.

Supported Platforms:

Excel

Parameters
Volsvolatility vector.
Matrixsymmetric matrix (hopefully positive semi-definite at least).
Tolerancenumerical tolerance for non symmetric matrix. Default value = 1.0e12.
Triggerdependency tracking trigger

qlNormDist

double returnValue
qlNormDist(
double X
double Mean
double Standard_dev
bool Cumulative
any Trigger)
Description:

Returns the normal cumulative distribution for the specified mean and standard deviation.

Supported Platforms:

Excel

Parameters
Xis the value for which you want the distribution.
Meanis the arithmetic mean of the distribution. Default value = 0.0.
Standard_devis the standard deviation of the distribution, a positive number. Default value = 1.0.
Cumulativeis a logical value: for the cumulative distribution function, use TRUE; for the probability mass function, use FALSE. Default value = TRUE.
Triggerdependency tracking trigger

qlNormInv

double returnValue
qlNormInv(
double Probability
double Mean
double Standard_dev
any Trigger)
Description:

Returns the inverse of the normal cumulative distribution for the specified mean and standard deviation.

Supported Platforms:

Excel

Parameters
Probabilityis a probability corresponding to the normal distribution, a number between 0 and 1 inclusive.
Meanis the arithmetic mean of the distribution. Default value = 0.0.
Standard_devis the standard deviation of the distribution, a positive number. Default value = 1.0.
Triggerdependency tracking trigger

qlNormSDist

double returnValue
qlNormSDist(
double Z
any Trigger)
Description:

Returns the standard normal cumulative distribution (has a mean of zero and standard deviation of one).

Supported Platforms:

Excel

Parameters
Zis the value for which you want the distribution.
Triggerdependency tracking trigger

qlNormSInv

double returnValue
qlNormSInv(
double Probability
any Trigger)
Description:

Returns the inverse of the standard normal cumulative distribution (has a mean of zero and standard deviation of one).

Supported Platforms:

Excel

Parameters
Probabilityis a probability corresponding to the normal distribution, a number between 0 and 1 inclusive.
Triggerdependency tracking trigger

qlPrimeNumber

long returnValue
qlPrimeNumber(
long N
any Trigger)
Description:

returns the N-th prime number.

Supported Platforms:

Excel

Parameters
Nindex of the prime number (e.g N=2 returns 3).
Triggerdependency tracking trigger

qlPseudoSqrt

vector<vector<double> > returnValue
qlPseudoSqrt(
vector<vector<double> > Matrix
string SalvagingAlgorithm
any Trigger)
Description:

Returns the pseudo square root of a real symmetric matrix.

Supported Platforms:

Excel

Parameters
Matrixsymmetric matrix (hopefully positive semi-definite at least).
SalvagingAlgorithmSalvaging algorithm for symmetric matrix not positive semi-definite (None, Spectral).
Triggerdependency tracking trigger

qlRankReducedSqrt

vector<vector<double> > returnValue
qlRankReducedSqrt(
vector<vector<double> > Matrix
long MaxRank
double ComponentPercentage
string SalvagingAlgorithm
any Trigger)
Description:

Returns the rank reduced pseudo square root of a real symmetric matrix.

Supported Platforms:

Excel

Parameters
Matrixsymmetric matrix (hopefully positive semi-definite at least).
MaxRanknumber of principal components retained, i.e. max rank for the result matrix.
ComponentPercentageprincipal components retained as percentage of eigenvalues' sum.
SalvagingAlgorithmSalvaging algorithm for symmetric matrix not positive semi-definite (None, Spectral).
Triggerdependency tracking trigger

qlSymmetricSchurDecomposition

string returnValue
qlSymmetricSchurDecomposition(
string ObjectId
vector<vector<double> > SymmetricMatrix
bool Permanent
any Trigger
bool Overwrite)
Description:

Construct an object of class SymmetricSchurDecomposition and return its id

Supported Platforms:

Excel

Parameters
ObjectIdid of object to be created
SymmetricMatrixSymmetrix matrix to be decomposed.
Permanentobject permanent/nonpermanent
Triggerdependency tracking trigger
Overwriteoverwrite flag

qlSymmetricSchurDecompositionEigenvalues

vector<double> returnValue
qlSymmetricSchurDecompositionEigenvalues(
string ObjectId
any Trigger)
Description:

Returns the eigenvalues for the given SymmetricSchurDecomposition object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::SymmetricSchurDecomposition object
Triggerdependency tracking trigger

qlSymmetricSchurDecompositionEigenvectors

vector<vector<double> > returnValue
qlSymmetricSchurDecompositionEigenvectors(
string ObjectId
any Trigger)
Description:

Returns the eigenvectors for the given SymmetricSchurDecomposition object. Eigenvectors are returned columnwise.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::SymmetricSchurDecomposition object
Triggerdependency tracking trigger