Skip to content

Commit

Permalink
add MultiSURE fun
Browse files Browse the repository at this point in the history
  • Loading branch information
fabnavarro committed Mar 20, 2019
1 parent 1e8ecfc commit 0e82fae
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Expand Up @@ -24,6 +24,7 @@ export(MakeONFilter)
export(MakeSignal)
export(MakeSignalNewb)
export(MirrorFilt)
export(MultiSURE)
export(PlotSpikes)
export(PlotWaveCoeff)
export(SNR)
Expand Down
25 changes: 25 additions & 0 deletions R/MultiSURE.R
@@ -0,0 +1,25 @@
#' Apply Shrinkage to Wavelet Coefficients
#'
#' SURE referes to Stein's Unbiased Risk Estimate.
#'
#' @export MultiSURE
#' @param wc Wavelet Transform of noisy sequence with N(0,1) noise.
#' @param L low-frequency cutoff for Wavelet Transform.
#' @return \code{ws} result of applying SUREThresh to each dyadic block.

MultiSURE <- function(wc, L) {
d <- dyadlength(wcoef)
J <- d$y
n <- d$x
for (j in (J - 1):L) {
wc[dyad(j)] <- SUREThresh(wc[dyad(j)])
}
ws <- wc
return(ws)
}

# Copyright (c) 1993-5. Jonathan Buckheit, David Donoho and Iain Johnstone

# Part of Wavelab Version 850 Built Tue Jan 3 13:20:39 EST 2006 This is
# Copyrighted Material For Copying permissions see COPYING.m Comments? e-mail
# wavelab@stat.stanford.edu
19 changes: 19 additions & 0 deletions man/MultiSURE.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0e82fae

Please sign in to comment.