lengthintervals            package:adlift            R Documentation

_l_e_n_g_t_h_i_n_t_e_r_v_a_l_s

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

     This function constructs the vector of interval lengths from a
     vector of interval endpoints.

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

     lengthintervals(X, I, type = "midpoints", neighbours, closest)

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

       X: The vector of gridpoints.

       I: a vector of interval endpoints. This is of length
          'length(X)+1'. 

    type: a character string, either '"midpoints"' or '"average"',
          denoting the way of computing the interval lengths, if
          'closest=TRUE'. If '"average"', then the average neighbour
          distance is associated as the interval lengths to the
          gridpoints; otherwise the lengths are associated from the
          interval vector, 'I' in the obvious way : right endpoint -
          left endpoint.

neighbours: the number of neighbours to be used in the prediction step
          of the transform. This is only used if 'closest=TRUE', since
          it specifies how many distances to average over when
          'type="average"'. 

 closest: indicates whether the neighbourhood structure to be used in
          the transform is symmetrical or not. When combined with
          'type="average"', enables the option of average closest
          neighbour distance as the associated interval lengths to the
          gridpoints.

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

     The function computes the interval lengths by finding the
     differences between the consecutive entries of the supplied
     interval vector 'I'. In the case of the choice of average closest
     neighbour distance interval association, the method uses the
     function 'getnbrs' to find the initial neighbours of each
     gridpoint to compute the average distances.

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

 lengths: a vector of 'length(X)' with the intervals lengths associated
          to the gridpoints.

initialnbrs: a matrix with columns 'order(X)', possibly together with
          the neighbour indices into 'X' of each gridpoint, if
          'type="average"'.

initialindex: If 'closest=TRUE' and 'type="average"', a matrix of
          dimension 'length(X)' x 'neighbours', showing the indices
          into 'order(X)' of the neighbours of each gridpoint.
          Otherwise is NULL. 

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

     Matt Nunes (matt.nunes@bristol.ac.uk), Marina Popa
     (Marina.Popa@bristol.ac.uk)

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

     'getnbrs', 'intervals'

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

     input<-runif(10)
     #gridpoint vector
     #
     I<-intervals(input,"reflect")
     #create the interval endpoint vector using the input
     #
     lengthintervals(input,I,"average",3,TRUE)
     #
     #computes 'intervals' based on 3 closest neighbour distance averages
     #

