localProjection {fractal} | R Documentation |
Given a time series, X[t], this function performs one iteration of the local projection filtering algorithm as described in Kantz and Schreiber [1]. This noise reduction algorithm is summarized in the following steps:
localProjection(x, dimension=3, tlag=timeLag(x), n.neighbor=dimension + 1, max.distance=2*stdev(x), metric=Inf, noise.dimension=1, corr.curve=TRUE)
x |
a vector containing a uniformly-sampled real-valued time series. |
corr.curve |
boolean argument. If true, the center-of-mass
vectors will be corrected for curvature effects. Default: TRUE . |
dimension |
the dimension of the time lag embedding created from the
given time series. This value should be at least twice the dimension
in which the underlying dynamics of the time series become
deterministic. Default: 3 . |
max.distance |
the neighbor search for each embedding point
finds all neighbors within max.distance. Default: 2*stdev(x) . |
metric |
the metric used when searching for
neighbors. Supported values are 1 (1-norm), 2 (2-norm), and Inf
(infinity norm). Default: Inf . |
n.neighbor |
the minimum number of neighbors acceptable to
define a neighborhood for each embedding point. If the neighbor search
using input max.distance does not produce at least this number of
neighbors a new search is performed which finds exactly n.neighbor
neighbors. Default: dimension + 1 . |
noise.dimension |
the assumed dimension of the (local) noise
subspace. This should be equal to the embedding dimension, dimension,
minus the dimension where the underlying dynamics of the time series
become deterministic. Default: 1 . |
tlag |
the time lag used when creating the time lag
embedding. Default: 1 . |
the resulting denoised time series, a vector the same length as the original time series.
Holger Kantz and Thomas Schreiber (1997), Nonlinear Time Series Analysis, Cambridge University Press.
embedSeries
, medianFilter
, timeLag
, FNN
.
x <- beamchaos@data x <- x - mean(x) sigma <- stdev(x) xnoise <- x + rnorm(length(x)) * sigma / 3 xclean <- localProjection(xnoise, dimension=7, noise.dimension=5, max.distance=3*sigma, n.neighbor=100) y <- data.frame(xclean, xnoise, x) stackPlot(x=positions(beamchaos)[], y=y, ylab=c("denoised","noisy","original"), ylim=range(y))