You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/hurst.py
+40Lines changed: 40 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -73,6 +73,46 @@ def _(paths):
73
73
return
74
74
75
75
76
+
@app.cell
77
+
def_(mo):
78
+
mo.md(r"""
79
+
### Realized Variance
80
+
81
+
At this point we estimate the standard deviation using the **realized variance** along the path (we use the **scaled** flag so that the standard deviation is scaled by the square-root of time step, in this way it removes the dependency on the time step size).
82
+
The value should be close to the **sigma** of the WeinerProcess defined above.
83
+
""")
84
+
return
85
+
86
+
87
+
@app.cell
88
+
def_(paths):
89
+
float(paths.paths_std(scaled=True)[0])
90
+
91
+
return
92
+
93
+
94
+
@app.cell
95
+
def_(mo):
96
+
mo.md(r"""
97
+
The evaluation of the hurst exponent is done by calculating the variance for several time windows and by fitting a line to the log-log plot of the variance vs the time window.
98
+
""")
99
+
return
100
+
101
+
102
+
@app.cell
103
+
def_(paths):
104
+
paths.hurst_exponent()
105
+
return
106
+
107
+
108
+
@app.cell
109
+
def_(mo):
110
+
mo.md(r"""
111
+
As expected, the Hurst exponent should be close to 0.5, since we have calculated the exponent from the paths of a Weiner process.
0 commit comments