cvimpute.by.wavelet | R Documentation |
This function performs imputation for test dataset of cross-validation given test dataset index and initial values.
cvimpute.by.wavelet(y, impute.index, impute.tol=0.1^3, impute.maxiter=100, impute.vscale="independent", filter.number=10, family="DaubLeAsymm", ll=3)
y |
observation |
impute.index |
test dataset index for cross-validation |
impute.tol |
tolerance for imputation |
impute.maxiter |
maximum iteration for imputation |
impute.vscale |
specifies whether variance is adjusted level-by-level or not. “level" or “independent" |
filter.number |
specifies the smoothness of wavelet in the decomposition (argument of WaveThresh) |
family |
specifies the family of wavelets “DaubExPhase" or “DaubLeAsymm" (argument of WaveThresh) |
ll |
specifies the lowest level to be thresholded |
In wavelet context, test dataset of cross-validation is missing values. Based on h-likelihood concept and penalized least squares, this function performs imputation by wavelet for missing dataset, given the missing dataset. Lee and Nelder (1996, 2001) introduced the hierarchical likelihood as an extended likelihood for general models that include unobserved random variables such as missing. Following Lee and Nelder (1996, 2001), treat the missing values as random parameters and it has been known that a wavelet shrinkage estimator can be formulated by penalized least squares problem (Antoniadis and Fan, 2001). This arguments lead to the iterative algorithm for imputing the missing values based on wavelet shrinkage.
Imputed values according to cross-validation scheme.
Antoniadis, A. and Fan, J. (2001) Regularization of wavelet approximations. Journal of the American Statistical Association, 96, 939–962.
Lee, Y. and Nelder, J.A. (1996) Hierarchical generalised linear models (with discussion). Journal of the Royal Statistical Society Ser. B, 58, 619–678.
Lee, Y. and Nelder, J.A. (2001) Hierarchical generalised linear models: A synthesis of generalised linear models, random-effect models and structured dispersions. Biometrika, 88, 987–1006.
cvwavelet
, cvtype
, cvwavelet.after.impute
.
# 8-fold cross-validation scheme with block size 2 set.seed(1) cv.index <- cvtype(n=1024, cv.bsize=2, cv.kfold=8, cv.random=TRUE)$cv.index # Generate 1024 observation from Heavisine function snr <- 5 testdata <- heav(1024) x <- testdata$x y <- testdata$meanf + rnorm(1024, 0, testdata$sdf / snr) # Impute by wavelet yimpute <- cvimpute.by.wavelet(y=y, impute.index=cv.index)$yimpute # Compare imputed values and observations par(mar=0.1+c(4,4,2,1)) plot(y, yimpute, xlab="Observations", ylab="Imputed Values", main="Piecewise Polynomial", cex=0.5);abline(0,1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.