Site menu:
R functions for the tempered stable distribution
This page provides R functions for the tempered stable distribution [Ref 1] using the parametrisation and numerical methods described by [Ref 2]. These programs were mostly written by Karen Palmer, who completed her PhD on Stochastic Models for Cell Biology at Kent in 2009, supervised by Byron Morgan. and myself.
The functions available are:
dts(x, param)pts(x, param)
qts(x, param, lower = 1/10000, upper = 10000)
rts(n, param)
These provide, respectively, the probability density function, the cumulative distribution function, the quantile function and a random number generator. For the quantile function, lower and upper should be set to values below and above the true quantile; the default values will suffice for most examples.
The argument param is a vector of length 3, giving the mean, coefficient of variation, and further parameter alpha (0 < alpha < 1) of the distribution. For details on this parametrisation, see [Ref 2]. The gamma distribution is the limiting distribution as alpha tends to zero and alpha = 1/2 gives the inverse Gaussian distribution.
These functions rely on numerical inversion of the Laplace transform of the p.d.f. or c.d.f. of the tempered stable distribution, using the method described in [Ref 3]. Generally this gives very accurate results, except sometimes in the extreme tails of the distribution, where the rescaling method outlined in [Ref 4] can give substantially improved accuracy. For further discussion of accuracy and of alternative numerical approaches, see [Ref 2].
To use the software, you will need to download the file TSfunctions.R into a suitable directory on your computer. This contains the functions listed above and various supporting functions. You should not need to look at the R code in this file unless you want to see the details of what's going on. The file TSscript.R gives examples of usage.
References
[1] Hougaard, P. (1986). Survival models for heterogeneous populations derived from stable distributions. Biometrika, 73, 387-396. doi: 10.1093/biomet/73.2.387
[2] Palmer, K.J., Ridout, M.S. and Morgan, B.J.T. (2008).
Modelling cell generation times using the tempered
stable distribution.
Journal of the Royal Statistical Society Series C, 57, 379-397.
doi: 10.1111/j.1467-9876.2008.00625.x
[3] Abate, J., Choudhury, G.L. and Whitt, W. (1999). An introduction to numerical transform inversion and its application to probability models. In Computational Probability (ed. W. Grassmann), pp. 257-323. Boston: Kluwer. [Publisher link]
[4] Choudhury, G.L. and Whitt, W. (1997). Probabilistic scaling for the numerical inversion of nonprobability transforms. INFORMS Journal on Computing, 9, 175-184. doi: 10.1287/ijoc.9.2.175