e_to_p            package:hyperdirichlet            R Documentation

_T_r_a_n_s_f_o_r_m _f_r_o_m _a _s_i_m_p_l_e_x _t_o _a _h_y_p_e_r_c_u_b_e

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

     Transform from a simplex (either regular or right-angled) to a
     hypercube.

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

     e_to_p(e)
     p_to_e(p)
     Jacobian(e)

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

       e: Vector with all elements between 0 and 1 (hypercube)

       p: Vector of positive elements whose sum is either equal to, or
          less than, one (simplex)

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

     Function 'e_to_p()' takes one from 'e'-space to 'p'-space.

     Function 'p_to_e()' takes one from 'p'-space to 'e'-space.  This
     is useful when integrating over a simplex; use 'Jacobian()' to
     evaluate the Jacobian of the transform.

     Forward transformation:


                         e_1=sum_{i=1}^d p_i



          e_i=frac{p_{i-1}}{sum_{j=i-1}^d p_j}, 2 <= i <= d


     Backward transformation:


                             p_1=e_1 e_2



          p_i=e_1 e_{i+1} prod_{i=2}^{i}(1-e_i), 2 <= i <= d


     Jacobian:


                   J=prod_{i=2}^{d-1}(1-e_i)^{d-i}

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

     The functions documented here return a scalar.

_N_o_t_e:

     To do a regular simplex, use the di of the right-angled simplex;
     see the examples.

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

     Robin K. S. Hankin

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

     M. Evans and T. Swartz 2000. _Approximating Integrals via Monte
     Carlo and Deterministic Methods_, Oxford University Press; page 28

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

     'dhyperdirichlet'

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

     ## Not run: 
     # First, try to calculate the volume of a regular 4-simplex:
     adapt(5,rep(0,5),rep(1,5),functn=function(x){Jacobian(c(1,x))})
     # Should be close to 1/5! = 1/120 ~= 0.008333
     # (that was the 'di trick')

     # Now, try to calculate the volume of a triangular-based pyramid:
     adapt(3,rep(0,3),rep(1,3),functn=Jacobian)
     # Should be close to 1/8=0.125
     ## End(Not run)

