Select Page

## Wavelet Analysis: Part I (Theoretical Background)

This is the first of two entries devoted to wavelets. Here, we summarize the most important theoretical principles underlying wavelet analysis. This entry should serve as a detailed background reference when using the new wavelet features released in EViews 12. In Part II we will apply these principles and demonstrate how they are used with the new EViews 12 wavelet engine.

### Introduction to Wavelets

What characterizes most economic time series are time-varying features such as non-stationarity, volatility, seasonality, and structural discontinuities. Wavelet analysis is a natural framework for analyzing these phenomena without imposing any simplifying assumptions such as stationarity. In particular, wavelet filters can decompose and reconstruct a time series (as well as its correlation structure) across timescales so that constituent elements at one scale are uncorrelated with those at another. This is clearly useful in isolating features which materialize only at certain timescales.

Wavelet analysis is also, in many respects, like Fourier spectral analysis. Both methods can represent a time series signal in a different space by re-expressing a signal as a linear combination of basis functions. In the context of Fourier analysis, these basis functions are sines and cosines. While these basis functions approximate global variation well, they are poorly adapted to capturing local variation, otherwise known as time-variation in time series analysis. To see this, observe that trigonometric basis functions are sinusoids of the form:

$R\mathrm{cos}\left(2\pi \left(\omega t+\varphi \right)\right)$

where

$R$

is the amplitude

$\omega$

is the frequency (in cycles per unit time) or period

$\frac{1}{\omega }$

(in units of time), and

$\varphi$

is the phase. Accordingly, if the time variable

$t$

is shifted and scaled to

$u=\frac{t-a}{b}$

, the associated sinusoid becomes:

$R\mathrm{cos}\left(2\pi \left({\omega }^{\star }u+{\varphi }^{\star }\right)\right)$

where

${\omega }^{\star }=\omega b$

and

${\varphi }^{\star }=\varphi +\omega a$

.

Evidently, the amplitude

$R$

is invariant to shifts in location and scale. Furthermore, notice that if

$b>1$

, the frequency

${\omega }^{\star }$

increases, but time

$u$

decreases, and vice versa. Accordingly, frequency information is gained when time information is lost, and vice versa.

Ultimately, trigonometric functions are ideally adapted to stationary processes characterized by impulses which wane with time, but are otherwise poorly adapted to discontinuous, non-linear, and non-stationary processes whose impulses persist and evolve with time. To surmount this fixed time-frequency relationship, a new set of basis functions are needed.

In contrast to Fourier transforms, wavelet transforms rely on a reference basis function called the mother wavelet. The latter is stretched (scaled) and shifted across time to capture time-dependent features. Thus, the wavelet basis functions are localized both in scale and time. In this sense, the wavelet basis function scale is the analogue of frequency in Fourier transforms. The fact that the wavelet basis function is also shifted (translated) across time, implies that wavelet basis functions are similar in spirit to performing a Fourier transform on a moving and overlapping window of subsets of the entire time series signal.

In particular, the mother wavelet function

$\psi \left(t\right)$

is any function satisfying:

${\int }_{-\mathrm{\infty }}^{\mathrm{\infty }}\psi \left(x\right)dx=0\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}{\int }_{-\mathrm{\infty }}^{\mathrm{\infty }}\psi \left(x{\right)}^{2}dx=1$

In other words, wavelets are functions that have mean zero and unit energy. Here, the term energy originates from the signal processing literature and is formalized as

${\int }_{-\mathrm{\infty }}^{\mathrm{\infty }}|f\left(t{\right)}^{2}|dt$

for some function

$f\left(t\right)$

. In fact, the concept is interchangeable with the idea of variance for non-complex functions.

From the mother wavelet, the wavelet basis functions are now derived as:

${\psi }_{a,b}\left(t\right)=\frac{1}{\sqrt{b}}\psi \left(\frac{t-a}{b}\right)$

where

$a$

is the location constant, whereas

$b$

is the scaling factor which corresponds to the notion of frequency in Fourier analysis. Observe further that the analogue of the amplitude

$R$

in Fourier analysis, here captured by the term

$\frac{1}{\sqrt{b}}$

, is in fact a function of the scale

$b$

. Accordingly, wavelet basis functions will adapt to scale-dependent phenomena much better than their trigonometric counterparts.

Since wavelet basis functions are de facto location and scale transformations of a single function, they are also an ideal tool for multiresolution analysis (MRA) – the ability to analyze a signal at different frequencies with varying resolutions. In fact, MRA is in some sense the inverse of the wavelet transform. It can derive representations of the original time-series data, using only those features which are characteristic at a given timescale.

For instance, a highly noisy but persistent time series, can be decomposed into a portion which represents only the noise (features captured at high frequency), and a portion which represents only the persistent signal (features captured at low frequencies). Thus, moving along the time domain, MRA allows one to zoom to a desired level of detail such that high (low) frequencies yield good (poor) time resolutions and poor (good) frequency resolutions. Since economic time series often exhibit multiscale features, wavelet techniques can effectively decompose these series into constituent processes associated with different timescales.

