StableDistribution          package:fBasics          R Documentation

_S_t_a_b_l_e _D_i_s_t_r_i_b_u_t_i_o_n _F_u_n_c_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     A collection and description of functions to compute  density,
     distribution function, quantile function and  to generate random
     variates, the stable distribution, and the stable mode.  

     The functions are:

       '[dpqr]stable'  the skewed stable distribution,
       'stableMode'    the stable mode,
       'stableSlider'  interactive stable distribution display.

_U_s_a_g_e:

     dstable(x, alpha, beta, gamma = 1, delta = 0, pm = c(0, 1, 2))
     pstable(q, alpha, beta, gamma = 1, delta = 0, pm = c(0, 1, 2))
     qstable(p, alpha, beta, gamma = 1, delta = 0, pm = c(0, 1, 2))
     rstable(n, alpha, beta, gamma = 1, delta = 0, pm = c(0, 1, 2))

     stableMode(alpha, beta)

     stableSlider()

_A_r_g_u_m_e_n_t_s:

alpha, beta, gamma, delta: value of the index parameter 'alpha' with
          'alpha = (0,2]'; skewness parameter 'beta', in the range [-1,
          1]; scale parameter 'gamma'; and shift parameter 'delta'. 

       n: number of observations, an integer value. 

       p: a numeric vector of probabilities. 

      pm: parameterization, an integer value by default 'pm=0',  the
          'S0' parameterization. 

    x, q: a numeric vector of quantiles. 

_D_e_t_a_i_l_s:

     *Skew Stable Distribution:* 

      The function uses the approach of J.P. Nolan for general  stable
     distributions. Nolan derived expressions in form of  integrals
     based on the charcteristic function for standardized  stable
     random variables. These integrals are numerically  evaluated using
     R's function 'integrate'.  
      "S0" parameterization [pm=0]: based on the (M) representation of
     Zolotarev for an alpha stable distribution with skewness beta.
     Unlike the Zolotarev (M) parameterization, gamma and  delta are
     straightforward scale and shift parameters. This representation is
     continuous in all 4 parameters, and gives  an intuitive meaning to
     gamma and delta that is lacking in  other parameterizations. 
      "S" or "S1" parameterization [pm=1]: the parameterization used 
     by Samorodnitsky and Taqqu in the book Stable Non-Gaussian  Random
     Processes. It is a slight modification of Zolotarev's  (A)
     parameterization. 
      "S*" or "S2" parameterization [pm=2]: a modification of the S0 
     parameterization which is defined so that (i) the scale gamma 
     agrees with the Gaussian scale (standard dev.) when alpha=2  and
     the Cauchy scale when alpha=1, (ii) the mode is exactly at  delta. 
      "S3" parameterization [pm=3]: an internal parameterization. The 
     scale is the same as the S2 parameterization, the shift is 
     -beta*g(alpha), where g(alpha) is defined in  Nolan [1999].

_V_a_l_u_e:

     All values for the '*stable' functions are numeric vectors:  'd*'
     returns the density,  'p*' returns the distribution function, 
     'q*' returns the quantile function, and 'r*' generates random
     deviates.

     The function 'stableMode' returns a numeric value, the location of
     the stable mode.

     The function 'stableSlider'  displays for educational purposes the
     densities and probabilities of the skew stable distribution.

_A_u_t_h_o_r(_s):

     Diethelm Wuertz for the Rmetrics R-port.

_R_e_f_e_r_e_n_c_e_s:

     Chambers J.M., Mallows, C.L. and Stuck, B.W. (1976); _A Method for
     Simulating Stable Random Variables_, J. Amer. Statist. Assoc. 71,
     340-344.

     Nolan J.P. (1999); _Stable Distributions_, Preprint, University
     Washington DC, 30 pages.

     Nolan J.P. (1999); _Numerical Calculation of Stable Densities and
     Distribution Functions_, Preprint, University Washington DC, 16
     pages.

     Samoridnitsky G., Taqqu M.S. (1994); _Stable Non-Gaussian Random
     Processes, Stochastic Models with Infinite Variance_, Chapman and
     Hall, New York, 632 pages.

     Weron, A., Weron R. (1999); _Computer Simulation of Levy
     alpha-Stable Variables and Processes_, Preprint Technical
     Univeristy of Wroclaw, 13 pages.

_E_x_a_m_p_l_e_s:

         
     ## stable - 
        # Plot rvs Series
        set.seed(1953)
        r = rstable(n = 1000, alpha = 1.9, beta = 0.3)
        plot(r, type = "l", main = "stable: alpha=1.9 beta=0.3", 
          col = "steelblue")
        grid()
      
     ## stable -  
        # Plot empirical density and compare with true density:
        hist(r, n = 25, probability = TRUE, border = "white", 
          col = "steelblue")
        x = seq(-5, 5, 0.4)
        lines(x, dstable(x = x, alpha = 1.9, beta = 0.3))
        
     ## stable -   
        # Plot df and compare with true df:
        plot(sort(r), (1:1000/1000), main = "Probability", pch = 19, 
          col = "steelblue")
        lines(x, pstable(q = x, alpha = 1.9, beta = 0.3))
        grid()
        
     ## stable -
        # Compute quantiles:
        qstable(pstable(seq(-4, 4, 1), alpha = 1.9, beta = 0.3), 
          alpha = 1.9, beta = 0.3) 

