library("wavemulcor")
library("W2CWM2C")
data(dataexample)
#:: Convert. log return 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 the 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]
compWMC <- WMC(tslrdat, Wname, J, Hp, Wp)
Run the code above in your browser using DataLab