# modwt python github code

from modwt import modwt, modwtmra import pandas as pd gdpdata = pd.DataFrame.from_csv('GDPcomponents.csv') wt = modwt(gdpdata['govtexp'], 'db2', 5) wtmra = modwtmra(wt, 'db2')

**Here is what the above code is Doing:**

1. Read in the data from the csv file

2. Compute the MODWT of the government expenditure series using the Daubechies 2 wavelet

3. Compute the MODWTMRA of the MODWT coefficients

The MODWT coefficients are stored in the wt variable, and the MODWTMRA coefficients are stored in the wtmra variable.

The MODWT coefficients are stored in a numpy array, where the first dimension is the level of the transform, and the second dimension is the time index.

The MODWTMRA coefficients are stored in a numpy array, where the first dimension is the level of the transform, and the second dimension is the time index.