

   TThhee SSttaabbllee DDiissttrriibbuuttiioonn

        dstable(x, loc=0, disp=1/sqrt(2), skew=0, tail=2, eps=1e-6)
        pstable(q, loc=0, disp=1/sqrt(2), skew=0, tail=2, eps=1e-6)
        qstable(p, loc=0, disp=1/sqrt(2), skew=0, tail=2, eps=1e-6)
        hstable(x, loc=0, disp=1/sqrt(2), skew=0, tail=2, eps=1e-6)
        rstable(n, loc=0, disp=1/sqrt(2), skew=0, tail=2, eps=1e-6)

   AArrgguummeennttss::

        y,q: vector of quantiles.

          p: vector of probabilites.

          n: number of observations.

        loc: vector of (real) location parameters.

       disp: vector of (positive) dispersion parameters.

       skew: vector of skewness parameters (in [-1,1]).

       tail: vector of parameters (in [0,2]) related to the
             tail thickness.

        eps: scalar giving the required precision in computa-
             tion.

   DDeessccrriippttiioonn::

        These functions provide information about the stable
        distribution with the location, the dispersion, the
        skewness and the tail thickness respectively modelled
        by the parameters `loc', `disp', `skew' and  `tail'.

        `dstable', `pstable', `qstable' and `hstable' compute
        the density, the distribution, the quantile and the
        hazard functions of a stable variate. `rstable' gener-
        ates random deviates with the prescribed stable distri-
        bution.

        `loc' is a location parameter in the same way as the
        mean in the normal distribution: it can take any real
        value.

        `disp' is a dispersion parameter in the same way as the
        standard deviation in the normal distribution: it can
        take any positive value.

        `skew' is a skewness parameter: it can take any value
        in (-1,1).  The distribution is right-skewed, symmetric
        and left-skewed when `skew' is negative, null or posi-
        tive respectively.

        `tail' is a tail parameter (often named the character-
        istic exponent): it can take any value in (0,2) (with
        `tail=1' and `tail=2' yielding the Cauchy and the nor-
        mal distributions respectively when symmetry holds).

        If `loc' or `disp' or `skew' or `tail' are not speci-
        fied they assume the default values of 0, 1/sqrt(2), 0
        and 2 respectively. This corresponds to a normal vari-
        ate with mean=0 and variance=1=2 disp^2.

        The stable characteristic function is given by

        phi(t) = i loc t - disp |t|^tail [1+i skew sign(t) omega(t,tail)]

        where

                     omega(t,tail) = (2/pi) log|t|

        when `tail=1', and

                   omega(t,tail) = tan(pi alpha / 2)

        otherwise.

        The characteristic function can be inverted using
        Fourier's transform to obtain the corresponding stable
        density. This inversion requires the numerical evalua-
        tion of an integral from 0 to infinity.  Two algorithms
        are proposed to do this. The default is the Romberg's
        method (`integration'="Romberg") which is used to eval-
        uate the integral with an error bounded by `eps'.  The
        alternative method is Simpson's integration (`integra-
        tion'="Simpson"): it approximates the integral from 0
        to infinity by an integral from 0 to `up' with `npt'
        points subdividing (O, up).  These three extra argu-
        ments - namely `integration', `up' and `npt' - are only
        available when using `dstable'.  The other functions
        are all based on Romberg's algorithm.

   AAuutthhoorr((ss))::

        Philippe Lambert (University of Liege, Belgium, plam-
        bert@ulg.ac.be) and Jim Lindsey.

   SSeeee AAllssoo::

        `stableglm' to fit generalized linear models for the
        stable distribution parameters.
        `stable.mode' to compute the mode of a stable distribu-
        tion.

   EExxaammpplleess::

        par(mfrow=c(2,2))
        x <- seq(-5,5,by=0.1)

        # Influence of loc (location)
        plot(x,dstable(x,loc=-2,disp=1/sqrt(2),skew=-0.8,tail=1.5),
          type="l",ylab="",title("Varying LOCation"))
        lines(x,dstable(x,loc=0,disp=1/sqrt(2),skew=-0.8,tail=1.5))
        lines(x,dstable(x,loc=2,disp=1/sqrt(2),skew=-0.8,tail=1.5))

        # Influence of disp (dispersion)
        plot(x,dstable(x,loc=0,disp=0.5,skew=0,tail=1.5),
          type="l",ylab="",title("Varying DISPersion"))
        lines(x,dstable(x,loc=0,disp=1/sqrt(2),skew=0,tail=1.5))
        lines(x,dstable(x,loc=0,disp=0.9,skew=0,tail=1.5))

        # Influence of skew (skewness)
        plot(x,dstable(x,loc=0,disp=1/sqrt(2),skew=-0.8,tail=1.5),
          type="l",ylab="",title("Varying SKEWness"))
        lines(x,dstable(x,loc=0,disp=1/sqrt(2),skew=0,tail=1.5))
        lines(x,dstable(x,loc=0,disp=1/sqrt(2),skew=0.8,tail=1.5))

        # Influence of tail (tail)
        plot(x,dstable(x,loc=0,disp=1/sqrt(2),skew=0,tail=0.8),
          type="l",ylab="",title("Varying TAIL thickness"))
        lines(x,dstable(x,loc=0,disp=1/sqrt(2),skew=0,tail=1.5))
        lines(x,dstable(x,loc=0,disp=1/sqrt(2),skew=0,tail=2))

