Menu

Home

Tomy Duby

Tail Probability Calculator, version 2.0

Introduction

This suite of Matlab functions calculates to high precision the

  • tail probability, TP;
  • cumulative distribution function, CDF (CDF = 1 - TP);
  • probability density function, PDF;
  • quantiles

of linear combination of continuous random variables (RV) belonging to one of the following classes:

  1. random variables with support (that is: defined) on the whole real axis (normal, Student's t, uniform and triangular RV);
  2. random variables with support on the positive real axis (chi-squared {central and non-central}, standard and non-standard log-Lambert W x chi-squared and inverse gamma {temporarily disabled} RV)

Motivation

Why Tail Probability Calculator

For Symmetric Random Variables

The science of metrology deals with the following situation: a physical quantity is measured by two or more measuring devices. The uncertainty of these devices has know statistical properties.

For random variables with support on positive real axis

Linear combination of chi-squared RVs

This situation occurs when computing the distribution of quadratic forms in normal variables. Imhof (1961) used a non-singular linear transformation to transform this quadratic form into a linear combination of non-central chi-squared RV. Davies (1980) proposed an efficient algorithm for calculating this linear combination. This software package improves the calculation method proposed by Davies (1980) using a fast convergent numerical method for oscillatory integrals (Sidi (1982)).

There is a modern application of calculating the distribution of linear combination of chi-squared RV, namely in genetic research the sequence kernel association test (SKAT) is a flexible, computationally efficient, regression approach that tests for association between variants in a region (both common and rare) and a dichotomous (e.g., case-control) or continuous phenotype while adjusting for covariates, such as principal components, to account for population stratification, Wu (2011).

Standard log-Lambert W x chi-squared RV

Standard log-Lambert W x chi-squared RV appears in the distribution of likehood ratio test, LRT, for testing a single variance component, Witkovsky et al (2015).

Sum of chi-squared RV and a standard log-Lambert W x chi-squared RVs

Distribution of the likehood ratio test, LRT, statistic (under H_0) for testing of normal linear regression model parameters requires sum of chi-squared and log-Lambert W x chi-squared RV, see section 4.2 in Witkovsky et al. (2015).

Linear combination chi-squared and standard log-Lambert W x chi-squared RVs

Distribution of the LRT statistic (under H_0) for testing canonical variance components leads to a linear combination of RV with standard log-Lambert W x chi-squared distributions, see section 4.3 in Witkovsky et al (2015).

Why the use of Characteristic Functions?

Characteristic functions are used in these calculations. One of the properties of characteristic functions is that that they enable to calculate CDF and PDF of a linear combination of RVs whose characteristic functions are known. For more information see
characteristic functions: Properties.

For tail probability and CDF calculation the Gil-Pelaez inversion formula is used, see Gil-Pelaez (1951) below. For pdf calculation simple inverse Fourier transform is used.

Why the division of random variables into classes

Treba pridat text

Top Level Matlab Function

TPC is the top level function that the average user is likely to use:

  • When invoked with no command line arguments it calls function TPC_10 that starts the Graphical User Interface (GUI) of the Tail Probability Calculator;
  • When invoked with proper arguments it calls function TPC_20 to start the command line interface of the Tail Probability Calculator.

Random Variables and their Characteristic Functions Covered in this Package

In alphabetic order:

  • [cf_chi2] ... returns the characteristic function of chi-squared distribution
  • [cf_IGamma] ... returns the characteristic function of inverse gamma distribution -- temporarily disabled due to numerical issues.
  • [cf_LWchi2] ... returns the characteristic function of log-Lambert W x chi^2 or standard log-Lambert W x chi^2 distribution. Added in version 2.0. For more information see Witkovsky et al (2015).
  • [cf_normal] ... returns the characteristic function of normal distribution
  • [cf_t] ... returns the characteristic function Student's t distribution
  • [cf_triangular] ... returns the characteristic function of triangular distribution
  • [cf_uniform] ... returns the characteristic function of uniform distribution

It is possible to build linear combinations of RV belonging to the same class.

Installation

  • Copy the downloaded Matlab files into a new folder on your computer.
  • Make sure that this folder is on your Matlab path (use Matlab function addpath to add this folder to your current path).

Guide How to Run the Tail Probability Calculator (TPC)

Numerical Methods Used in the Tail Probability Calculator

For details see [TPC Numerical Methods].

References

  1. Davies (1980): R B Davies Algorithm AS 155: The Distribution of a Linear Combination of chi^2 Random Variables, Applied Statistics, 29, 323--333 (1980).
  2. Gil-Pelaez (1951): J Gil-Pelaez, Note on the Inversion Theorem, Biometrika, 38(3/4) 481--482, (1951).
  3. Imhof (1961): J P Imhof, Computing the distribution of quadratic forms in normal variables, Biometrika, 48(3/4), 419--426 (1961).
  4. Sidi (1982): A Sidi, The numerical evaluation of very oscillatory infinite integrals by extrapolation, Mathematics of Computation, 38(158) 517--529 (1982).
  5. Witkovsky et al. (2015): V Witkovsky, G Wimmer and T Duby, Logarithmic Lambert W x F random variables for the family of chi-squared distributions and their applications, Statistics & Probability Letters, 96, 223--231 (2015), DOI: 10.1016/j.spl.2014.09.028, http://www.sciencedirect.com/science/article/pii/S0167715214003484
  6. Wu (2011): M C Wu, Rare-Variant Association Testing for Sequencing Data with the Sequence Kernel Association Test, Am J Hum Genet. 89(1), 82–93, (Jul 15, 2011), doi: 10.1016/j.ajhg.2011.05.029, PMCID: PMC3135811.

Project Members:


Related

Wiki: Function TPC_10
Wiki: Function TPC_20
Wiki: TPC Numerical Methods
Wiki: cf_IGamma
Wiki: cf_LWchi2
Wiki: cf_chi2
Wiki: cf_normal
Wiki: cf_t
Wiki: cf_triangular
Wiki: cf_uniform

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.