CubicPred | R Documentation |
This function performs the prediction lifting step using a cubic regression curve given a configuration of neighbours.
CubicPred(pointsin, X, coeff, nbrs, remove, intercept,
neighbours)
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. |
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 |
The procedure performs cubic 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. If there are not enough neighbours to generate a cubic regression curve, the order of prediction is decreased until it is possible (i.e. to QuadPred
, then LinearPred
).
Xneigh |
matrix of X values corresponding to the neighbours of the removed point. The matrix consists of columns |
mm |
the matrix from which the prediction is made. In terms of Xneigh, it is |
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. |
Matt Nunes (nunesrpackages@gmail.com), Marina Knight
fwtnp
, LinearPred
, QuadPred
#
# 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 cubic prediction based on the neighbours (without intercept)
#
cp<-CubicPred(order(tx),tx,ty,out$nbrs,173,FALSE,2)
#
cp$bhat
#
#the coefficients which define the cubic regression curve
#
cp$pred
#
#the predicted value from the regression curve
#
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.