Description Usage Arguments Value References Examples
Variance Transformation Operation - MRA
1 |
data |
A list of response x and dependent variables dp. |
wf |
Name of the wavelet filter to use in the decomposition. |
J |
Specifies the depth of the decomposition. This must be a number less than or equal to log(length(x),2). |
method |
Either "dwt" or "modwt". |
pad |
The method used for extend data to dyadic size. Use "per", "zero", or "sym". |
boundary |
Character string specifying the boundary condition. If boundary=="periodic" the default, then the vector you decompose is assumed to be periodic on its defined interval, if boundary=="reflection", the vector beyond its boundaries is assumed to be a symmetric reflection of itself. |
cov.opt |
Options of Covariance matrix sign. Use "pos", "neg", or "auto". |
A list of 8 elements: wf, method, boundary, pad, x (data), dp (data), dp.n (variance trasnformed dp), and S (covariance matrix).
Z Jiang, A Sharma, and F Johnson. WRR
Percival, D. B. and A. T. Walden (2000) Wavelet Methods for Time Series Analysis, Cambridge University Press.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | data(rain.mon)
data(obs.mon)
## response SPI - calibration
SPI.cal <- SPI.calc(window(rain.mon, start=c(1949,1), end=c(1979,12)),sc=12)
## create paired response and predictors dataset for each station
data.list <- list()
for(id in 1:ncol(SPI.cal)){
x <- window(SPI.cal[,id], start=c(1950,1), end=c(1979,12))
dp <- window(obs.mon, start=c(1950,1), end=c(1979,12))
data.list[[id]] <- list(x=as.numeric(x), dp=matrix(dp, nrow=nrow(dp)))
}
## variance transformation
dwt.list<- lapply(data.list, function(x) dwt.vt(x, wf="d4", J=7, method="dwt", pad="zero", boundary="periodic"))
## plot original and reconstrcuted predictors for each station
for(i in 1:length(dwt.list)){
# extract data
dwt <- dwt.list[[i]]
x <- dwt$x # response
dp <- dwt$dp # original predictors
dp.n <- dwt$dp.n # variance transformed predictors
plot.ts(cbind(x,dp))
plot.ts(cbind(x,dp.n))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.