transmatdualperm {nlt} | R Documentation |
Given a signal, a method of prediction (including neighbourhood definition) and a trajectory for the modified lifting algorithm to follow, this function computes the matrix that represents the transform from the raw data to the set of detail and scaling coefficients.
transmatdualperm(x, f, Pred = AdaptPred, neigh = 1, int = TRUE, clo = FALSE, keep = 2, perm = sample(1:length(x),(length(x)-keep),FALSE))
x |
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 x that gives the signal values corresponding to the x -locations. |
Pred |
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 ). |
neigh |
Number of neighbours to be used for defining the neighbourhood of each point that has to be removed. If (clo =FALSE), then this gives the number of neighbours to be used on each side of the removed point. |
int |
Specifies whether (int =TRUE) or not (int =FALSE) an intercept is to be used in the regression curve. For Pred =AdaptPred or AdaptNeigh , the algorithm automatically makes this choice. |
clo |
If (clo =TRUE) or (clo =FALSE), then at each step the neighbours are in closest, respectively symmetrical configuration. |
keep |
Number of scaling points we want at the end of the application of the modified lifting scheme. The usual choice is keep =2. |
perm |
Vector of length (length(x )-keep ). It gives the trajectory for the modified lifting algorithm to follow, i.e. it gives the order of point removal. |
The matrix associated to the modified lifting transform is of size (length(x
),length(x
)), and its columns correspond to the points in their order observation. The functions that appear as choices of Pred
can be found in the package 'adlift'.
out |
Outcome of the modified lifting algorithm (fwtnpperm ). |
Wnew |
Matrix associated to the modified lifting transform. |
x |
Vector of grid locations, the same as the x in Arguments . |
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.
#construct the grid locations x<-runif(256) #construct a signal f<-runif(256) #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(x)-keep) entries of a random permutation of (1:length(x)) vec<-sample(1:256,254,FALSE) #now you can transform the initial signal (x,f) into a set of wavelet and scaling coefficients, and work out the matrix associated to the transform #in the example below, the lifting transform follows the path given by vec and adaptive prediction steps with neighbourhoods of sizes at most 2 #the matrix associated to the transform is given by out$Wnew, and the output from the modified lifting transform is found in out$out out<-transmatdualperm(x,f,Pred=AdaptNeigh,neigh=1,clo=TRUE,keep=2,perm=vec)