# Wavelet Analysis

## Monte Carlo Method

 Important Note: When applying the significance and confidence tests from "A Practical Guide to Wavelet Analysis", you do not need to use a Monte Carlo simulation. Analytical formulae are given in the paper for the statistical distribution of wavelet power. These formulae are correct, assuming that the underlying distribution of the original time series is Gaussian. The following description of Monte Carlo is given for those who want more background on the method, or if your time series cannot be assumed to be Gaussian.
Gaussian distribution The Monte Carlo method (or simulation) was used in "A Practical Guide to Wavelet Analysis" to verify that the wavelet power spectrum was indeed chi-square distributed. The method was also used to determine the empirical formulae for time-averaging and scale-averaging (paper Sections 5a and 5b).

The Monte Carlo method (or simulation) is a statistical method for finding out the answer to a problem that is too difficult to solve analytically, or for verifying the analytical solution. It is called Monte Carlo because of the gambling casinos in that city, and because the Monte Carlo method is related to rolling dice.

Chi-square distribution Here's an example:
If you roll two dice, then the chances of getting a total of "two" (a "one" on each) are 1 in 36. This is easy to figure out. But if you didn't know the answer, you could use the Monte Carlo method. You just roll two dice thousands of times, and add up how many times you got a total of "two". Eventually, your fraction of "two's" to "total rolls" will approach 1/36.  In our paper, we wanted to verify that the statistical distribution for the wavelet power was chi-square. Here's the Monte Carlo method we used:
1. We created 100,000 random time series, each with 512 points.

2. Then we took the wavelet transform for each one, and computed the wavelet power.

3. We then took a time slice from the middle (time n=256),

4. At each scale, we sorted all 100,000 wavelet powers into increasing order.

5. You can then make a plot of wavelet power versus number.

6. If you then look at what the wavelet power was for number 95,000 out of 100,000, then 95% of the wavelet power is below that value, and only 5% is above.

7. This 95% level is the 95% confidence level (or the 5% significance level).
The method can be generalized to any process where the statistical distribution is unknown, yet one needs to determine confidence or significance levels.

Time series Wavelet power spectrum Chi-square results 