### Wavelet Transforms

In the context of continuous functions, the continuous wavelet transform (CWT) of a time series

$y\left(t\right)$

is defined as:

$W\left(a,b\right)={\int }_{-\mathrm{\infty }}^{\mathrm{\infty }}y\left(t\right){\psi }_{a,b}\left(t\right)\phantom{\rule{thinmathspace}{0ex}}dt$

Moreover, the inverse transformation to reconstruct the original process is given as:

$y\left(t\right)={\int }_{-\mathrm{\infty }}^{\mathrm{\infty }}{\int }_{0}^{\mathrm{\infty }}W\left(a,b\right){\psi }_{a,b}\left(t\right)\phantom{\rule{thinmathspace}{0ex}}da\phantom{\rule{thinmathspace}{0ex}}db$

See Percival and Walden (2000) for a detailed discussion.

Since continuous functions are rarely observed, the CWT is empirically rarely exploited and a discretized analogue known as the discrete wavelet transform (DWT) is used. In its most basic form, the series length,

$T={2}^{M}$

for

$M\ge 0$

, is assumed dyadic (a power of 2), and the DWT manifests as a collection of CWT slices at nodes

$\left(a,b\right)\equiv \left({a}_{k},{b}_{j}\right)$

such that

${a}_{k}={2}^{j}k$

and

${b}_{j}={2}^{j}$

where

$j=1,\dots ,M$

. In other words, the discrete wavelet basis functions assume the form:

${\psi }_{k,j}\left(t\right)={2}^{-j/2}\psi \left({2}^{-j}t-k\right)$

Unlike the CWT which is highly redundant in both location and scale, the DWT can be designed as an orthonormal transformation. If the location discretization is restricted to the index

$k=1,\dots ,{2}^{-j}T$

, at each scale

${\lambda }_{j}={2}^{j-1}$

, half the available observations are lost in exchange for orthonormality. This is the classical DWT framework. Alternatively, if the location index is restricted to the full set of available observations with

$k=1,\dots ,T$

, the discretized transform is no longer orthonormal, but does not suffer from observation loss. The latter framework is typically referred to as the maximal overlap discrete wavelet transform (MODWT), and sometimes as the non-decimated DWT. Since the DWT is formally characterized by wavelet filters, we devote some time to those next.

#### Discrete Wavelet Filters

Formally, the DWT is characterized via

$h=\left({h}_{0},\dots ,{h}_{L-1}\right)$

and

$g=\left({g}_{0},\dots ,{g}_{L-1}\right)$

— the wavelet (high pass) and scaling (low pass) filters of length

$L$

, respectively, for some

$L\ge 1$

. Recall that the low and high pass filters are defined in the context of frequency response functions, otherwise known as transfer functions. The latter are Fourier transforms of impulse response functions. Since the impulse response function describes, in the time domain, the evolution (response) of a time series signal to a given stimulus (impulse), the transfer function describes, in the frequency domain, the response of a time series signal to a given impulse in the frequency domain. In this regard, when the magnitude of the transfer function, otherwise known as the gain function, is large at low frequencies and small at high frequencies, the filter associated with that transfer function is said to be a low-pass filter. Otherwise, when the gain function is small at low frequencies but high at high frequencies, the transfer function is associated with a high-pass filter.

Like traditional time series filters which are used to extract features (eg. trends, seasonalities, business cycles, noise, etc.), wavelets filters perform a similar role. They are designed to capture low and high frequencies, and have a particular length. This length governs how much of the original series information is used to extract low and high frequency phenomena. This is very similar to the role of the autoregressive (AR) order in traditional time series models where higher AR orders imply more historical observations influence the present.

The simplest and shortest wavelet filter is of length

$L=2$

and is called the Haar wavelet. Formally, it is characterized by its high-pass filter definition:

