if (FALSE) {
# Compute the Laplacian matrix and its eigen-decomposition
L <- laplacian_mat(grid1$sA)
U <- eigensort(L)
# Compute the tight frame coefficients
tf <- tight_frame(U$evalues, U$evectors)
# Generate some noisy observation
n <- nrow(L)
f <- randsignal(0.01, 3, grid1$sA)
sigma <- 0.01
noise <- rnorm(n, sd = sigma)
tilde_f <- f + noise
# Compute the transform coefficients
wcn <- forward_sgwt(f, U$evalues, U$evectors)
wcf <- forward_sgwt(f, U$evalues, U$evectors)
# Compute the weights
diagWWt <- colSums(t(tf)^2)
# Compute to optimal threshold
lmax <- max(U$evalues)
J <- floor(log(lmax)/log(b)) + 2
LD_opt_thresh_u <- LD_SUREthresh(J=J,
wcn=wcn,
diagWWt=diagWWt,
beta=2,
sigma=sigma,
hatsigma=NA,
policy = "uniform",
keepSURE = FALSE)
# Get the graph signal estimator
hatf_LD_SURE_u <- synthesis(LD_opt_thresh_u$wcLDSURE, tf)
}
Run the code above in your browser using DataLab