AdaptNeigh              package:adlift              R Documentation

_A_d_a_p_t_N_e_i_g_h

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

     This function performs the prediction lifting step over
     neighbourhoods and interpolation schemes.

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

     AdaptNeigh(pointsin, X, coeff, nbrs, remove, intercept, neighbours)

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

pointsin: The indices of gridpoints still to be removed. 

       X: the vector of grid values. 

   coeff: the vector of detail and scaling coefficients at that step of
          the transform. 

    nbrs: the indices (into 'X') of the neighbours to be used in the
          prediction step. Note that the value to this input is not
          important, since the procedure checks the neighbourhoods
          structure in the minimisation step anyway, but is for
          standardisation of arguments to the non-adaptive prediction
          schemes. 

  remove: the index (into 'X') of the point to be removed. 

intercept: Boolean value for whether or not an intercept is used in the
          prediction step of the transform. (Note that this is actually
          a dummy argument, since it is not necessary for the
          computation of the detail coefficient in 'AdaptNeigh', though
          is used for standardising its arguments with other prediction
          schemes for use in the 'fwtnp' function). 

neighbours: the number of neighbours to be considered in the
          computation of predicted values and detail coefficients. 

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

     The procedure performs adaptive regression (through 'AdaptPred')
     over the three types of regression and also over the
     3*'neighbours' configurations of neighbours. The combination (type
     of regression, configuration of neighbours) is chosen which gives
     the smallest detail coefficient (in absolute value).

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

results.: _This is a ten item list giving the regression information
          chosen from the detail coefficient minimisation (i.e, the
          information supplied to 'AdaptNeigh' by 'AdaptPred'):_

  Xneigh: matrix of 'X' values corresponding to the neighbours of the
          removed point. The matrix consists of columns
          1,X[nbrs],X[nbrs]^2,... depending on the order of the
          prediction used and whether or not an intercept is used.
          Refer to any reference on linear regression for more details. 

      mm: the matrix from which the prediction is made. In terms of
          'Xneigh', it is (Xneigh^T Xneigh)^{-1} Xneigh^T . 

    bhat: The regression coefficients used in prediction. 

 weights: the prediction weights for the neighbours. 

    pred: the predicted function value obtained from the regression. 

   coeff: vector of (modified) detail and scaling coefficients to be
          used in the update step of the transform. 

     int: if TRUE, an intercept was used in the regression. 

  scheme: a character vector denoting the type of regression used in
          the prediction ("Linear", "Quad" or "Cubic"). 

 details: a vector of the detail coefficients from which 'AdaptPred'
          selects the minimum value. There are six entries. The first
          three entries represent the detail coefficients from
          regression with no intercept in increasing order of
          prediction. The second three details are values for
          regression with intercept. 

minindex: the index into details ('results[[9]]') which produces the
          minimum value.

        : 

newinfo.: _A six item list containing extra information to be used in
          the main transform procedure ('fwtnp') obtained from the
          minimisation in 'AdaptNeigh':_

     clo: boolean value telling the configuration of the neighbours
          which produce the overall minimum detail coefficient. 

totalminindex: the index into 'mindetails' (below) indicating the
          overall minimum detail coefficient produced by the procedure. 

    nbrs: the indices into 'X' of the neighbours used in the best
          prediction scheme.

   index: the indices into 'pointsin' of the neighbours used in the
          best prediction. 

mindetails: a vector of 3*'neighbours' entries giving the minimum
          details produced by each call of 'AdaptPred' in 'AdaptNeigh'
          (for the different number and configuration of neighbours). 

minindices: vector of 3*'neighbours' entries giving the index (out of
          6) of the schemes which produce the best predictions by each
          call of 'AdaptPred' in 'AdaptNeigh'.

_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:

     'AdaptPred', 'fwtnp'

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

     #
     # Generate some doppler data: 500 observations.
     #
     tx <- runif(500)
     ty<-make.signal2("doppler",x=tx)
     #
     # Compute the neighbours of point 173 (2 neighbours on each side)
     #
     out<-getnbrs(tx,173,order(tx),2,FALSE)

     #
     # Perform the adaptive lifting step 
     #
     an<-AdaptNeigh(order(tx),tx,ty,out$nbrs,173,FALSE,2)
     #
     an[[1]][[8]]

     an[[2]][[3]]

     #shows best prediction when removing point 173, with the neighbours used

