I am using biwavelet
package to conduct wavelet coherence analysis. I have a problem in setting the lag1 values (which should be a vector containing the AR(1) coefficient of each time series ) correctly. The following gives a reproducible example. Thanks a lot.
t1 <- cbind(1:100, rnorm(100))
t2 <- cbind(1:100, rnorm(100))
lag.t1=acf(t1,plot=F)$acf[2]
lag.t2=acf(t2,plot=F)$acf[2]
wtc.t1t2 <- wtc(t1, t2, max.scale = 32,lag1=c(lag.t1,lag.t2))
When I do this, an error occurs like this:
Warning messages:
1: In 2 * lag1 * cos(freq * 2 * pi) :
longer object length is not a multiple of shorter object length
2: In 1 - 2 * lag1 * cos(freq * 2 * pi) + lag1^2 :
longer object length is not a multiple of shorter object length
3: In (1 - lag1^2)/(1 - 2 * lag1 * cos(freq * 2 * pi) + lag1^2) :
longer object length is not a multiple of shorter object length