PDA

View Full Version : help with detrended fluctuatin analysis



anne durande
10-08-2023, 08:17 AM
Hi
I an a new vba'user , and I tried to caculate DFA (detrended fluctutation analysis) on time series
I put a white noise in a column, and I developed a VBA code, but it did not work ......
hopefully , someone could help me
Thanks
You will find excel files and article method in pdf (https://libstore.ugent.be/fulltxt/RUG01/002/790/887/RUG01-002790887_2019_0001_AC.pdf)

Anne

31099

Paul_Hossler
10-08-2023, 08:28 AM
but it did not work ......

is a little bit fuzzy. What didn't work?

Also is your 'End Sub' in the wrong place?




' Calculer la série temporelle y_i = ?(a_i - moyenne(a))
For i = 1 To n
' Calculer la série y_i en utilisant la somme cumulative des différences
If i = 1 Then
newY(i) = diff(i)
Else
newY(i) = newY(i - 1) + diff(i)
End If
' Afficher la série temporelle y_i dans la colonne C de la feuille Excel
ws.Cells(i + 1, 3).Value = newY(i)
Next i
End Sub ' <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<


' Définir les tailles des boîtes
boiteTailles = Array(250, 500, 1000, 1500)



Do you want the formulas in this section only?

31100

anne durande
10-08-2023, 08:49 AM
Hi,
The macro does not execute when I run it.
All the formulas in the paper, you show, are in the vbamacro
Now I want to run it to see whether it works, and the potential problem, I know what I should obtain, I just need to control
Anne

Paul_Hossler
10-08-2023, 09:02 AM
31101

Go to Debug, Compile and fix any errors that it finds