Mathestate Logo

 

Volatility Model

Our theory of markets is derived from the continuous double auction model (CDA), with the requirement that the buy and sell limit order books organize the prices in a manner that each has a heavy power tail.  With the CDA model, price movements occur when there is a mismatch between buy and sell market orders; the excess orders are then filled from the appropriate limit order book.  If the limit order books have price differences with spacing that will yield heavy tailed returns when executed, and if the events in the market place are independent, then by the generalized central limit theorem (GCLT) sums of the returns will converge to a stable distribution.  We have further shown that a pure power tail random variable can arise from taking the exponent of an exponential random variable.  For all this to be useful, we need a few more assumptions.  First it would be nice if the exponent of the power tail distribution in the order books remained constant or nearly constant for a given security over time.  It would be speed convergence if the two tail exponents were equal, but this is not a necessary feature for stable distributions to arise from the model.  There must also be enough transactions for the sums to begin to converge to a stable regime; how many transactions are needed is uncertain for it seems that there is convergence to a distribution that we cannot distinguish from stable with relatively few sums.  To get a stable distribution with the same tail exponent as the distributions from which the sums arise, does take a large number of sums.

For the model below we assume that the tail exponent is constant and we further assume that β is determined by the relative ratios of how many unmatched market orders are filled in each of the limit order books.  We assume this to be constant, but it need not be.  With all the assumptions above sums of returns will by the GCLT converge to stable distributions.

On the Market Data Fitting page, we proposed that actual stock market returns could be modeled by a non-stationary stable distribution model where the scale factor was continually varying, with patterns that showed serial dependence.  We now study that idea with pseudo-random stable data.  We will take a large random sample generated with known parameters and modulated with known functions; then see how well we can recover the original parameters.

Using the SPY intraday minute by minute data we saw that there was a pattern to the intraday trading.  The very first return of the day is actually not a minute return, but the return from the previous close, so it has a much larger scale factor than the minute by minute returns during the day.  The rest of these returns tend to a cycle of higher volatility at the beginning and end of the day and a low point mid day.  For our example we use a parabolic function.

VolatilityModel_1.gif

We have purposely adjusted this intraday scale factor so it will have a mean of one so we can show graphs of the recovered function without rescaling.  The first return has a very large scale factor, but all the other minute returns throughout the day have a smoothly changing scale factor.

Below we create another function to model the variation of day to day volatility.  We use summed trigonometric functions for our known function.  This is smoothly varying as we might expect for day to day volatility in the market place.  We choose a daily scale factor from this function.

VolatilityModel_2.gif

VolatilityModel_3.gif

We have again set the mean of this function to one, so we will be multiplying by functions with an average scale of one.  This is not needed for the model, but is done purposely because our scaling function adjusts to a stable scale factor of one and we want to test its performance.

Next we create a stable random sample of size 98,532 corresponding to 252 trading days each containing 390 minute intervals plus 1 interday interval.  The starting parameters are {α, β, γ, δ} = {1.8, -0.1, 1, 0}.

VolatilityModel_4.gif

VolatilityModel_5.gif

To give the final distribution parameters similar to the real life SPY data we multiply by the factor below.

VolatilityModel_6.gif

VolatilityModel_7.gif

The plot below shows the data rescaled with the varying scale model.  The intraday cycle is imperceptible, but the higher volatility of the daily volatility function can be seen at the beginning of the series, volatility then falls and rises at the end of the series--very much like real market data.

Graphics:Simulated Market Returns

The autocorrelation plot of the absolute value of each data point shows the serial dependent structure that we have created along with the intraday cycle and the spike between each day's cycle.  

Graphics:Autocorrelation Function Abs[LogReturn] - 50 Day Lag

If we fit this data sample as if it were drawn from a stationary stable distribution, we find exactly the same phenomenon that we observed with actual market data.  Alpha is artificially low and the plot of the tail fit shows that the data tails are lighter than would be predicted by a stable model.

Stable parameters
{1.5879, -0.0484, 0.0002, 0}

Graphics:Log Log Left Tail Blue, Right Red, (Normal Green)

Now we use our scaling method to recover the volatility functions.  First we go after the day to day data.  The plot shows the scale factor data points we get for each point along with our known volatility function  plotted in red.

VolatilityModel_11.gif

But since we know the function with which we started, we can test our accuracy.  We look at the differences between our data points and find that they are approximately normally distributed and have a standard deviation that is about 5% of our mean scaling function

Standard Deviation Errors: 0.04846370661524439

Mean Scaled Errors: 0.9714122058379646

Mean Volatility Function: 1.

Now we look at the autocorrelation function with the day to day volatility removed and find that we have left the intraday cycle.

Graphics:Autocorrelation Function Abs[LogReturn] - 15 Day Lag

Next we recover the intraday scale function.  The known function is in red and the recovered points in blue.

VolatilityModel_13.gif

Graphics:LogReturns with Serial Dependence Structure Removed

The fully rescaled data is shown above and the autocorrelation function of the absolute value of the simulated returns is below, no trace of the serial dependence functions remain.

VolatilityModel_15.gif

We fit the data and recover the original α and β with surprising accuracy.  The plot of the fit shows true stable tails.

Stable parameters
{1.8094, -0.1237, 1.003, -0.0034}

Graphics:Log Log Left Tail Blue, Right Red, (Normal Green)

Here is the fit to the original data before the volatility model was superimposed on it.  The result is virtually the same.

Stable parameters
{1.8124, -0.1327, 1.0024, -0.0049}

Graphics:Log Log Left Tail Blue, Right Red, (Normal Green)

We took a stable random sample containing nearly a hundred thousand points and multiplied every point in the sample by a serially dependent structure.  With knowledge of stable scaling functions we were able to accurately recover the original parameters.  In the model we have ignored the stable δ parameter; there are several reasons for this.  On a minute by minute basis the value will be so small that we cannot likely detect it accurately.  While the market system might build in an expectation of inflation and inflation adjusted return, we suspect that it would always be changing.  Stock prices seem to be adjusted for these factors when the companies report their quarterly earnings.  Thus long range expectations need not be included in the market model.

VolatilityModel_18.gif



© Copyright 2008 mathestate    Fri 22 Feb 2008