LinearPredmp             package:adlift             R Documentation

_L_i_n_e_a_r_P_r_e_d_m_p

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

     This function performs the prediction lifting step using a linear
     regression curve given a configuration of neighbours, for multiple
     point data.

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

     LinearPredmp(pointsin, X, coefflist, coeff, nbrs, newnbrs, remove, intercept,
      neighbours, mpdet, g)

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

coefflist: the list of detail and multiple scaling coefficients at that
          step of the transform.

    nbrs: the indices (into 'X') of the neighbours to be used in the
          prediction step.

 newnbrs: as nbrs, but repeated according to the multiple point
          structure of the grid.

  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.

neighbours: the number of neighbours in the computation of the
          predicted value. This is not actually used specifically in
          'LinearPredmp', since this is known already from 'nbrs'.

   mpdet: how the mutiple point detail coefficients are computed. 
          Possible values are "ave", in which the multiple detail
          coefficients produced when performing the multiple
          predictions are averaged, or "min", where the overall minimum
          detail coefficient is taken.  Note that this is taken to
          standardise the input when 'LocalPredmp' is called.

       g: the group structure of the multiple point data.  Note that
          this is taken to standardise the input when 'LocalPredmp' is
          called.

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

     The procedure performs linear regression using the given
     neighbours using an intercept if chosen. The regression
     coefficients ('weights') are used to predict the new function
     value at the removed point.

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

  Xneigh: matrix of X values corresponding to the neighbours of the
          removed point. The matrix consists of the column X[newnbrs]
          augmented with a column of ones if 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.

_N_o_t_e:

     The 'Matrix' is needed for this function.

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

     'CubicPredmp', 'fwtnpmp', 'QuadPredmp'

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

     #read in data with multiple values...

     mcdata()

     short<-adjustx(times,accel,"mean")
     X<-short$sepx
     coeff<-short$sepx
     g<-short$g

     coefflist<-list()
     for (i in 1:length(g)){
     coefflist[[i]]<-accel[g[[i]]]
     }

     #work out neighbours of point to be removed (31)

     out<-getnbrs(X,31,order(X),2,TRUE)
     nbrs<-out$n

     nbrs

     newnbrs<-NULL
     for (i in 1:length(nbrs)){
     newnbrs<-c(newnbrs,rep(nbrs[i],times=length(g[[nbrs[i]]])))
     }

     #work out repeated neighbours using g...
     newnbrs

     LinearPredmp(order(X),X,coefflist,coeff,nbrs,newnbrs,31,TRUE,2,"ave",g)

