QuantLib: CumulativeBehrensFisher Class Reference

A free/open-source library for quantitative finance Reference manual - version 1.12

Public Types | Public Member Functions | List of all members
CumulativeBehrensFisher Class Reference

Cumulative (generalized) BehrensFisher distribution. More...

`#include <ql/experimental/math/convolvedstudentt.hpp>`

Inherits unary_function< Real, Probability >.

## Public Types
typedef Probability | result_type
typedef Real | argument_type

## Public Member Functions
| CumulativeBehrensFisher (const std::vector< Integer > &degreesFreedom=std::vector< Integer >(), const std::vector< Real > &factors=std::vector< Real >())
const std::vector< Integer > & | degreeFreedom () const
| Degrees of freedom of the Ts involved in the convolution.
const std::vector< Real > & | factors () const
| Factors in the linear combination.
Probability | operator() (const Real x) const
| Returns the cumulative probability of the resulting distribution. More...
Probability | density (const Real x) const
| Returns the probability density of the resulting distribution. More...

## Detailed Description

Cumulative (generalized) BehrensFisher distribution.

Exact analitical computation of the cumulative probability distribution of the linear combination of an arbitrary number (not just two) of T random variables of odd integer order. Adapted from the algorithm in:

  V. Witkovsky, Journal of Statistical Planning and Inference 94 (2001) 1-13

  see also:

  On the distribution of a linear combination of t-distributed variables; Glenn Alan Walker, Ph.D.thesis University of Florida 1977

  'Convolutions of the T Distribution'; S. Nadarajah, D. K. Dey in Computers and Mathematics with Applications 49 (2005) 715-721

  The last reference provides direct expressions for some of the densities when the linear combination of only two Ts is just an addition. It can be used for testing the results here.

  Another available test on this algorithm stems from the realization that a linear convex ( \( \sum a_i=1\)) combination of Ts of order one is stable in the distribution sense (but this result is often of no practical use because of its non-finite variance).

  This implementation is for two or more T variables in the linear combination albeit these must be of odd order. The case of exactly two T of odd order is known to be a finite mixture of Ts but that result is not used here. On this line see 'Linearization coefficients of Bessel polynomials' C.Berg, C.Vignat; February 2008; arXiv:math/0506458

## Constructor & Destructor Documentation

## ◆ CumulativeBehrensFisher()

CumulativeBehrensFisher | ( | const std::vector< Integer > & | degreesFreedom = `std::vector< Integer >()`,
|  | const std::vector< Real > & | factors = `std::vector< Real >()`
| ) |  |

Parameters

  degreesFreedom | Degrees of freedom of the Ts convolved. The algorithm is limited to odd orders only.
  factors | Factors in the linear combination of the Ts.

## Member Function Documentation

## ◆ operator()()

Probability operator() | ( | const Real | x | ) | const

Returns the cumulative probability of the resulting distribution.

  To obtain the cumulative probability the Gil-Pelaez theorem is applied:

  First compute the characteristic function of the linear combination variable by multiplying the individual characteristic functions. Then transform back integrating the characteristic function according to the GP theorem; this is done here analytically feeding in the expression of the total characteristic function this:

  \[ \int_0^{\infty}x^n e^{-ax}sin(bx)dx = (-1)^n \Gamma(n+1) \frac{sin((n+1)arctg2(-b/a))} {(\sqrt{a^2+b^2})^{n+1}}; for\,a>0,\,b>0 \]

  and for the first term I use:

  \[ \int_0^{\infty} \frac{e^{-ax}sin(bx)}{x} dx = arctg2(b/a) \]

  The GP complex integration is simplified thanks to the symetry of the distribution.

## ◆ density()

Probability density | ( | const Real | x | ) | const

Returns the probability density of the resulting distribution.

  Similarly to the cumulative probability, Gil-Pelaez theorem is applied, the integration is similar.