Computation of Stable Distributions
Introduction
The program has been updated for Mathematica 6.0; the earlier version will no longer be supported. I have made a deliberate effort to make it consistent with the nomenclature in John Nolan's Stable Distributions: Models for Heavy Tailed Data. I have also tried to keep it consistent with his MathLink and matlab STABLE programs. The function names are selected so that both the MathLink and this program can be run simultaneously. But there are some important differences. In order to take advantage of Mathematica's capabilities I have restricted input to a single parameter rather than a list of parameters. This strategy permits calculations like the above graph which plots a S(1.3, 1.0, 1.0, 0; 0) distribution, density and the first two derivatives of the density. The derivatives are computed from the density algorithm despite the fact that it is using NIntegrate. Mathematica complains with error messages about this but does the job nevertheless. The error messages are easily suppressed with the new function, Quiet.
The calculation of stable functions is difficult. The integral functions use NIntegrate, which is more complicated in version 6.0; it is slower in some cases with default settings, but also it is more accurate. The functions that use NIntegrate, {SCDF, SPDF, SQuantile, SMode, D1SPDF}, will take Options to be passed to NIntegrate. NIntegrate has one option reset for the program: Method → {Automatic, "SymbolicProcessing" → 0}. It is not likely that Mathematica can improve on the integrals by preprocessing and this change of setting greatly improves speed. There is a function ResetNInt which can be called without any arguments. It will reset the NIntegrate to the options it had when the program was started.
There is only limited error checking. I assume the user understands stable distributions and knows what he is doing. The code is now open source with the hope of expanding the use of stable distributions. A good understanding of stable distributions is assumed. John Nolan's website is an excellent resource and has an extensive stable bibliography.
The code is copyrighted and a license for commercial use may be obtained from me. The program may be used freely for non-commercial and educational purposes. This program is provided without warranty of any kind. It is intended more as a research tool than a package for data analysis. John Nolan has an excellent MathLink program available that can be used for data analysis. His program uses compiled code and is very much faster for most operations. On the other hand, the Mathematica code can be used for extremely accurate results. But this requires some playing with the options for functions.
This version is a complete rewrite of the previous program and is not likely free of errors. I would appreciate notification of them in the form of a succinct Mathematica notebook demonstrating the problem. I would also appreciate comments and criticism as well as suggestions for enhancements. The code is also designed so you can add your own, and I would appreciate receiving any that users might be willing to share freely.
Many thanks to John Nolan for tutoring me in mathematical statistics via email over the last six years.
Star Valley, Arizona
December, 2007
© Copyright 2007 mathestate Fri 14 Dec 2007