Feeds:
Posts
Comments

## Fitting linear models to the excess d/dt-Laplacian denoised volatility

If you want to take a look at the denoised volatility you can just gunzip the file universal-denoised-volatility.csv.gz install R and call

dv<-read.table(“universal-denoised-volatility.csv”,sep=”,”,header=T)
The identities of the stocks are completely obscured which is a good thing because we want to avoid looking at the standard models of types of instruments and focus on volatility as a collective human emotional product.
We want to look at dynamical laws.  So let’s calculate (d/dt-Laplacian).  Now these series are actually denoised of Laplacian eigenvectors, so
(d/dt – Laplacian) u = d/dt u – diag(lambda_1,…,lambda_n) * u
So we just use the eigenvalues here.
excess<-diff(dv) – diag(E\$value)%*%dv
Now we are ready to fit the excess by some linear models.  In Hastie, Tibshirani, and Friedman’s book there is a chapter on flexible linear models.  So what we need are polynomials in dv and its gradient and possibly also some powers to fit.  We will then check residuals of the fits.  I need some time to organize some fitting code in the next hours.
A decent model that has the chance of giving us behaviour of the PDE in some form we might like is given by

log(excess) = a + b*abs(log(u)) + c*abs(log(grad(u))) + noise
This model captures power law behaviour of convection term in the quasilinear parabolic PDE on R^d, and we have no idea if this is the right direction till we see the residuals and the goodness of linear model fit.  This is easy to fit standard least squares.
In R, this is accomplished simply by the lm() function.
uterm<-log(dv)
graduterm<-log(gradient(dv)) #where gradient is to be defined
Then we call
fit<-lm( log(excess) ~ 1 + uterm + graduterm)

print(fit)
And then we can get the residuals from the fit object and check R-suared and F statistics all standard stuff.  So that is the schematic first pass that gets to a PDE on volatility.

Sir, I will attempt to get this process cleaned up as soon as possible because then we can actually have a way of deciding whether the denoising strategy is good with a quantitative method: checking the goodness of fit.

Now the residuals can also tell us what might be wrong with the model.

Advertisements