threshold2d: Setting wavelet coefficients to zero that correspond to...

Description Usage Arguments Value Examples

View source: R/TwoDimensional.R

Description

Takes in a vector of coefficients and returns the same vector, but with entries forced to zero that correspond to the desired wavelet levels

Usage

1
threshold2d(beta, numLevels, remove.x, remove.y)

Arguments

beta

Vector of wavelet coefficients

numLevels

Number of wavelet levels. Should be an integer between 2 and 10

remove.x

Vector of wavelet levels in the X direction that you want removed. Should contain numbers between 1 and numLevels

remove.y

Vector of wavelet levels in the Y direction that you want removed. Should contain numbers between 1 and numLevels

Value

A vector of wavelet coefficients with those corresponding to basis functions involving levels in remove.x or remove.y set to zero

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(BostonPMsim)
numLevels <- 3
Decomp <- Irregular2dWavelet(x=BostonPMsim$long, 
                             y=BostonPMsim$lat,
                             f=BostonPMsim$pm,
                             numLevels=numLevels)

threshold.betalow4 <- threshold2d(Decomp$beta, numLevels, remove.x=4:numLevels, remove.y=4:numLevels)
threshold.fHatlow4 <- Decomp$Zxy%*%threshold.betalow4

threshold.col = colors(100)[as.numeric(cut(threshold.fHatlow4,breaks = 100))]
map("state","massachusetts", xlim=range(BostonPMsim$long), ylim=range(BostonPMsim$lat))
points(BostonPMsim$long, BostonPMsim$lat, col=threshold.col, cex=.2)

jantonelli111/Irregular2dWavelets documentation built on May 18, 2019, 2:39 p.m.