Next Previous Contents

5. Homework

We'll start with a simple test on the paradigm of multifractals, i.e. a multinomial measure. Synthesize first a multinomial measure: Go to Synthesis/Measures. We'll generate a measure with the default parameters, i.e. a 1D trinomial deterministic measure at resolution 7. This results in 3^7=2187 intervals. The reason why we generate a trinomial measure and not a binomial one is that many algorithms use (sometimes implicitly) at some point a dyadic partition of space, and it would be cheating to match the structure of the data to that of the algorithm. Since there is a closed formed formula for the multifractal spectrum of such measures, we'll check the box to the right of Compute theoretical spectrum, so that Yes appears. Recall finally that, in this case, all three spectra, i.e. the Hausdorff, large deviation and Legendre spectra, coincide. Hit Compute, and view the two generated signals: mu_n0 is the trinomial measure, and theof0 the associated multifractal spectrum. Let us now try to estimate the spectrum from the data mu_n0. We'll try first the enhanced box method implemented in Fraclab: With mu_n0 selected, go to 1D signals Multifractal Spectra/Measures/Legendre Spectrum/Box Method/Basic parameters. The estimated spectrum mdfl1d_mu_n00 appears in the Variables list. View it, and compare it with the theoretical one theof0 (you can superpose them using the hold facility of the View menu). As you can see, the match is almost perfect. As a second test, we'll try the discrete wavelet based method. With mu_n0 selected, go to 1D signals Multifractal Spectra/Measures/Legendre Spectrum/DWT based. Hit Compute to get the estimated spectrum dwt_mu_n00_LegSpec0. You'll notice that although not completely off, this estimate is quite wrong on its left part. The fact that it is not smooth but rather displays angles is not a serious problem: It is just that the discretization in the q parameter is too coarse. To get rid of this artifact, let us try the Advanced compute method (recall to select mu_n0 before clicking on Advanced compute, otherwise you'll get an error Error : Input must be a Matrix or Vector ! in the Message zone of the main window). Change Qmin to -10, Qmax to 10, and # of Q's to 30, and hit Compute. You get the usual window that allows you to select a range where approximate linearity holds. Note that, although the data are strictly multifractal, the scaling does not appear so good on the graph, i.e. there is no region where a linear behaviour is observed. If however you select the whole range, you'll get a spectrum which is not too bad: Hit return to validate your choice and view the resulting spectrum dwt_mu_n01_LegSpec0. This one is smoother, but it is still wrong on the left part. This discrepancy as well as the non linear behaviour noticed above are probably due to the fact that we are analyzing a triadic structure with a dyadic wavelet. As you may care to try, changing the wavelet will not improve the result. Let us now see what happens with a continuous wavelet transform based algorithm. Select again mu_n0 and go to 1D signals Multifractal Spectra/Measures/Legendre Spectrum/CWT based. Hit Compute to get the estimated spectrum mu_n0_LegSpec0. On viewing the result, you'll notice that it is completely false: It has no decreasing part. Let us now try the Advanced compute menu (recall to select mu_n0 before clicking on Advanced compute). Use the default parameters or change them as you like, and hit Compute WT, then Compute. In the new window that appears, you'll see why we get only an increasing part for the spectrum: This comes from the fact that the curves on the left do not cross as they should.

Let us now try to estimate the spectrum of a Weierstrass function. Synthesize a deterministic Weierstrass function with the default parameters except you require that 1024 samples are generated. The theoretical Legendre and large deviation spectra coincide in this case: it is a half line with slope -1 starting from the point (H,1). If however one computes the spectrum with a wavelet with a sufficient number of vanishing moments, the spectra reduce to the point (H,1). Let us first compute the Legendre spectrum. Since this is a function and not a measure, go to 1D signals Multifractal Spectra/Functions/Legendre Spectrum/DWT based. Hot Compute. The result is correct, as you will check by viewing dwt_Wei0_LegSpec0, although there is some lack of precision that you can correct by using the Advanced compute features. Set Qmin to -10, Qmax to 10, and # of Q's to 30, and hit Compute. You get the usual window that allows you to select a range where approximate linearity holds. Again, the scaling is not so good, although it should be from a theoretical point of view. Select the whole range and hit return to get the spectrum dwt_Wei00_LegSpec0. View it and notice how we have gained precision in the location of the maximum, which is quite close to 0.5. Try now a wavelet with a high number of vanishing moments, e.g. the Daubechies 20. The graphs do not look more linear, but, selecting again the whole range will give you an almost perfect result, i.e. a spectrum reduced to a single point with abscissa 0.5 and ordinate which is a bit underestimated around 0.85. Note finally that with a Coiflet 6, you do get a large region (between log scale 0 and 9) where approximate linearity holds, with corresponding spectrum comparable to the one obtained with the Daubechies wavelet. As you may care to check, the spectra obtained with the CWT method are not good, for the same reasons as the ones exposed in the case of the multinomial measure. The spectrum obtained using 1D signals Multifractal Spectra/Functions/Legendre Spectrum/Box Method/Basic parameters is not too far from the theoretical one, with however a noticeable bias on the maximum (0.6 instead of 0.5). Let us now estimate the large deviation spectrum. Go to 1D signals Multifractal Spectra/Functions/Large deviation Spectrum/Basic parameters. You get the estimate called fcfg1d_Wei00: this is almost the same spectrum as the one obtained using the Legendre approach in the box method implementation.

Our last test on a synthetic signal is with an IFS: synthesize an IFS in Synthesis/Functions/Deterministic/IFS with the default parameters. We shall analyze the signal called ifs_ord_0. This IFS has a (Legendre and large deviation) spectrum which assumes the same shape as the one of a deterministic multinomial measure. It has the following features: the Hölder exponent ranges in the interval (0.0959, 1.4650) with a mode at 0.7306. Let us see if we can recover this shape and values with our estimators. As you may care to check, the CWT method and its variants do not perform good in this case either. To test the DWT method, go to 1D signals Multifractal Spectra/Functions/Legendre Spectrum/DWT based and hit Advanced compute. Choose Daubechies 12 as a wavelet, and set Qmin to -10, Qmax to 10, # of Q's to 30 and hit Compute. Select the whole range and hit return. The obtained spectrum is not too bad, with a minimum at 0.01, a maximum at 1.65, and a mode at 0.69. These values depend however heavily on the choice of the analyzing wavelet. We will now see how the Box method behaves. Select ifs_ord_0 and go to 1D signals Multifractal Spectra/Functions/Legendre Spectrum/Box Method/Basic parameters. The computation will unfortunately take a while. However, the result is quite good: You get the correct shape, with a minimum at 0.26, a maximum at 1.43 and a mode at 0.72. In contrast, the computation of the estimate of the large deviation spectrum, obtained through 1D signals Multifractal Spectra/Functions/Large deviation Spectrum/Basic parameters, is very fast: You'll verify that you get roughly the same estimate as with the Legendre spectrum with the box method. The important fact here is that, contrarily to the Legendre one, the estimated large deviation spectrum does not have to be concave. The fact that we do obtain a perfectly concave spectrum is thus already an important piece of information.

We end this section with the multifractal analysis of a real world signal, namely an Internet traffic log. It has been discovered (see reference (4)) that Internet traffic does exhibit, in certain conditions, a strong multifractal behaviour. Although the mechanisms behind this are not yet completely understood, this fact yields interesting information on the structure of Internet traffic and on its small scale behaviour. We shall analyze here the data called traffic.txt that you will find in the DATA directory that comes with the Fraclab release. Load first these data into Fraclab: Press the Load button in the main window. A new window appears, showing the files of your current directory. Change directory to the DATA directory. Choose the file called traffic.txt by clicking on it. Its name is then displayed at the top of the window, in the Name: box. Since this file is plain text, click on the button to the right of Load as:, and select the item ASCII. Then press Load, and Close the loading window. The traffic.txt file should appear in your Variables list of the main window, under the name ftraffic. View this signal, and notice how irregular it is. This is a high frequency log of a TCP trace. More precisely, the values in this graph corresponds to the number of packets that went through a gateway at the French CNET during successive very short periods of time. Since all ordinates must be positive, it is natural to treat these data as a measure. In that view, we need to normalize it, so that the "total mass" is one. To do this, type n_traffic = ftraffic/sum(ftraffic); in the matlab window, and import n_traffic in Fraclab: Hit Scan Workspace and select n_traffic in the windows that appears. Click on Import and close that window. You may view n_traffic to check that it is the same as f_traffic except the scale in ordinate has been divided roughly by 10^8. Now go to 1D signals Multifractal Spectra/Measures/Large deviation Spectrum/Basic parameters. You'll get the output mcfg1d_n_traffic0. View it. You'll see that the estimated spectrum is not concave (compare with the ones obtained above on the synthetic signals). Indeed, there is a small but noticeable "bump" on the increasing part of the spectrum. As a consequence, this estimate looks like a superposition of two "basic" spectra, i.e. spectra like the ones of a multinomial measure. This can be taken as an indication that we have here (at least) two different phenomena. This view is further supported by a more refined analysis: Indeed, if one separates the above aggregated traffic into an incoming traffic and an outgoing one, then one gets that each of these two traffics has a concave spectrum. Multifractal analysis thus allows us in this case to separate the two kinds of traffic on the basis of their high frequency behaviour. We shall not pursue this here, and refer the interested to reference (4).

Finally, recall that another example of the computation and use of a multifractal spectrum on real data (segmentation of an optical image) has been described in the homework section of the help file Overview and main functionalities of Fraclab.


Next Previous Contents