distrExIntegrate           package:distrEx           R Documentation

_I_n_t_e_g_r_a_t_i_o_n _o_f _O_n_e-_D_i_m_e_n_s_i_o_n_a_l _F_u_n_c_t_i_o_n_s

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

     Numerical integration via 'integrate'. In case 'integrate' fails a
     Gauss-Legendre quadrature is performed.

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

     distrExIntegrate(f, lower, upper, subdivisions = 100, 
                      rel.tol = .Machine$double.eps^0.25, 
                      abs.tol = rel.tol, stop.on.error = TRUE, 
                      distr, order, ...)

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

       f: an R function taking a numeric first argument and returning a
          numeric vector of the same length.  Returning a non-finite
          element will generate an error. 

   lower: lower limit of integration. Can be '-Inf'. 

   upper: upper limit of integration. Can be 'Inf'. 

subdivisions: the maximum number of subintervals. 

 rel.tol: relative accuracy requested. 

 abs.tol: absolute accuracy requested. 

stop.on.error: logical. If 'TRUE' (the default) an error  stops the
          function. If false some errors will give a result with a 
          warning in the 'message' component. 

   distr: object of class 'UnivariateDistribution'. 

   order: order of Gau-Legendre quadrature. 

     ...: additional arguments to be passed to 'f'. Remember  to use
          argument names not matching those of 'integrate' and
          'GLIntegrate'! 

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

     This function calls 'integrate'. In case 'integrate' returns an
     error a Gauss-Legendre integration is performed using
     'GLIntegrate'. If 'lower' or (and) 'upper' are infinite the
     'GLIntegrateTruncQuantile', respectively the 
     '1-GLIntegrateTruncQuantile' quantile of 'distr' is used  instead.

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

     Estimate of the integral.

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

     Matthias Kohl Matthias.Kohl@stamats.de

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

     Based on QUADPACK routines 'dqags' and 'dqagi' by R. Piessens and
     E. deDoncker-Kapenga, available from Netlib.

     R. Piessens, E. deDoncker-Kapenga, C. Uberhuber, D. Kahaner (1983)
     _Quadpack: a Subroutine Package for Automatic Integration_.
     Springer Verlag.

     W.H. Press, S.A. Teukolsky, W.T. Vetterling, B.P. Flannery (1992)
     _Numerical Recipies in C_. The Art of Scientific Computing. Second
     Edition. Cambridge University Press.

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

     'integrate', 'GLIntegrate', 'distrExOptions'

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

     fkt <- function(x){x*dchisq(x+1, df = 1)}
     integrate(fkt, lower = -1, upper = 3)
     GLIntegrate(fkt, lower = -1, upper = 3)
     try(integrate(fkt, lower = -1, upper = 5))
     distrExIntegrate(fkt, lower = -1, upper = 5)

