wclust: Compute dissimilarity between multiple wavelet spectra

Description Usage Arguments Value Author(s) References Examples

Description

Compute dissimilarity between multiple wavelet spectra

Usage

1
wclust (w.arr)

Arguments

w.arr

N x p x t array of wavelet spectra where N is the number of wavelet spectra to be compared, p is the number of periods in each wavelet spectrum and t is the number of time steps in each wavelet spectrum.

Value

Returns a list containing:

diss.mat

square dissimilarity matrix

dist.mat

(lower triangular) distance matrix

Author(s)

Tarik C. Gouhier (tarik.gouhier@gmail.com)

References

Rouyer, T., J. M. Fromentin, F. Menard, B. Cazelles, K. Briand, R. Pianet, B. Planque, and N. C. Stenseth. 2008. Complex interplays among population dynamics, environmental forcing, and exploitation in fisheries. Proceedings of the National Academy of Sciences 105:5420-5425.

Rouyer, T., J. M. Fromentin, N. C. Stenseth, and B. Cazelles. 2008. Analysing multiple time series and extending significance testing in wavelet analysis. Marine Ecology Progress Series 359:11-23.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
t1=cbind(1:100, sin(seq(from=0, to=10*2*pi, length.out=100)))
t2=cbind(1:100, sin(seq(from=0, to=10*2*pi, length.out=100)+0.1*pi))
t3=cbind(1:100, rnorm(100))

## Compute wavelet spectra
wt.t1=wt(t1)
wt.t2=wt(t2)
wt.t3=wt(t3)

## Store all wavelet spectra into array
w.arr=array(NA, dim=c(3, NROW(wt.t1$wave), NCOL(wt.t1$wave)))
w.arr[1, , ]=wt.t1$wave
w.arr[2, , ]=wt.t2$wave
w.arr[3, , ]=wt.t3$wave

## Compute dissimilarity and distance matrices
w.arr.dis=wclust(w.arr)
plot(hclust(w.arr.dis$dist.mat, method="ward"), sub="", main="", 
        ylab="Dissimilarity", hang=-1)

Example output

biwavelet 0.20.17 loaded.

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |================                                                      |  22%
  |                                                                            
  |=======================                                               |  33%
  |                                                                            
  |===============================                                       |  44%
  |                                                                            
  |=======================================                               |  56%
  |                                                                            
  |===============================================                       |  67%
  |                                                                            
  |======================================================                |  78%
  |                                                                            
  |==============================================================        |  89%
  |                                                                            
  |======================================================================| 100%
The "ward" method has been renamed to "ward.D"; note new "ward.D2"

biwavelet documentation built on May 2, 2019, 5:10 p.m.