## See the Figure 1 of Polanco-Martinez and Fernandez-Macho
## 2012 (to be submitted under review to Journal of
## Statistical Software).
library("waveslim")
library("W2CWM2C")
data(dataexample)
#:: Convert. log returns using: ln(t + deltat) - ln(t)
#:: The application in this example is with stock market
#:: indexes and it is common to use log returns instead
#:: raw data. Other kinds of pre-processing data are possible.
dataexample <- dataexample[-1] # remove dates!
dataexample <- dataexample[,1:5]
lrdatex <- apply(log(dataexample), 2, diff)
tslrdat <- ts(lrdatex, start=1, frequency=1)
#Input parameters
Wname <- "la8"
J <- 8
Hp <- 6
Wp <- 10
tslrdat <- tslrdat[,1:5]
compWC <- WC(tslrdat, Wname, J, Hp, Wp)
Run the code above in your browser using DataLab