diss.INT.PER: Integrated Periodogram Based Dissimilarity

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

View source: R/diss.R

Description

Computes the dissimilarity between two time series in terms of the distance between their integrated periodograms.

Usage

1
diss.INT.PER(x, y, normalize=TRUE)

Arguments

x

Numeric vector containing the first of the two time series.

y

Numeric vector containing the second of the two time series.

normalize

If TRUE the normalized version is computed.

Details

The distance is computed as:

d(x,y) = INT( F_x(λ) - F_y(λ))dλ | λ = -π to π

where F_x(λ_j)=(sum F_x(λ_i)|i=1 to j)/C_x and F_y(λ_j)=(sum F_y(λ_i)|i=1 to j)/C_xy, with C_x = ∑_i I_x(λ_i) and C_y = ∑_i I_y(λ_i) in the normalized version. C_x = 1 and C_y = 1 in the non-normalized version. I_x(λ_k) and I_y(λ_k) denote the periodograms of x and y, respectively.

Value

The computed distance.

Author(s)

Pablo Montero Manso, Jos<c3><a9> Antonio Vilar.

References

Casado de Lucas, D. (2010) Classification techniques for time series and functional data.

Montero, P and Vilar, J.A. (2014) TSclust: An R Package for Time Series Clustering. Journal of Statistical Software, 62(1), 1-43. http://www.jstatsoft.org/v62/i01/.

See Also

diss.PER

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Create three sample time series
x <- cumsum(rnorm(100))
y <- cumsum(rnorm(100))
z <- sin(seq(0, pi, length.out=100))
## Compute the distance and check for coherent results
diss.INT.PER(x, y, normalize=TRUE)
diss.INT.PER(x, y, normalize=TRUE)
diss.INT.PER(x, y, normalize=TRUE)
## Not run: 
diss( rbind(x,y,z), "INT.PER", normalize=FALSE )

## End(Not run)

Example output

Loading required package: wmtsa
Loading required package: pdc
Loading required package: cluster
Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE 
3: .onUnload failed in unloadNamespace() for 'rgl', details:
  call: fun(...)
  error: object 'rgl_quit' not found 
[1] 2.629073
[1] 2.629073
[1] 2.629073
          x         y
y 22465.330          
z  9214.179 31679.508

TSclust documentation built on May 29, 2017, 9:46 a.m.

Search within the TSclust package
Search all R packages, documentation and source code