$\begin{array}{r}{h}_{l}=\left\{\begin{array}{l}\frac{1}{\sqrt{2}}\phantom{\rule{1em}{0ex}}\text{if}\phantom{\rule{1em}{0ex}}l=0\\ \frac{-1}{\sqrt{2}}\phantom{\rule{1em}{0ex}}\text{if}\phantom{\rule{1em}{0ex}}l=1\end{array}\end{array}$

This is a sequence of rescaled rectangular functions and is therefore ideally suited to analyzing signals with sudden and discontinuous changes. In this regard, it is ideally suited for outlier detection. Unfortunately, this filter is typically too simple for most other applications.

To help mitigate the limitations of the Haar filter, Daubechies (1992) introduced a family of filters (known as daublets) of even length that are indexed by the polynomial degree they are able to capture — rather the number of vanishing moments. Thus, the Haar filter, which is of length 2, can only capture constants and linear functions. The Daubechies wavelet filter of length 4 can capture everything from a constant to a cubic function, and so on. Accordingly, higher filter lengths are associated with higher smoothness. Unlike the Haar filter which has a closed form solution in the time domain, the Daubechies family of wavelet filters have a closed form solution only in the frequency domain.

Unfortunately, Daubechies filters are typically not symmetric. If a more symmetric version of the daublet filters is required, then the class known as least asymmetric, or symmlets, is used. The latter define a family of wavelet filters which are as close to symmetric as possible.

 Figure 1: Haar Wavelet

 Figure 2: Daubechies – Daublet (L=8) Wavelet

 Figure 3: Least Asymmetric – Symmlet (L=8) Wavelet

#### Mallat’s Pyramid Algorithm

In practice, DWT coefficients are derived through the pyramid algorithm of Mallat (1989). In case of the classical DWT with

$T={2}^{M}$

, let

$\mathbf{y}={\left\{{y}_{t}\right\}}_{t=1}^{T}$

and define

$\mathbf{W}={\left[{\mathbf{W}}_{1},\dots ,{\mathbf{W}}_{M},{\mathbf{V}}_{M}\right]}^{\mathrm{\top }}$

as the matrix of DWT coefficients. Here,

${\mathbf{W}}_{j}$

is a vector of wavelet coefficients of length

$T/{2}^{j}$

and is associated with changes on a scale of length

${\lambda }_{j}={2}^{j-1}$

. Moreover,

${\mathbf{V}}_{M}$

is a vector of scaling coefficients of length

$T/{2}^{j}$

and is associated with averages on a scale of length

${\lambda }_{M}={2}^{M-1}$

$\mathbf{W}$

now follows from

$\mathbf{W}=\mathcal{W}\mathbf{y}$

where

$\mathcal{W}$

is some

$T×T$

orthonormal matrix generating the DWT coefficients. The algorithm can now be formalized as follows.

If

${\mathbf{W}}_{j}={\left({W}_{1,1}\dots {W}_{T/{2}^{j},j}\right)}^{\mathrm{\top }}$

and

${\mathbf{V}}_{j}={\left({V}_{1,1}\dots {V}_{T/{2}^{j},j}\right)}^{\mathrm{\top }}$

, the

${j}^{th}$

iteration of the algorithm convolves an input signal with filters

$h$

and

$g$

respectively to derive the

${j}^{th}$

level DWT matrix

${\left[{\mathbf{W}}_{1},\dots {\mathbf{W}}_{j},{\mathbf{V}}_{j}\right]}^{\mathrm{\top }}$

. Explicitly, the convolution is formalized as:

$\begin{array}{rlrlrl}{W}_{t,1}& =\sum _{l=0}^{L-1}{h}_{l}{y}_{2t-l\phantom{\rule{-5pt}{0ex}}\phantom{\rule{0.667em}{0ex}}\mathrm{mod}\phantom{\rule{thinmathspace}{0ex}}\phantom{\rule{thinmathspace}{0ex}}T}& & {V}_{t,1}=\sum _{l=0}^{L-1}{g}_{l}{y}_{2t-l\phantom{\rule{-5pt}{0ex}}\phantom{\rule{0.667em}{0ex}}\mathrm{mod}\phantom{\rule{thinmathspace}{0ex}}\phantom{\rule{thinmathspace}{0ex}}T}& & j=1\\ {W}_{t,j}& =\sum _{l=0}^{L-1}{h}_{l}{V}_{2t-l\phantom{\rule{-5pt}{0ex}}\phantom{\rule{0.667em}{0ex}}\mathrm{mod}\phantom{\rule{thinmathspace}{0ex}}\phantom{\rule{thinmathspace}{0ex}}T,j-1}& & {V}_{t,j}=\sum _{l=0}^{L-1}{g}_{l}{V}_{2t-l\phantom{\rule{-5pt}{0ex}}\phantom{\rule{0.667em}{0ex}}\mathrm{mod}\phantom{\rule{thinmathspace}{0ex}}\phantom{\rule{thinmathspace}{0ex}}T,j-1}& & j=2,\dots ,M\end{array}$

where

$t=1,\dots ,T/{2}^{j}$

. In particular, each iteration therefore convolves the scaling coefficients from the preceding iteration, namely

${V}_{t,j-1}$

, with both the high and low pass filters, and the input signal in the first iteration is

${y}_{t}$

. The entire algorithm continues until the

${M}^{th}$

iteration although it can be stopped earlier.

In effect, at each scale, the DWT algorithm partitions the frequency spectrum into equal subsets — the low and high frequencies. At the first scale, low-frequency phenomena of the original signal

$\mathbf{y}$

are captured by

${\mathbf{V}}_{1}$

, whereas high frequency phenomena are captured by

${\mathbf{W}}_{1}$

. At scale 2, the same procedure is performed not on the original time series signal, but on the low-frequency components

${\mathbf{V}}_{1}$

. This in turn generates

${\mathbf{V}}_{2}$

, which is in a sense those phenomena that would be captured in the first quarter of the frequency spectrum, as well as

${\mathbf{W}}_{2}$

— the high-frequency components at scale 2, or those phenomena that would be captured in the second quarter of the frequency range. This continues at finer and finer levels as we increase scale. In this regard, increasing scale can isolate increasingly more persistent (lower frequency) features of the original time-series signal, with the wavelet coefficients

${\mathbf{W}}_{j}$

capturing the remaining, cumulated, “noisy” features.

#### Boundary Conditions

It’s important to note that both the DWT and the MODWT make use of circular filtering. When a filtering operation reaches the beginning or end of an input series, otherwise known as the boundaries, the filter treats the input time series as periodic with period

$T$

. In other words, we assume that

${y}_{T-1},{y}_{T-2},\dots$

are useful surrogates for unobserved values

${y}_{-1},{y}_{-2},\dots$

. Those wavelet coefficients which are affected are also known as boundary coefficients. Note that the number of boundary coefficients only depends on the filter length

$L$

and is independent of the input series length

$T$

. Furthermore, the number of boundary coefficients increases with filter length

$L$

. In particular, the formula for the number of boundary coefficients for the DWT and MODWT respectively, are given by:

$\begin{array}{rl}{\kappa }_{\text{DWT},j}& \equiv {L}_{j}^{\mathrm{\prime }}\\ {\kappa }_{\text{MODWT},j}& \equiv min\left\{{L}_{j},T\right\}\end{array}$

where

${L}_{j}^{\mathrm{\prime }}=⌈\left(L-2\right)\left(1-\frac{1}{{2}^{j}}\right)⌉$

and

${L}_{j}=\left(L-1\right)\left({2}^{j-1}-1\right)$

.

Furthermore, both DWT and MODWT boundary coefficients will appear at the beginning of

${\mathbf{W}}_{j}$

and

${\mathbf{V}}_{j}$

. Refer to Percival and Walden (2000) for further details.

#### Variance Decomposition

The orthonormality of the DWT generating matrix

$\mathcal{W}$

has important implications. First,

$\mathcal{W}×\mathcal{W}={I}_{T}$

, is an identity matrix of dimension

$T$

. More importantly,

${‖\mathbf{y}‖}^{2}={‖\mathbf{W}‖}^{2}$

. To see this, recall that

$\mathbf{y}={\mathcal{W}}^{\mathrm{\top }}\mathbf{W}$

and

${‖\mathbf{y}‖}^{2}={\mathbf{y}}^{\mathrm{\top }}\mathbf{y}$

. The DWT is therefore an energy (variance) preserving transformation. Coupled with this preservation of energy is also the decomposition of energy on a scale by scale basis. The latter formalizes as:

$\begin{array}{}\text{(1)}& {‖\mathbf{y}‖}^{2}=\sum _{j=1}^{M}{‖{\mathbf{W}}_{j}‖}^{2}+{‖{\mathbf{V}}_{M}‖}^{2}\end{array}$

where

${‖{\mathbf{W}}_{j}‖}^{2}=\sum _{t=t}^{T/{2}^{j}}{W}_{t,j}^{2}$

and

${‖{\mathbf{V}}_{M}‖}^{2}=\sum _{t=t}^{T/{2}^{M}}{V}_{t,M}^{2}$

. Thus,

${‖{\mathbf{W}}_{j}‖}^{2}$

quantifies the energy of

${y}_{t}$

accounted for at scale

${\lambda }_{j}$

. This decomposition is known as the wavelet power spectrum (WPS) and is arguably the most insightful of the properties of the DWT.

The WPS bares resemblance to the spectral density function (SDF) used in Fourier analysis. Whereas the SDF decomposes the variance of an input series across frequencies, in wavelet analysis, the variance of an input series is decomposed across scales

${\lambda }_{j}$

. One of the advantages of the WPS over the SDF is that the latter requires an estimate of the input series mean, whereas the former does not. In particular, note that the total variance in

$\mathbf{y}$

can be decomposed as:

$\sum _{j=0}^{\mathrm{\infty }}{\nu }^{2}\left({\lambda }_{j}\right)=\mathrm{var}\left(\mathbf{y}\right)$

where

${\nu }^{2}\left({\lambda }_{j}\right)$

is the contribution to

$\mathrm{var}\left(\mathbf{y}\right)$

due to scale

${\lambda }_{j}$

and is estimated as:

${\stackrel{^}{\nu }}^{2}\left({\lambda }_{j}\right)\equiv \frac{1}{T}\sum _{t=1}^{T}{W}_{t,j}^{2}$

Note that

${\stackrel{^}{\nu }}^{2}\left({\lambda }_{j}\right)$

is the energy of

${y}_{t}$

at scale

${\lambda }_{j}$

divided by the number of observations. Unfortunately, this estimator is biased due to the presence of boundary coefficients. To derive an unbiased estimate, boundary coefficients should be dropped from consideration. Accordingly, an unbiased estimate of variance contributed at scale

${\lambda }_{j}$

is given by:

${\stackrel{~}{\nu }}^{2}\left({\lambda }_{j}\right)\equiv \frac{1}{{M}_{j}}\sum _{t={\kappa }_{j}+1}^{T}{W}_{t,j}^{2}$

where

${M}_{j}=T-{\kappa }_{j}$

and

${\kappa }_{j}\equiv {L}_{j}^{\mathrm{\prime }}$

when wavelet coefficients are derived using the DWT, whereas

${\kappa }_{j}\equiv {L}_{j}$

in case wavelet coefficients derive from the MODWT.

It is also possible to derive confidence intervals for the contribution to the overall variance at each scale. In particular, dealing with unbiased estimators

$\stackrel{~}{\nu }\left({\lambda }_{j}\right)$

and a level of significance

$\alpha \in \left(0,1\right)$

, a confidence interval for

$\nu \left({\lambda }_{j}\right)$

with coverage

$1-2\alpha$

is given by:

$\begin{array}{r}\left[{\stackrel{~}{\nu }}^{2}\left({\lambda }_{j}\right)-{\mathrm{\Phi }}^{-1}\left(1-\alpha \right){\left(\frac{2{A}_{j}}{{M}_{j}}\right)}^{1/2}\phantom{\rule{1em}{0ex}},\phantom{\rule{1em}{0ex}}{\stackrel{~}{\nu }}^{2}\left({\lambda }_{j}\right)+{\mathrm{\Phi }}^{-1}\left(1-\alpha \right){\left(\frac{2{A}_{j}}{{M}_{j}}\right)}^{1/2}\right]\end{array}$

Above,

${A}_{j}$

is the integral of the squared spectral density function of wavelet coefficients

${\mathbf{W}}_{\mathbf{j}}$

excluding any boundary coefficients. As shown in Percival and Walden (2000),

${A}_{j}$

can be estimated as the sum of squared serial correlations among

${\mathbf{W}}_{\mathbf{j}}$

excluding any boundary coefficients. In other words:

${\stackrel{^}{A}}_{j}=\frac{1}{{M}_{j}}\sum _{t={\kappa }_{j}}^{T-|\tau |}{W}_{j,t}{W}_{j,t+|\tau |}\phantom{\rule{thinmathspace}{0ex}}\phantom{\rule{1em}{0ex}}0\le |\tau |\le {M}_{j}-1$

Unfortunately, as argued in Priestley (1981), there is no condition that prevents the lower bound of the confidence interval above from becoming negative. Accordingly, Percival and Walden (2000) suggest the approximation:

$\frac{\eta {\stackrel{~}{\nu }}^{2}\left({\lambda }_{j}\right)}{{\nu }^{2}\left({\lambda }_{j}\right)}\stackrel{d}{=}{\chi }_{\eta }^{2}$

where

$\eta$

is known as the equivalent degrees of freedom (EDOF) and is formalized as:

$\eta =\frac{2E{\left({\stackrel{~}{\nu }}^{2}\left({\lambda }_{j}\right)\right)}^{2}}{\mathrm{var}\left({\stackrel{~}{\nu }}^{2}\left({\lambda }_{j}\right)\right)}$

The confidence interval of interest with coverage

$1-2\alpha$

can now be stated as:

$\begin{array}{r}\left[\frac{\eta {\stackrel{~}{\nu }}^{2}\left({\lambda }_{j}\right)}{{Q}_{\eta }\left(1-\alpha \right)}\phantom{\rule{thinmathspace}{0ex}},\phantom{\rule{thinmathspace}{0ex}}\frac{\eta {\stackrel{~}{\nu }}^{2}\left({\lambda }_{j}\right)}{{Q}_{\eta }\left(\alpha \right)}\right]\end{array}$

where

${Q}_{\eta }\left(1-\alpha \right)$

is the

$\alpha -$

quantile for the

${\chi }_{\eta }^{2}$

distribution.

Remaining is the issue of EDOF estimation. Two suggestions in Percival and Walden (2000):

$\begin{array}{r}{\eta }_{1}\equiv \frac{{M}_{j}{\stackrel{~}{\nu }}^{4}\left({\lambda }_{j}\right)}{{\stackrel{^}{A}}_{j}}\\ {\eta }_{2}\equiv max\left\{{2}^{-j}{M}_{j}\phantom{\rule{thinmathspace}{0ex}},\phantom{\rule{thinmathspace}{0ex}}1\right\}\end{array}$

The first estimate above relies on large sample theory and in practice requires a sample of at least

$T=128$

to yield a decent approximation. The second assumes that the SDF of the wavelet coefficients at scale

${\lambda }_{j}$

is a band-pass. See Percival and Walden (2000) for details.

#### Multiresolution Analysis

Similar to Fourier, spline, and linear approximations, a principal feature of the DWT is the ability to approximate an input series as a function of wavelet basis functions. In wavelet theory this is known as multiresolution analysis (MRA) and refers to the approximation of an input series at each scale (and up to all scales)

${\lambda }_{j}$

.

To formalize matters, recall that

$\mathbf{W}=\mathcal{W}\mathbf{y}$

and partition the rows of

$\mathcal{W}$

commensurate with the row partition of

$\mathbf{W}$

into

${\mathbf{W}}_{1},\dots ,{\mathbf{W}}_{M}$

and

${\mathbf{V}}_{M}$

. In other words, let

$\mathcal{W}={\left[{\mathcal{W}}_{1},\dots ,{\mathcal{W}}_{M},{\mathcal{V}}_{M}\right]}^{\mathrm{\top }}$

, where

${\mathcal{W}}_{j}$

and

${\mathcal{V}}_{j}$

have dimensions

${2}^{-j}T×T$

. Then, note that for any

$m\in \left\{1,\dots ,M\right\}$

:

$\begin{array}{rl}\mathbf{y}& ={\mathcal{W}}^{\mathrm{\top }}\mathbf{W}\\ & =\sum _{j=1}^{m}{\mathcal{W}}^{\mathrm{\top }}{\mathbf{W}}_{j}+{\mathcal{V}}^{\mathrm{\top }}{\mathbf{V}}_{m}\\ & =\sum _{j=1}^{m}{\mathcal{D}}_{j}+{\mathcal{S}}_{m}\end{array}$

where

${\mathcal{D}}_{j}={\mathcal{W}}_{j}^{\mathrm{\top }}{\mathbf{W}}_{j}$

and

${\mathcal{V}}_{m}={\mathcal{V}}_{m}^{\mathrm{\top }}{\mathbf{V}}_{m}$

are

$T-$

dimensional vectors, respectively called the

${j}^{\text{th}}$

level detail and

${m}^{\text{th}}$

level smooth series. Furthermore, since the low-pass (high-pass) wavelet coefficients are associated with changes (averages) at scale

${\lambda }_{j}$

, the detail and smooth series are associated with changes and average at scale

${\lambda }_{j}$

, respectively, in the input series

$\mathbf{y}$

.

The MRA is typically used to derive approximations for the original series using its lower and upper frequency components. Since upper frequency components are associated with transient features and are captured by the wavelet coefficients, the detail series will in fact extract those features of the original series which are typically associated with “noise”. Alternatively, since lower frequency components are associated with perpetual features and are captured by the scaling coefficients, the smooth series will in fact extract those features of the original series which are typically associated with the “signal”.

It’s worth noting that because wavelet filtering can result in boundary coefficients, the detail and smooth series will have observations affected by the same. The latter are given as:

$\begin{array}{rl}\text{DWT}& \phantom{\rule{1em}{0ex}}t=\left\{\begin{array}{ll}1,\dots ,{2}^{j}{L}_{j}^{\mathrm{\prime }}& \phantom{\rule{1em}{0ex}}\text{lower portion}\\ T-\left({L}_{j}+1-{2}^{j}\right)+1,\dots ,T& \phantom{\rule{1em}{0ex}}\text{upper portion}\end{array}\\ \\ \text{MODWT}& \phantom{\rule{1em}{0ex}}t=\left\{\begin{array}{ll}1,\dots ,{L}_{j}& \phantom{\rule{1em}{0ex}}\text{lower portion}\\ T-{L}_{j}+1,\dots ,T& \phantom{\rule{1em}{0ex}}\text{upper portion}\end{array}\end{array}$

### Practical Considerations

The exposition above introduces basic theory underlying wavelet analysis. Nevertheless, there are several practical (empirical) considerations which should be addressed. We focus here on three in particular:

• Wavelet filter selection
• Handling boundary conditions
• Non-dyadic series length adjustments

#### Choice of Wavelet Filter

The type of wavelet filter is typically chosen to mimic the data to which it is applied. Shorter filters don’t approximate the ideal band pass filter well, but longer ones do. On the other hand, if the data derives from piecewise constant functions, the Haar wavelet or other shorter wavelets may be more appropriate. Alternatively, if the underlying data is smooth, longer filters may be more appropriate. In this regard, it’s important to note that longer filters expose more coefficients to boundary condition effects than shorter ones.

Accordingly, the rule of thumb strategy is to use the filter with the smallest length that gives reasonable results. Furthermore, since the MODWT is not orthogonal and its wavelet coefficients are correlated, wavelet filter choice is not as vital as in the case of the orthogonal DWT. Nevertheless, if alignment to time is important (i.e. zero phase filters), the least asymmetric family of filters may be a good choice.

#### Handling Boundary Conditions

As previously mentioned, wavelet filters exhibit boundary conditions due to circular recycling of observations. Although this may be an appropriate assumption for some series such as those naturally exhibiting cyclical effects, it is not appropriate in all circumstances. In this regard, another popular approach is to reflect the original series to generate a series of length

$2T$

. In other words, wavelet filtering proceeds on observations

${y}_{1},\dots ,{y}_{T},{y}_{T},{y}_{T-1},\dots ,{y}_{1}$

. In either case, any proper wavelet analysis ought, at the very least, quantify how many wavelet coefficients are affected by boundary conditions.

#### Adjusting Non-dyadic Length Time Series

Recall that the DWT requires an input series of dyadic length. Naturally, this condition is rarely satisfied in practice. In this regard, there are two broad strategies. Either shorten the input series to dyadic length at the expense of losing observations, or “pad” the input series with observations to achieve dyadic length. In the context of the latter strategy, although the choice of padding values is ultimately arbitrary, there are three popular choices, neither of which has proven superior:

• Pad with zeros
• Pad with mean
• Pad with median

### Wavelet Thresholding

A key objective in any empirical work is to discriminate noise from useful information. In this regard, suppose that the observed time series

${y}_{t}={x}_{t}+{ϵ}_{t}$

where

${x}_{t}$

is an unknown signal of interest obscured by the presence of unwanted noise

${ϵ}_{t}$

. Traditionally, signal discernment was typically achieved using discrete Fourier transforms. Naturally, this assumes that any signal is an infinite superposition of sinusoidal functions; a strong assumption in empirical econometrics where most data exhibits unit roots, jumps, kinks, and various other non-linearities.

The principle behind wavelet-based signal extraction, otherwise known as wavelet shrinkage, is to shrink any wavelet coefficients not exceeding some threshold to zero and then exploit the MRA to synthesize the signal of interest using the modified wavelet coefficients. In other words, only those wavelet coefficients associated with very pronounced spectra are retained with the additional benefit of deriving a very sparse wavelet matrix.

To formalize the idea, let

$\mathbf{x}={\left\{{x}_{t}\right\}}_{t=1}^{T}$

and

$ϵ={\left\{{ϵ}_{t}\right\}}_{t=1}^{T}$

. Next, recall that the DWT can be represented as

$T×T$

orthonormal matrix

$\mathcal{W}$

, yielding:

$\mathbf{z}\equiv \mathcal{W}\mathbf{y}=\mathcal{W}\mathbf{x}+\mathcal{W}ϵ$

where

$\mathcal{W}ϵ\sim N\left(0,{\sigma }_{ϵ}^{2}\right)$

. The idea now is to shrink any coefficients not surpassing a threshold to zero.

#### Thresholding Rule

While there are several thresholding rules, by far, the two most popular are:

• Hard Tresholding Rule (“kill/keep” strategy), formalized as:

• Soft Thresholding Rule, formalized as:

${\delta }_{\eta }^{S}\left(x\right)=\mathrm{sign}\left(x\right)max\left\{0\phantom{\rule{thinmathspace}{0ex}},\phantom{\rule{thinmathspace}{0ex}}|x|-\eta \right\}$

where

$\eta$

is the threshold limit.

#### Optimal Threshold

The threshold value

$\eta$

is key to wavelet shrinkage. In particular, optimal thresholding is achieved when

$\eta ={\sigma }_{ϵ}$

where

${\sigma }_{ϵ}$

is the standard deviation of the noise process

$ϵ$

. In this regard, several threshold strategies have emerged over the years.

• Universal Threshold, proposed in Donoho and Johnstone (1994), and formalized as:

${\eta }^{\text{U}}={\stackrel{^}{\sigma }}_{ϵ}\sqrt{2\mathrm{log}\left(T\right)}$

where

${\stackrel{^}{\sigma }}_{ϵ}$

is estimated using wavelet coefficients only at scale

${\lambda }_{1}$

, regardless of what scale is under consideration. When this threshold rule is coupled with soft thresholding, the combination is commonly referred to as VisuShrink.

• Adaptive Universal Threshold is identical to the universal threshold above, but estimates

${\stackrel{^}{\sigma }}_{ϵ}$

using those wavelet coefficients associated with the scale under consideration. In other words:

${\eta }^{\text{AU}}={\stackrel{^}{\sigma }}_{ϵ,j}\sqrt{2\mathrm{log}\left(T\right)}$

where

${\sigma }_{ϵ,j}$

is the variance of the wavelet coefficients at scale

${\lambda }_{j}$

.

• Minimax Estimation proposed in Donoho and Johnstone (1994), and is formalized as the solution to:

$\underset{\stackrel{^}{\mathbf{x}}}{inf}\underset{\mathbf{x}}{sup}R\left(\stackrel{^}{\mathbf{x}},\mathbf{x}\right)$

Unfortunately, a closed form solution is not available, although tabulated values exist. Furthermore, when this threshold is coupled with soft thresholding, the combination is commonly referred to as RiskShrink.

• Stein’s Unbiased Risk Estimate (SURE), formalized as the solution to:

$\underset{\stackrel{^}{\mu }}{min}{‖\mu -\stackrel{^}{\mu }‖}^{2}$

where

$\mu =\left({\mu }_{1},\dots ,{\mu }_{s}{\right)}^{\mathrm{\top }}$

and

${\mu }_{k}$

is the mean of some variable of interest

, for

$k=1,\dots ,s$

. In the framework of wavelet coefficients,

${q}_{k}$

would represent the standardized wavelet coefficients at a given scale.

Furthermore, while the optimal threshold

$\eta$

based on this rule depends on the thresholding rule used, the solution may not be unique and so the SURE threshold value is the minimum such

$\eta$

. In case of the soft thresholding rule, the solution was proposed in Donoho and Johnstone (1994). Alternatively, for the hard thresholding rule, the solution was proposed in Jansen (2010).

• False Discovery Rate (FDR), proposed in Abramovich and Benjamini (1995), determines the threshold value through a multiple hypotheses testing problem. The procedure is summarized in the following algorithm:
1. For each

${W}_{t,j}\in {\mathbf{W}}_{j}$

consider the hypothesis

${H}_{t,j}:{W}_{t,j}=0$

and its associated two-sided

$p-$

value:

${p}_{t,j}=2\left(1-\mathrm{\Phi }\left(\frac{|{W}_{t,j}|}{{\sigma }_{ϵ,j}}\right)\right)$

where as before,

${\sigma }_{ϵ,j}$

is the variance of the wavelet coefficients at scale

${\lambda }_{j}$

and

$\mathrm{\Phi }\left(\cdot \right)$

is the standard Gaussian CDF.

2. Sort the

${p}_{t,j}$

in ascending order so that:

${p}_{\left(1\right)}\le {p}_{\left(2\right)}\le \dots \le {p}_{\left({m}_{j}\right)}$

where

${m}_{j}$

denotes the cardinality (number of elements) in

${\mathbf{W}}_{j}$

. For instance, when

${\mathbf{W}}_{j}$

are derived from a DWT, then

${m}_{j}=T/{2}^{j}$

.

3. Let

$\alpha$

define the significance level of the hypothesis tests and let

${i}^{\star }$

denote the largest

$i\in \left\{1,\dots ,{m}_{j}\right\}$

such that

${p}_{\left(i\right)}\le \left(\frac{i}{{m}_{j}}\right)\alpha$

. For this

${i}^{\star }$

, the quantity:

${\eta }_{j}^{\text{FDR}}={\sigma }_{ϵ,j}{\mathrm{\Phi }}^{-1}\left(1-\frac{{p}_{{i}^{\star }}}{2}\right)$

is the optimal threshold for wavelet coefficients at scale

${\lambda }_{j}$

.

For further details, Donoho, Johnstone, et. al. (1998), Gencay, Selcu, and Whitcher (2001), and Percival and Walden (2000).

#### Wavelet Coefficient Variance

Before summarizing the entire threshold procedure, there remains the issue of how to estimate the variance of the wavelet coefficients,

${\sigma }_{ϵ}^{2}$

. If the assumption is that the observed data

$\mathbf{y}$

is obscured by some noise process

$ϵ$

, the usual estimator of variance will exhibit extreme sensitivity to noisy observations. Accordingly, let

${\mu }_{j}$

and

${\zeta }_{j}$

denote the mean and median, respectively, of the wavelet coefficients

${\mathbf{W}}_{j}$

at scale

${\lambda }_{j}$

, and let

${m}_{j}$

denote its cardinality (total number of coefficients at said scale). Then, several common estimators have been proposed in the literature:

• Mean Absolute Deviation formalized as:

${\stackrel{^}{\sigma }}_{ϵ,j}=\frac{1}{{m}_{j}}\sum _{i=1}^{{m}_{j}}|{W}_{i,j}-{\mu }_{j}|$

• Median Absolute Deviation formalized as:

${\stackrel{^}{\sigma }}_{ϵ,j}=\mathrm{median}\left(|{W}_{1,j}-{\zeta }_{1}|,\dots ,|{W}_{{m}_{j},j}-{\zeta }_{{m}_{j}}|\right)$

• Mean Median Absolute Deviation formalized as:

${\stackrel{^}{\sigma }}_{ϵ,j}=\frac{1}{{m}_{j}}\sum _{i=1}^{{m}_{j}}|{W}_{i,j}-{\zeta }_{j}|$

• Median (Gaussian) formalized as:

${\stackrel{^}{\sigma }}_{ϵ,j}=\frac{\mathrm{median}\left(|{W}_{1,j}|,\dots ,|{W}_{{m}_{j},j}|\right)}{0.6745}$

#### Thresholding Implementation

The previous sections were devoted to describing thresholding rules and optimal threshold values. Here the focus is on summarizing thresholding implementations.

Effectively all wavelet thresholding procedures follow the algorithm below:

1. Compute a wavelet transformation of the original data up to some scale

${J}^{\star }

. In other words, derive a partial wavelet transform and derive the wavelet and scaling coefficients

${\mathbf{W}}_{1},\dots ,{\mathbf{W}}_{{J}^{\star }},{\mathbf{V}}_{{J}^{\star }}$

.

2. Select an optimal threshold

$\eta$

from one of the methods discussed earlier.

3. Threshold the coefficients at each scale

${\lambda }_{j}$

for

$j\in \left\{1,\dots ,{J}^{\star }\right\}$

using the threshold value selected in 2 and some thresholding rule (hard or soft). This will generate a set of modified (thresholded) wavelet coefficients

${\mathbf{W}}_{1}^{\text{(T)}},\dots ,{\mathbf{W}}_{{J}^{\star }}^{\text{(T)}}$

. Observe that scaling coefficients

${\mathbf{V}}_{{J}^{\star }}$

are not thresholded.

4. Use MRA with the thresholded coefficients to reconstruct the signal (original data) as follows: