invtnp(X, coeff, lengths, lengthsremove, pointsin, removelist, neighbrs, schemehist,
interhist, nadd = length(X) - 2, intercept = TRUE, neighbours = 1, closest = FALSE,
LocalPred = LinearPred)
length(X)-nkeep
) in the forward transform.LinearPred
, QuadPred
, CubicPred
, AdaptPred
and AdaptNeigh
.intervals(X)
.order(X)
.Step Two. Using the information about the prediction scheme used in the "forward" transform, use the corresponding version of
Step Three. "Undo" the update step of the transform, and then the prediction step of the transform. The vector of scaling and detail coefficients, as well as the interval lengths are modified accordingly.
Step Four. Remove the added point from
Step Five. Return to step 1 but in the identification of the next point to add, the second to last entries in (the original)
The algorithm continues like this until as many points as desired are added.
AdaptNeigh
, AdaptPred
, CubicPred
, fwtnp
, invtnpmp
, LinearPred
, QuadPred
, UndoPointsUpdate
#
# Generate some one-dimensional data: 500 observations.
x2<-runif(500)
f2<-make.signal2("bumps",x=x2)
#
# perform the forward transform...
out<-fwtnp(x2,f2,LocalPred=AdaptPred)
#
# and now invert using the information from out...
#
fhat<-invtnp(x2,out$coeff,out$lengths,out$lengthsremove,out$pointsin,out$removelist,
out$neighbrs,out$schemehist,out$interhist,LocalPred=AdaptPred)
#
# Now compare the original signal with the reconstruction.
sum(abs(f2-fhat$coeff))
#
Run the code above in your browser using DataLab