Learn R Programming

adlift (version 1.2-3)

AdaptPred: AdaptPred

Description

This function performs the prediction lifting step over intercept and regression order.

Usage

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

Arguments

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
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 AdaptPred(the interc
neighbours
the number of neighbours to be considered in the computation of predicted values and detail coefficients.

Value

  • results.This is a ten item list giving the regression information chosen from the detail coefficient minimisation:
  • Xneighmatrix 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.
  • mmthe matrix from which the prediction is made. In terms of Xneigh, it is $(Xneigh^T Xneigh)^{-1} Xneigh^T$ .
  • bhatThe regression coefficients used in prediction.
  • weightsthe prediction weights for the neighbours.
  • predthe predicted function value obtained from the regression.
  • coeffvector of (modified) detail and scaling coefficients to be used in the update step of the transform.
  • intif TRUE, an intercept was used in the regression.
  • schemea character vector denoting the type of regression used in the prediction ("Linear", "Quad" or "Cubic").
  • detailsa 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.
  • minindexthe index into details (results[[9]]) which produces the minimum value.

Details

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

See Also

AdaptNeigh, CubicPred, fwtnp, LinearPred, QuadPred

Examples

Run this code
#
# 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 
#
ap<-AdaptPred(order(tx),tx,ty,out$nbrs,173,FALSE,2)
#
#the detail coefficient:
ap[[3]]

#and let's check the scheme used:
ap[[4]]

ap[[5]]

Run the code above in your browser using DataLab