I am trying to apply a Haar wavelet transform to stock market data for noise reduction, before feeding the data to a RNN (LSTM). As this data is in 1D, I'm using a single level DWT as follows:
import pywt
x = [3, 7, 1, 1, -2, 5, 4, 6, 1,11,34,44,66,888,33,455,10000,33]
cA, cD = pywt.dwt(x, 'haar')
I have following questions:
- Using a single level DWT, my time series is already reduced to half in cA and cD. I understand that each element of cA and cD relates to 2 elements in the original time series. That's all great, but how can I map the output arrays against the original series?
- When do we need to do multi-level decomposition? Also, as the level increases, the output arrays become smaller and so, again, I cant map this "de-noised" data against the original time series.
- Between cA and cD, which one should be used as the output of this transform to be fed into the RNN?
I have read so many high level papers about the value of wavelet transforms but almost none go through the actual code. So any example code would be most appreciated.
Best Regards,
Adeel