fwtnpperm {nlt} | R Documentation |
Given a signal, a chosen prediction strategy and neighbourhood size and configuration, this function applies the lifting algorithm that removes one coefficient at a time following a prespecified order of point removal (or path, trajectory), rather than letting the algorithm decide the removal order. We refer to this type of lifting algorithm as the modified lifting scheme.
fwtnpperm(input, f, nkeep = 2, intercept = TRUE, initboundhandl = "reflect", updateboundhandl = "add", neighbours = 1, closest = FALSE, LocalPred = AdaptPred, mod = sample(1:length(input),(length(input)-nkeep),FALSE))
input |
Vector of any length (possibly irregularly spaced) that gives the grid locations at which the signal is observed. |
f |
Vector of the same length as input that gives the signal values corresponding to the grid locations. |
nkeep |
Number of scaling points we want after processing the signal by means of the modified lifting scheme. The usual choice is nkeep =2. |
intercept |
Specifies whether (intercept =TRUE) or not (intercept =FALSE) an intercept is to be used in the regression curve. For LocalPred =AdaptPred or AdaptNeigh , the algorithm automatically makes this choice. |
initboundhandl |
Character string, it indicates the strategy used for handling the interval boundaries at the start of the transform: "reflect" indicates that the intervals corresponding to the first and last data points are taken to have the respective grid values as midpoints, while "stop" indicates that the first and last intervals have as outer endpoints the grid points themselves. |
updateboundhandl |
Character string, it indicates the strategy used for updating the intervals associated to the neighbours of the points removed from the boundary:"reflect" indicates that the neighbouring intervals are symmetrical around the corresponding grid point, "stop" indicates that the neighbouring intervals end at the respective data points, and "add" indicates that the neighbouring intervals have outer endpoints where the boundary intervals did. |
neighbours |
Number of neighbours to be used for defining the neighbourhood of each point that has to be removed. If (closest =FALSE), then this gives the number of neighbours to be used on each side of the removed point. |
closest |
If (closest =TRUE) or (closest =FALSE), then at each step the neighbours are in closest, respectively symmetrical configuration. |
LocalPred |
The type of regression to be used in the prediction step of the modified lifting algorithm. Choices are linear, quadratic or cubic (respectively, LinearPred , QuadPred or CubicPred ), or two adaptive procedures which automatically choose the degree used in regression, (AdaptPred or AdaptNeigh ). |
mod |
Vector of length (length(x )-nkeep ) that gives the order of point removal to be used by the modified lifting algorithm. This is in fact the trajectory or path previously mentioned. |
The function here is not designed to cope with multiple observations at the same grid point, although it can be modified to do so. If multiple data is supplied, then the algorithm performs the usual lifting algorithm coded in the function fwtnpmp
(designed to handle multiple entries) of the package 'adlift'. The algorithm can be easily inverted by using the function invtnp
of the package 'adlift'. Also the functions that appear as options for LocalPred
can be found in the same 'adlift' package.
X |
Vector of grid points used in the transform. |
coeff |
Vector (in the order of X ) giving the detail and scaling coefficients obtained after lifting the initial signal. |
origlengths |
Vector of initial interval lengths corresponding to each gridpoint. |
lengths |
Vector of updated interval lengths corresponding to the scaling coefficients. Its length is nkeep . |
lengthsremove |
Vector giving the (updated) interval lengths corresponding to each removed point at its removal time. It corresponds to the removal order given by removelist . |
pointsin |
Vector of indices into X giving the scaling coefficients after the lifting algorithm removed the points specified by the trajectory. The length of this vector is nkeep . |
removelist |
Vector of indices into X giving the lifted coefficients in their order of removal. This should coincide with the given trajectory. |
neighbrs |
List of indices into X . Each list entry gives the indices of the neighbours of the removed point used at that particular step of the transform. |
neighbours |
Number of neighbours used in the prediction step of the transform. |
gamlist |
List of prediction weights used in the prediction step of the transform. |
alphalist |
List of update coefficients used in the update step of the decomposition. |
schemehist |
Vector of character strings indicating the type of regression used at each step of the transform. This is NULL when a non-adaptive regression step is chosen. |
interhist |
Boolean vector indicating whether or not an intercept was used in the regression curve at each step. This is NULL when a non-adaptive regression step is chosen. |
clolist |
Boolean vector recording the neighbour configuration chosen at each step: TRUE corresponds to closest neighbours, while FALSE to symmetrical neighbours. It is NULL except for LocalPred =AdaptNeigh . |
Use this function together with the "adlift" package available from CRAN.
Marina Knight (marina.knight@bristol.ac.uk)
See the paper 'A "nondecimated" lifting transform.' by Knight, M.I. and Nason, G.P. (2008) for further details.
fwtnp
,fwtnpmp
,invtnp
of package 'adlift'
#construct an irregular grid of length 256 input<-runif(256) #now construct a Doppler signal on the grid above f<-make.signal2("doppler",x=input) #generate the vector which will indicate the order of point removal that will be followed by the modified lifting algorithm (i.e. the trajectory) #vec below gives the first (length(input)-nkeep) entries of a random permutation of (1:length(input)) vec<-sample(1:256,254,FALSE) #now transform the initial signal (input,f) into a set of wavelet and scaling coefficients by using a modified lifting transform #that follows the removal order in vec and linear regression prediction steps and neighbourhoods of size 2 in symmetrical configuration #the set of scaling and detail coefficients can be found in out$coeff out<-fwtnpperm(input,f,LocalPred=LinearPred,neighbours=1,closest=FALSE,intercept=TRUE,nkeep=2,mod=vec)