From: sadasd on 13 Apr 2010 13:33 Hello vo quang ha, Did you manage to fix this problem?
From: Roger Stafford on 14 Apr 2010 21:20 "vo quang ha" <voquangha2003(a)yahoo.com> wrote in message <hn4k9d$278$1(a)fred.mathworks.com>... > I have tried calculating a fractal dimension (FD) trace using Higuchi's algorithm .In Theory,FD must be between 1-2 .My problem is: sometimes, when I run my code , the FD is greater than 2 .Have u ever met this situation before?can u give me some advise ?Thks so much > My code: > function higuchi(data,windowsize,kmax) > ....... ----------------- Hello, Vo Quang Ha and Sadasd. I have checked out the 'higuchi' code and can find nothing in it that would cause errors. There are things you could do that would make the code a little more robust by such things as 1. replacing L_mean(k) = mean(nonzeros(L(:,k))); with L_mean(k) = mean(L(1:k,k)); There is no need for it to be searching for non-zeros when you already know the range of rows in L that need to be covered. 2. You could also allocate L a definite amount of space early on rather than just clearing it initially and then letting it build up one column at a time. Just do: L = zeros(kmax); 3. There are three lines that don't do anything useful involving 'a', 'X', and 'Y'. 4. It is a bad policy to use the name of an already existing matlab function, as in the case of 'trace' - the variable should be called something else. 5. As the code stands, it never processes the last entry in 'data'. You should have for v=1:(length(data)-N+1) tracexx=data(v:v+N-1); As I have indicated, however, in spite of these considerations the code looks basically valid to me. I have made a number of experimental runs with it. When it is faced with data that has some overlying continuity combined with some randome noise, the resulting fractal dimension lies safely within the interval between 1 and 2. However, in the face of pure noise, as for example letting data be generated by the 'rand' function, Df can climb up to and even exceed 2 by small amounts. By feeding in "malicious" data such as almost entirely alternating -1's and +1's, the value of Df can even be forced well above 3. I do not consider that this invalidates the algorithm. Having the fractal dimension lying within [1,2] is only a statistical claim and it is easy to defeat this with aberrant kinds of data irregularities. Roger Stafford
|
Pages: 1 Prev: background of static text Next: 64-bit integer arithmetic |