gig-distribution            package:ghyp            R Documentation

_T_h_e _G_e_n_e_r_a_l_i_z_e_d _I_n_v_e_r_s_e _G_a_u_s_s_i_a_n _D_i_s_t_r_i_b_u_t_i_o_n

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

     Density, distribution function, quantile function, random
     generation, expected shortfall and expected value and variance 
     for the generalized inverse gaussian distribution.

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

     dgig(x, lambda = 1, chi = 1, psi = 1, logvalue = F)

     pgig(q, lambda = 1, chi = 1, psi = 1, ...)

     qgig(p, lambda = 1, chi = 1, psi = 1, method = c("integration", "splines"), 
          spline.points = 200, subdivisions = 200, 
          root.tol = .Machine$double.eps^0.5, 
          rel.tol = root.tol^1.5, abs.tol = rel.tol, ...)
          
     rgig(n = 10, lambda = 1, chi = 1, psi = 1, envplot = F, messages = F)

     ESgig(p, lambda = 1, chi = 1, psi = 1, ...)

     Egig(lambda, chi, psi, func = c("x", "logx", "1/x", "var"), check.pars = T)

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

       x: A vector of quantiles.

       q: A vector of quantiles.

       p: A vector of probabilities.

       n: Number of observations.

  lambda: A shape and scale and parameter.

chi, psi: Shape and scale parameters. Must be positive.

logvalue: If 'TRUE' the logarithm of the density will be returned.

subdivisions: The number of subdivisions passed to 'integrate' when
          computing the the distribution function 'pgig'.

 rel.tol: The relative accuracy requested from  'integrate'.

 abs.tol: The absolute accuracy requested from  'integrate'.

  method: Determines which method is used when calculating quantiles.

spline.points: The number of support points when computing the
          quantiles with the method "splines" instead of "integration".

root.tol: The tolerance of 'uniroot'.

messages: If 'TRUE' error messages from 'rgig' are printed.

 envplot: If 'TRUE' an plot of the envelope is shown.

    func: The transformation function when computing the expected
          value.  'x' is the expected value (default), 'log x' returns
          the expected value of the logarithm of 'x', '1/x' returns the
          expected value of the inverse of 'x' and 'var' returns the
          variance.

check.pars: If 'TRUE' the parameters are checked first.

     ...: Arguments passed form 'ESgig' to 'qgig'.

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

     'qgig' computes the quantiles either by using the "integration"
     method where the root of  the distribution function is solved or
     via "splines" which interpolates the distribution function and
     solves it with 'uniroot' afterwards. The "integration" method is
     recommended when few quantiles are required. If more than
     approximately 20 quantiles are needed to be calculated the
     "splines" method becomes faster. The accuracy can be controlled
     with an adequate setting of the parameters 'rel.tol', 'abs.tol',
     'root.tol' and 'spline.points'. 

     'rgig' uses the random generator from the S-Plus library _QRMlib_ 
     (see <URL: http://www.math.ethz.ch/~mcneil/book/QRMlib.html>).

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

     'dgig' gives the density, 
       'pgig' gives the distribution function, 
      'qgig' gives the quantile function, 
       'ESgig' gives the expected shortfall,  
      'rgig' generates random deviates and 
       'Egig' gives the expected value of either 'x', '1/x', 'log(x)'
     or the variance if 'func' equals 'var'.

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

     David Lthi

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

     The algorithm for simulating generalized inverse gaussian variates
     is copied  from the S-Plus and R library _QRMlib_ from Alexander
     J. McNeil (2005)  designed to accompany the book  _Quantitative
     Risk Management, Concepts, Techniques and Tools_. <URL:
     http://www.math.ethz.ch/~mcneil/book/QRMlib.html>.

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

     'fit.ghypuv', 'fit.ghypmv', 'integrate', 'uniroot', 'spline'

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

     dgig(1:40, lambda = 10, chi = 1, psi = 1)
     qgig(1e-5, lambda = 10, chi = 1, psi = 1)
     Egig(lambda = 10, chi = 1, psi = 1, func = "x")
     Egig(lambda = 10, chi = 1, psi = 1, func = "var")
     Egig(lambda = 10, chi = 1, psi = 1, func = "1/x")

