gaussbandpass: Gaussian kernel bandpass and smoothing

Description Usage Arguments Value Warning Author(s) References See Also Examples

View source: R/gaussbandpass.R

Description

Bandpassing, smoothing and detrending of irregular time series using a gaussian kernel smoother.

Usage

1
2
gaussbandpass(X, per1, per2,prune=FALSE)
gaussdetr(X, tsc.in = mean(diff(index(X)))*10,prune=FALSE) 

Arguments

X

Input time series (zoo-object)

per1

Timescale 1 for lowpass

per2

Timescale 2 for highpass

prune

Logical; prune (per1/mean(diff(index(X)))) points at the edges of the time series

tsc.in

Timescale for detrending in gaussdetr

Value

A list consisting of

trend

Trend (used for highpass)

smoothed

Smoothed time series, used for lowpass

filt

Filtered time series (filtered=smoothed-lowpass

Warning

No elaborate edge-treatment yet

Author(s)

Kira Rehfeld krehfeld@awi.de

References

Rehfeld, K., Marwan, N., Heitzig, J. and Kurths, J. (2011) Comparison of correlation analysis techniques for irregularly sampled time series, Nonlinear Processes in Geophysics, 18 (3), pp. 389-404. doi:10.5194/npg-18-389-2011

See Also

tsc_dep_var

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Generate one gamma-distributed and one regular time axis
tx<-generate_t(dt=1,tmin=0,tmax=100,method="gamma")
ty<-generate_t(dt=1,tmin=0,tmax=100,method="linear")
## Simulate one coupled AR1 process (see reference for details)
Proc<-car(tx,ty,coupl_strength=0.5,phi=0.5,lag=0,nsur=1)
## Bind the results to zoo time series
x<-zoo(Proc$x,order.by=tx)
y<-zoo(Proc$y,order.by=ty)


plot(x)
lines(gaussbandpass(x,10,50)$trend,lwd=2)
lines(gaussbandpass(x,10,50)$smoothed,lwd=2,col="limegreen")
lines(gaussbandpass(x,10,50)$filt,col="red2",lwd=2)
colrs<-c("black","black","limegreen","red")
legend("bottom",c("original ts","trend","smoothed","filtered"),col=colrs,lty=1,lwd=c(1,2,2,2))

krehfeld/nest documentation built on May 28, 2019, 12:33 a.m.