Statistics

Overview

functions to construct and use Statistics objects.

Function List

qlGaussianAverageShortfall ()
qlGaussianDownsideDeviation ()
qlGaussianDownsideVariance ()
qlGaussianExpectedShortfall ()
qlGaussianPercentile ()
qlGaussianPotentialUpside ()
qlGaussianRegret ()
qlGaussianShortfall ()
qlGaussianTopPercentile ()
qlGaussianValueAtRisk ()
qlIncrementalStatistics ()
qlStatistics ()
qlStatisticsAverageShortfall ()
qlStatisticsDownsideDeviation ()
qlStatisticsDownsideVariance ()
qlStatisticsErrorEstimate ()
qlStatisticsExpectedShortfall ()
qlStatisticsGaussianAverageShortfall ()
qlStatisticsGaussianDownsideDeviation ()
qlStatisticsGaussianDownsideVariance ()
qlStatisticsGaussianExpectedShortfall ()
qlStatisticsGaussianPercentile ()
qlStatisticsGaussianPotentialUpside ()
qlStatisticsGaussianRegret ()
qlStatisticsGaussianShortfall ()
qlStatisticsGaussianTopPercentile ()
qlStatisticsGaussianValueAtRisk ()
qlStatisticsKurtosis ()
qlStatisticsMax ()
qlStatisticsMean ()
qlStatisticsMin ()
qlStatisticsPercentile ()
qlStatisticsPotentialUpside ()
qlStatisticsRegret ()
qlStatisticsSamples ()
qlStatisticsSemiDeviation ()
qlStatisticsSemiVariance ()
qlStatisticsShortfall ()
qlStatisticsSkewness ()
qlStatisticsStandardDeviation ()
qlStatisticsTopPercentile ()
qlStatisticsValueAtRisk ()
qlStatisticsVariance ()
qlStatisticsWeightSum ()

Function Documentation

qlGaussianAverageShortfall

double returnValue
qlGaussianAverageShortfall(
double Target
double Mean
double StdDev
any Trigger)
Description:

Returns the averaged shortfallness.

Supported Platforms:

Excel

Parameters
Targetthe target.
MeanThe mean of the gaussian distribution. Default value = 0.0.
StdDevThe standard deviation of the gaussian distribution. Default value = 1.0.
Triggerdependency tracking trigger

qlGaussianDownsideDeviation

double returnValue
qlGaussianDownsideDeviation(
double Mean
double StdDev
any Trigger)
Description:

Returns the square root of the downside variance.

Supported Platforms:

Excel

Parameters
Meanmean of the gaussian distribution. Default value = 0.0.
StdDevstandard deviation of the gaussian distribution. Default value = 1.0.
Triggerdependency tracking trigger

qlGaussianDownsideVariance

double returnValue
qlGaussianDownsideVariance(
double Mean
double StdDev
any Trigger)
Description:

Returns the variance of observations below zero.

Supported Platforms:

Excel

Parameters
Meanthe mean of the gaussian distribution. Default value = 0.0.
StdDevstandard deviation of the gaussian distribution. Default value = 1.0.
Triggerdependency tracking trigger

qlGaussianExpectedShortfall

double returnValue
qlGaussianExpectedShortfall(
double Target
double Mean
double StdDev
any Trigger)
Description:

Returns the expected loss in case that the loss exceeded a VaR threshold.

Supported Platforms:

Excel

Parameters
Targetthe percentile.
MeanThe mean of the gaussian distribution. Default value = 0.0.
StdDevThe standard deviation of the gaussian distribution. Default value = 1.0.
Triggerdependency tracking trigger

qlGaussianPercentile

double returnValue
qlGaussianPercentile(
double X
double Mean
double StdDev
any Trigger)
Description:

Returns the x-th percentile.

Supported Platforms:

Excel

Parameters
Xthe percentile.
Meanmean of the gaussian distribution. Default value = 0.0.
StdDevstandard deviation of the gaussian distribution. Default value = 1.0.
Triggerdependency tracking trigger

