I was inspired to start programming this after reading this article: "Can Asset Bubbles be Mathematically Quantified Before they Burst". A lot of this work is far beyond what I've learned in school and I reached out to a few professors at my university for their help, and I'm not positive I've done it 100% right but I thought it was worth sharing.

In my code I calculate (as suggested in the comments of the article by the author) the Hurst Without Mean Exponent. The author's justification for that was:

 "For all those who are trying to calculate H on your own please keep in mind the following: There are two types of Hurst Exponent that can be calculated: “Hurst with mean”, and “Hurst without mean”. Most algorithms calculate “Hurst with mean”.  This would be appropriate for asking questions like “Is the deviation from average annual rainfall random, or is there some kind of long range memory?” For asset prices we don’t want to know about the deviation around average daily returns, we want to know the deviation in actual price.  For example, if an asset went up 1% every day for a year the deviation from the mean would be 0, and your R/S would be 0.  Despite the R/S being 0, the stock price would have gone up dramatically and I would certainly consider that stock to be in a bubble.The easiest way to fix these algorithms would be to simply set the mean to 0 and then it should give you the appropriate Hurst Exponent."

And then I've also translated the code for a stable alpha distribution from matlab. That would be the next step into making an options pricing model I believe, since the use of a Hurst Exponent, generates an alpha number, which is how we understand what the distribution curve looks like. I'm not too familiar with options pricing models and my idea was to just replace the use of the Normal CDF in the Black Scholes Merton model with the Stable Alpha CDF from the Hurst exponent.

I've been busy with other projects but thought it was worth putting this out there!

Author