dhyperb            package:HyperbolicDist            R Documentation

_H_y_p_e_r_b_o_l_i_c _D_i_s_t_r_i_b_u_t_i_o_n

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

     Density function, distribution function, quantiles and  random
     number generation for the hyperbolic distribution  with parameter
     vector 'theta'.

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

     dhyperb(x, theta, K.nu=NULL, log.pars=FALSE)
     phyperb(q, theta, tol=10^(-5), subdivisions=100)
     qhyperb(p, theta, tol=10^(-5), n.interpol=100, subdivisions=100, ...)
     rhyperb(n, theta)

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

     x,q: vector of quantiles

       p: vector of probabilities

       n: number of observations to be generated

   theta: parameter vector taking the form 'c(pi,zeta,delta,mu)'

    K.nu: sets the value of the Bessel function in the density.  See
          *Details*

log.pars: logical; if 'TRUE' the second and third components  of theta
          are taken to be log(zeta) and log(delta) respectively

     tol: an upper bound on the error in the distribution function. 
          See *Details*

subdivisions: the maximum number of subdivisions used to integrate  the
          density returning the distribution function

n.interpol: the number of points used in qhyperb for cubic spline 
          interpolation (see 'splinefun') of the distribution function

     ...: passes arguments to 'uniroot'.  See *Details*

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

     The hyperbolic distribution has density


 f(x)=1/(2 sqrt(1+pi^2) K_1(zeta))  exp(-zeta(sqrt(1+pi^2) sqrt(1+((x-mu)/delta)^2)-pi (x-mu)/delta))


     where 

                                K_1()

     is the modified Bessel function of the  third kind with order 1.

     A succinct description of the hyperbolic distribution is given in
     Barndorff-Nielsen and Blaesild (1983). Three different possible
     parameterisations are described in that paper. All use location
     and scale parameters mu and delta. There are two other parameters
     in each case.

     Use 'hyperb.change.pars' to convert from the alpha/beta or
     phi/gamma  parameterisations to the parameterisation (pi/zeta)
     used above.

     'phyperb' uses a numerical integration routine ('integrate()')  to
     integrate the density 'dhyperb'.  See the notes on 'integrate' 
     for the shortfalls of this procedure.  In particular note the
     weakness of  this function when integrating over a region that is
     approximately zero.

     'qhyperb' uses 'splinefun' on values generated by 'pyhyperb'  to
     approximate the distribution function.  The quantiles are then
     found  using the 'uniroot' function.

     'rhyperb' is based on the HYP algorithm given by Atkinson (1982).

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

     'dhyperb' gives the density, 'phyperb' gives the distribution 
     function, 'qhyperb' gives the quantile function and 'rhyperb' 
     generates random variates.

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

     David Scott d.scott@auckland.ac.nz,  Ai-Wei Lee, Jennifer Tso,
     Richard Trendall

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

     Atkinson, A.C. (1982).  The simulation of generalized inverse
     Gaussian and hyperbolic random variables.  _SIAM J. Sci. Stat.
     Comput._,  *3*, 502-515.

     Barndorff-Nielsen, O. and Blaesild, P (1983). Hyperbolic
     distributions.  In _Encyclopedia of Statistical Sciences_,  eds.,
     Johnson, N. L., Kotz, S. and Read, C. B., Vol. 3, pp. 700-707. New
     York: Wiley.

_S_e_e _A_l_s_o:

     'integrate' for its shortfalls, 'splinefun',  'uniroot' and
     'hyperb.change.pars' for  changing parameters to the pi/zeta
     parameterisation

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

     theta <- c(0,1,1,0)
     data.vector <- rhyperb(500,theta)
     par(mfrow=c(1,2))
     hist(data.vector,freq=FALSE)
     curve(dhyperb(x,theta),add=TRUE,
           range(data.vector)[1],range(data.vector)[2])
     log.hist(data.vector)
     curve(log(dhyperb(x,theta)),add=TRUE,
           range(data.vector)[1],range(data.vector)[2])
     hyperb.range <- calculate.range(c(0,1,1,0),tol=10^(-2))
     curve(dhyperb(x,theta),
           hyperb.range[1],hyperb.range[2],log="")
     title("Density of the\n Hyperbolic Distribution")
     curve(phyperb(x,theta),
           hyperb.range[1],hyperb.range[2],log="")
     title("Distribution Function of the\n Hyperbolic Distribution")

