Student’s T Random Walks

A few 2D random walks with magnitudes drawn from the Student’s T distribution. The distributions become progressively more fat-tailed further down the page. Graphs can zoom and pan. Zooming is really instructive with respect to the fat-tailed dynamics. Much of the micro detail is lost at the scale of the largest jumps — zooming in reveals just how large the rare jumps are relative to the ‘typical’ ones.

Antifragile Random Walks

A million timesteps with a Pareto distribution with $latex \alpha =1 $ and mode shifted down to $latex -11 $ from $latex 1 $. Notice how for most time steps, the walk moves downward. However, the rarer upticks are large, orders of magnitude larger than downward movements.

In [1]:
T = 1000000
X = np.zeros(T)

for i in range(5):
    for t in range(T-1):
        X[t+1] = X[t] + np.random.pareto(1) - 12

    plt.plot(X)
    plt.show()

Cauchy Random Walks, 2D and 3D

1 million steps, with step size determined by a Cauchy distribution, and angle(s) by a flat distribution.

In [1]:
T = 1000000
X = np.zeros((T,2))

figsize(10,10)

for t in range(T-1):
    stepSize = np.random.standard_cauchy()
    direction = np.random.rand()*2*math.pi
    xStep, yStep = cos(direction)*stepSize, sin(direction)*stepSize
    X[t+1,0] = X[t,0] + xStep
    X[t+1,1] = X[t,1] + yStep
    
plt.plot(X[:,0],X[:,1],lw=2)
plt.show()
In [2]:
X = np.zeros((T,3))

for t in range(T-1):
    stepSize = np.random.standard_cauchy()
    direction1 = np.random.rand()*2*math.pi
    direction2 = np.random.rand()*2*math.pi

    xStep = cos(direction2)*cos(direction1)*stepSize
    yStep = sin(direction1)*stepSize
    zStep = sin(direction2)*cos(direction1)*stepSize
    
    X[t+1,0] = X[t,0] + xStep
    X[t+1,1] = X[t,1] + yStep
    X[t+1,2] = X[t,2] + zStep
    
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')  
ax.plot(X[:,0],X[:,1],X[:,2])
frame1 = plt.gca()
frame1.axes.set_xticklabels([])
frame1.axes.set_yticklabels([])
frame1.axes.set_zticklabels([])

plt.show()