What seems to be unique about the
modwtmra functions (compared to anything I'm seeing in PyWavelets) is that their outputs can be summed across the zero axis to reconstruct the original series.
Here's an example:
import numpy as np import modwt x = np.arange(8).astype(float) # array([0., 1., 2., 3., 4., 5., 6., 7.]) wavelet = "db2" wt = modwt.modwt(x, wavelet, level=3) wtmra = modwt.modwtmra(wt, wavelet) x_recon = wtmra.sum(axis=0).round(5) # arbitrary rounding to ensure precision of assert assert (x == x_recon).all()
If I understand correctly, an advantage of this is that the outputs of
modwtmra can be used for regression purposes. That is, the individual output series can be used as model inputs and then the outputs of each model (one for each series) can be summed to make a prediction on the original series.
I see in the PyWavelets documentation that the Stationary Wavelet Transform is similar to MODWT if
norm=True, however, I'm not sure if it's possible to get the same kind of additive output.
So what I'm wondering is:
- If my understanding about using the outputs from MODWT/MODWTMRA for regression is correct. If so, could someone explain how exactly this works? What are these transforms doing that allows the wavelet properties to be maintained while still allowing for regression?
- Is it possible to replicate the additive output using SWT in PyWavelets? If not, what is the difference between what SWT is doing in PyWavelets and what's happening with MODWT/MODWTMRA?