qlGaussianPotentialUpside

double returnValue
qlGaussianPotentialUpside(
double Target
double Mean
double StdDev
any Trigger)
Description:

Returns the reciprocal of VAR at a given percentile.

Supported Platforms:

Excel

Parameters
Targetthe percentile.
MeanThe mean of the gaussian distribution. Default value = 0.0.
StdDevThe standard deviation of the gaussian distribution. Default value = 1.0.
Triggerdependency tracking trigger

qlGaussianRegret

double returnValue
qlGaussianRegret(
double Target
double Mean
double StdDev
any Trigger)
Description:

Returns the variance of observations below target.

Supported Platforms:

Excel

Parameters
Targetthe target.
Meanmean of the gaussian distribution. Default value = 0.0.
StdDevstandard deviation of the gaussian distribution. Default value = 1.0.
Triggerdependency tracking trigger

qlGaussianShortfall

double returnValue
qlGaussianShortfall(
double Target
double Mean
double StdDev
any Trigger)
Description:

Returns the probability of missing the given target.

Supported Platforms:

Excel

Parameters
Targetthe target.
MeanThe mean of the gaussian distribution. Default value = 0.0.
StdDevThe standard deviation of the gaussian distribution. Default value = 1.0.
Triggerdependency tracking trigger

qlGaussianTopPercentile

double returnValue
qlGaussianTopPercentile(
double X
double Mean
double StdDev
any Trigger)
Description:

Returns the x-th top percentile.

Supported Platforms:

Excel

Parameters
Xthe percentile.
MeanThe mean of the gaussian distribution. Default value = 0.0.
StdDevThe standard deviation of the gaussian distribution. Default value = 1.0.
Triggerdependency tracking trigger

qlGaussianValueAtRisk

double returnValue
qlGaussianValueAtRisk(
double Target
double Mean
double StdDev
any Trigger)
Description:

Returns the value-at-risk at a given percentile.

Supported Platforms:

Excel

Parameters
Targetthe percentile.
MeanThe mean of the gaussian distribution. Default value = 0.0.
StdDevThe standard deviation of the gaussian distribution. Default value = 1.0.
Triggerdependency tracking trigger

qlIncrementalStatistics

string returnValue
qlIncrementalStatistics(
string ObjectId
vector<double> Values
vector<double> Weights
bool Permanent
any Trigger
bool Overwrite)
Description:

Statistics and risk measures tool.

Supported Platforms:

Excel, C++

Parameters
ObjectIdid of object to be created
ValuesSampled values. If omitted, an empty statistics is created. Default value = std::vector<QuantLib::Real>().
WeightsWeights. If omitted, all sampled values have the same weight. Default value = std::vector<QuantLib::Real>().
Permanentobject permanent/nonpermanent
Triggerdependency tracking trigger
Overwriteoverwrite flag

qlStatistics

string returnValue
qlStatistics(
string ObjectId
vector<double> Values
vector<double> Weights
bool Permanent
any Trigger
bool Overwrite)
Description:

Statistics and risk measures tool.

Supported Platforms:

Excel, C++

Parameters
ObjectIdid of object to be created
ValuesSampled values. If omitted, an empty statistics is created. Default value = std::vector<QuantLib::Real>().
WeightsWeights. If omitted, all sampled values have the same weight. Default value = std::vector<QuantLib::Real>().
Permanentobject permanent/nonpermanent
Triggerdependency tracking trigger
Overwriteoverwrite flag

qlStatisticsAverageShortfall

double returnValue
qlStatisticsAverageShortfall(
string ObjectId
double Target
any Trigger)
Description:

Returns the averaged shortfallness for the given Statistics object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Statistics object
Targetthe target.
Triggerdependency tracking trigger

qlStatisticsDownsideDeviation

double returnValue
qlStatisticsDownsideDeviation(
string ObjectId
any Trigger)
Description:

Returns the square root of the downside variance for the given Statistics object.

Supported Platforms:

Excel

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

qlStatisticsDownsideVariance

double returnValue
qlStatisticsDownsideVariance(
string ObjectId
any Trigger)
Description:

Returns the variance of observations below zero for the given Statistics object.

Supported Platforms:

Excel

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

qlStatisticsErrorEstimate

double returnValue
qlStatisticsErrorEstimate(
string ObjectId
any Trigger)
Description:

Returns the error estimate on the mean value for the given Statistics object.

Supported Platforms:

Excel

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

qlStatisticsExpectedShortfall

double returnValue
qlStatisticsExpectedShortfall(
string ObjectId
double Centile
any Trigger)
Description:

Returns the expected loss in case that the loss exceeded a VaR threshold for the given Statistics object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Statistics object
Centilethe centile.
Triggerdependency tracking trigger

qlStatisticsGaussianAverageShortfall

double returnValue
qlStatisticsGaussianAverageShortfall(
string ObjectId
double Target
any Trigger)
Description:

Returns the averaged shortfallness for the given Statistics object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Statistics object
Targetthe target.
Triggerdependency tracking trigger

qlStatisticsGaussianDownsideDeviation

double returnValue
qlStatisticsGaussianDownsideDeviation(
string ObjectId
any Trigger)
Description:

Returns the square root of the downside variance for the given Statistics object.

Supported Platforms:

Excel

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

qlStatisticsGaussianDownsideVariance

double returnValue
qlStatisticsGaussianDownsideVariance(
string ObjectId
any Trigger)
Description:

Returns the variance of observations below zero for the given Statistics object.

Supported Platforms:

Excel

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

qlStatisticsGaussianExpectedShortfall

double returnValue
qlStatisticsGaussianExpectedShortfall(
string ObjectId
double Target
any Trigger)
Description:

Returns the expected loss in case that the loss exceeded a VaR threshold for the given Statistics object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Statistics object
Targetthe percentile.
Triggerdependency tracking trigger

qlStatisticsGaussianPercentile

double returnValue
qlStatisticsGaussianPercentile(
string ObjectId
double X
any Trigger)
Description:

Returns the x-th percentile for the given Statistics object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Statistics object
XMust be in the range (0,1].
Triggerdependency tracking trigger

qlStatisticsGaussianPotentialUpside

double returnValue
qlStatisticsGaussianPotentialUpside(
string ObjectId
double Target
any Trigger)
Description:

Returns the reciprocal of VAR at a given percentile for the given Statistics object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Statistics object
Targetthe percentile.
Triggerdependency tracking trigger

qlStatisticsGaussianRegret

double returnValue
qlStatisticsGaussianRegret(
string ObjectId
double Target
any Trigger)
Description:

Returns the variance of observations below the target for the given Statistics object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Statistics object
Targetthe target.
Triggerdependency tracking trigger

qlStatisticsGaussianShortfall

double returnValue
qlStatisticsGaussianShortfall(
string ObjectId
double Target
any Trigger)
Description:

Returns the probability of missing the given target for the given Statistics object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Statistics object
Targetthe target.
Triggerdependency tracking trigger

qlStatisticsGaussianTopPercentile

double returnValue
qlStatisticsGaussianTopPercentile(
string ObjectId
double X
any Trigger)
Description:

Returns the x-th top percentile for the given Statistics object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Statistics object
XMust be in the range (0,1].
Triggerdependency tracking trigger

qlStatisticsGaussianValueAtRisk

double returnValue
qlStatisticsGaussianValueAtRisk(
string ObjectId
double Target
any Trigger)
Description:

Returns the value-at-risk at a given percentile for the given Statistics object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Statistics object
Targetthe percentile.
Triggerdependency tracking trigger

qlStatisticsKurtosis

double returnValue
qlStatisticsKurtosis(
string ObjectId
any Trigger)
Description:

Returns the excess kurtosis for the given Statistics object.

Supported Platforms:

Excel

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

qlStatisticsMax

double returnValue
qlStatisticsMax(
string ObjectId
any Trigger)
Description:

Returns the maximum sample value for the given Statistics object.

Supported Platforms:

Excel

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

qlStatisticsMean

double returnValue
qlStatisticsMean(
string ObjectId
any Trigger)
Description:

Returns the mean for the given Statistics object.

Supported Platforms:

Excel

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

qlStatisticsMin

double returnValue
qlStatisticsMin(
string ObjectId
any Trigger)
Description:

Returns the minimum sample value for the given Statistics object.

Supported Platforms:

Excel

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

qlStatisticsPercentile

double returnValue
qlStatisticsPercentile(
string ObjectId
double X
any Trigger)
Description:

Returns the x-th percentile for the given Statistics object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Statistics object
XMust be in the range (0,1].
Triggerdependency tracking trigger

qlStatisticsPotentialUpside

double returnValue
qlStatisticsPotentialUpside(
string ObjectId
double Centile
any Trigger)
Description:

Returns the reciprocal of VAR at a given percentile for the given Statistics object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Statistics object
Centilethe centile.
Triggerdependency tracking trigger

qlStatisticsRegret

double returnValue
qlStatisticsRegret(
string ObjectId
double Target
any Trigger)
Description:

Returns the variance of observations below target for the given Statistics object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Statistics object
Targetthe target.
Triggerdependency tracking trigger

qlStatisticsSamples

long returnValue
qlStatisticsSamples(
string ObjectId
any Trigger)
Description:

Returns the number of samples collected for the given Statistics object.

Supported Platforms:

Excel

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

qlStatisticsSemiDeviation

double returnValue
qlStatisticsSemiDeviation(
string ObjectId
any Trigger)
Description:

Returns the square root of the semivariance for the given Statistics object.

Supported Platforms:

Excel

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

qlStatisticsSemiVariance

double returnValue
qlStatisticsSemiVariance(
string ObjectId
any Trigger)
Description:

Returns the variance of observations below the mean for the given Statistics object.

Supported Platforms:

Excel

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

qlStatisticsShortfall

double returnValue
qlStatisticsShortfall(
string ObjectId
double Target
any Trigger)
Description:

Returns the probability of missing the given target for the given Statistics object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Statistics object
Targetthe target.
Triggerdependency tracking trigger

qlStatisticsSkewness

double returnValue
qlStatisticsSkewness(
string ObjectId
any Trigger)
Description:

Returns the skewness for the given Statistics object.

Supported Platforms:

Excel

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

qlStatisticsStandardDeviation

double returnValue
qlStatisticsStandardDeviation(
string ObjectId
any Trigger)
Description:

Returns the the standard deviation for the given Statistics object.

Supported Platforms:

Excel

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

qlStatisticsTopPercentile

double returnValue
qlStatisticsTopPercentile(
string ObjectId
double X
any Trigger)
Description:

Returns the x-th top percentile for the given Statistics object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Statistics object
XMust be in the range (0,1].
Triggerdependency tracking trigger

qlStatisticsValueAtRisk

double returnValue
qlStatisticsValueAtRisk(
string ObjectId
double Target
any Trigger)
Description:

Returns the value-at-risk at a given percentile for the given Statistics object.

Supported Platforms:

Excel

Parameters
ObjectIdid of existing QuantLib::Statistics object
Targetthe percentile.
Triggerdependency tracking trigger

qlStatisticsVariance

double returnValue
qlStatisticsVariance(
string ObjectId
any Trigger)
Description:

Returns the variance for the given Statistics object.

Supported Platforms:

Excel

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

qlStatisticsWeightSum

double returnValue
qlStatisticsWeightSum(
string ObjectId
any Trigger)
Description:

Returns the sum of data weights for the given Statistics object.

Supported Platforms:

Excel

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