mport pandas as pd
import numpy as np
v=pd.DataFrame.from_csv(‘volatility.csv’,header=0,sep=’,’).as_matrix()
def diff(x):
v = np.zeros(x.shape)
dx=np.diff(x)
v[1:]=dx
return(v)
def ito_density(x):
v = diff(x**2x[0]**2 – 2*np.cumsum(x*diff(x)))
return(v)
ito=np.zeros((13434,1899))
for i in range(1899):
ito[:,i]=ito_density(v[:,i])
import matplotlib.pyplot as plt
def itoplot(n):
p=plt.plot(ito[:,n])
plt.show()
from matplotlib.backends.backend_pdf import PdfPages
with PdfPages(‘itodensities.pdf’) as pdf:
for k in range(1899):
plt.figure()
plt.plot(ito[:,k])
plt.title(‘Ito density %d’%k)
pdf.savefig()
plt.close()

5:11 PM (2 hours ago)



In order to make immediate progress with new but not very incisive (as in discovering phase transition mechanisms in empirical volatility) we consider a much easier problem that is easy to complete:
The problem is to determine the Ito density of empirical volatility series for 1900 stocks. The solution is to consider the Ito formula generalized:
f(X_t) – f(X_0) = \int_0^t f(X_s) dX_s + 1/2 \int_0^t f”(X_s) phi(s) ds
and use the function f(x)=x^2 to determine the empirical phi(s) which is a power of s for fractional Brownian motions and 1 for Brownian motion. >>> def diff(x):
So these are unsatisfactory but useful intermediate results.
Well I will check now the code more carefully. But this is a bit surprising. Instead of obtaining a smooth Ito density we get a complex spectrum.

7:49 PM (0 minutes ago)



The pdf with the Ito densities are here:
This could be good news, telling us that volatility series should be modeled not a stochastic process but as a deterministic process with fractional Poisson shocks or purely deterministic on a network with fractional Poisson noise.
Preview attachment itodensities.pdf
Leave a Reply