nlt (version 2.2-1)

nlt: Denoise a signal using a nondecimated lifting transform

Description

Starting with a noise-contaminated signal, we decompose it using a 'nondecimated' lifting algorithm (i.e. by applying the modified lifting transform following several random paths), shrink all the obtained detail coefficients and invert each transform to give an estimated signal. The average of all these estimates is the final proposal for estimating the true (unknown) signal.

Usage

nlt(x, f, J, Pred = AdaptPred, neighbours = 1, closest = FALSE, intercept = TRUE, 
nkeep = 2, trule = "median",verbose = TRUE,do.orig = FALSE, returnall = FALSE)

Arguments

x

Vector of any length (possibly irregularly spaced) that gives the grid locations where the signal is observed.

f

Vector of the same length as x that gives the signal values corresponding to the x-locations.

J

Number of trajectories to be used by the nondecimated lifting algorithm.

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).

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.

intercept

Specifies whether (intercept=TRUE) or not (intercept=FALSE) an intercept is to be used in the regression curve. For Pred=AdaptPred or AdaptNeigh, the algorithm automatically makes this choice.

nkeep

Number of scaling points we want at the end of the application of the transform. The usual choice is nkeep=2.

trule

The type of Bayesian shrinkage technique, with possible choices posterior median ("median") or posterior mean ("mean").

verbose

A boolean indicating whether extra information should be printed.

do.orig

A boolean indicating whether the original adlift algorithm should also be computed.

returnall

A boolean indicating whether the function returns useful variables or just the denoised datapoints.

Value

vec

Matrix whose rows give the trajectories to be used by the nondecimated lifting algorithm.

ghatnat

Vector that gives the estimated true signal given by denoising using the lifting scheme that establishes its own order for removing the points (but with the same specification for prediction stage and neighbourhood as the modified algorithm), rather than a randomly generated order.

aveghat

Estimated signal, obtained as the average of the individual estimates from the random trajectory runs.

Details

Essentially, this function applies J times the modified lifting algorithm (that can be found in fwtnpperm), and removes the noise from all sets of detail coefficients by using empirical Bayes shrinkage (of package 'EbayesThresh'). Inverting (by means of the function invtnp of the package 'adlift') each transform consequently results in J estimates of the (unknown) true signal. The average of these estimators is our proposed estimator. The functions that appear as choices for Pred can be found in the package 'adlift'.

References

See the paper 'A "nondecimated" lifting transform.' by Knight, M.I. and Nason, G.P. (2009) for further details.

See Also

denoiseperm, fwtnpperm, fwtnpperm, and also invtnp of package 'adlift'

Examples

Run this code
# NOT RUN {
# construct the grid
x<-runif(256) 

# construct the true, normally unknown, signal
g<-make.signal2("blocks",x=x) 

# generate noise with mean 0 and signal-to-noise ratio 5
noise<-rnorm(256,mean=0,sd=sqrt(var(g))/5)

# generate a noisy version of g 
f<-g+noise 

# decide on a number of random trajectories to be used (below J=100, in paper J=20,30), and apply
# the nondecimated lifting transform to the noisy signal (x,f) 
#
# below we apply the modified lifting transform J times, each time following a different path, 
# and using adaptive prediction with neighbourhoods of size 2 in closest configuration; 
# all details are then thresholded using posterior medians and the algorithms inverted
# the aggregate estimator of g proposed by our method is found in out$aveghat
out<-nlt(x,f,J=10,Pred=AdaptPred,neighbours=2,closest=TRUE,intercept=TRUE,nkeep=2,trule="median") 
# }

Run the code above in your browser using DataCamp Workspace