Scaled Stable Probability Calculation
Introduction
This program sets up a mathematical model to deal with the problem that financial data does not appear to belong to a stationary distribution. Consequently the tail behavior of the distribution cannot be reliably determined by the raw data. The method builds upon the fact that a fit of raw data to a stable distribution gets a pretty good fit except on the tails. The hypothesis is that financial data might be in a stable domain of attraction, but that the scale factor of the distribution is regularly changing. When one looks at the scale factor over time it appears to change with significant serial dependence. The strategy is to take advantage of the dependent structure and calculate the scale factor over blocks of 30 trading days, then adjust the return data to remove the variation in scaling.
The program starts with the most recent ten year daily history of a stock price, if the program is run during the trading day, it also picks up the most recent price for the current day, which for U.S. markets is delayed by about 15 minutes. This small delay will not affect price calculations days or weeks into the future. Logarithmic returns are calculated and fit to a stable distribution after correcting for variable scaling over time to obtain a closer fit to the data. The raw fit to the data is also calculated. Price probability calculations for both methods scaling the distribution from one to 64 trading days into the future. The calculations are based on the most recent price and recent scaling for the adjusted data and the calculated scale parameter for the raw data. Since future scaling may be different, the program allows you to adjust the calculated scale factor for the interval by multiplying it by a factor ranging from 1/2 to 2.
Keyboard
Use keyboard below to enter a stock symbol. If you make a mistake simply click Enter and start over, after you click Enter, the symbol is available to the Update button below.
Update
Once you have entered a new symbol, click Update, to update all the graphics below to the new equity. The graph below shows the price chart for the security for the last ten years. If you update with a bad symbol, the entry should not evaluate. You should be able to enter a new symbol and update again. If the program appears to crash after a bad entry, you can recover by closing and reopening it. Click the following link for a reference page to the Mathematica FinancialData function for more information about symbols. Typically the symbols used are the same as those found on the Yahoo financial site.
Log Returns
The graphic below shows the serial log returns for the selected security. These generally show significant clustering of volatility, consistent with a process that has varying scaling.
Sub-Interval Scaling
The chart below shows the stable distribution scale factor for blocks of 30 trading days over the ten years. This generally does not appear to be a stationary parameter over time and it displays serial dependence.
Rescaled Log Returns
The graph below shows the returns in red above, after adjustment for the scale factor over blocks of 30 trading days. The rescaled data appears to belong to a smoother distribution, but there are still large jumps similar to those found in a stable distribution.
Autocorrelation
An autocorrelation plot below shows the unadjusted data in red and the rescaled Absolute[log returns] in blue. Generally rescaling will greatly reduce the appearance of serial dependence in the data.
Probability Calculation
The graphic below shows a price probability chart at a future number of trading days. The stable fit is obtained from the either raw or the rescaled data. The parameters are then adjusted to the most recent scale factor in the green chart above for the rescaled data or from the calculated scale parameter for the raw data. Moving the Trading Days slider will further adjust the scaling for up to 64 trading days in the future. The major assumption in this is that the scale factor will remain stationary. Since that assumption will most likely be false, the next Scale γ slider allows you to predict the future scaling by multiplying the calculated scaling by a factor ranging from 1/2 to 2. This should be done with caution. If you are looking only a few days into the future the probability that the scaling will change significantly is small. If you are looking a month or two into the future, then you want to adjust it by a factor which will change it to the average scale factor of the interval you are interested in. The calculation that you are obtaining is a probability of what the price will be at the end of the interval. It may be much higher or lower before the end of the interval. Since stable distributions are subject to large jumps, the further into the future you try to carry your prediction, the less reliable it becomes. Practically it seems to work reasonably well with trading intervals up to 21 trading days or a about a month. Intervals of a week and a month are bookmarked and can be accessed by clicking the icon in the upper right corner.
If you click on the graph at a price level (only the price coordinate is considered when you click), you will be shown the price and cumulative probability of price point on the graph. You can reclick as many times as you like to see the numeric data for the whole curve.
The stable parameters are shown as {α, β, γ, δ}, where α is the shape parameter which determines the tail behavior, β is the skewness parameter, γ is the scale parameter, and δ is the location parameter which gives the expectation of the distribution.
Fitting market returns to a stable distribution usually gives a good fit to the center of the distribution, but not such a good fit to the tails. Usually the heaviness of the tails is overestimated by the stable fit to raw log returns, with lower α than is obtained with rescaled returns. To better understand these plots it will be helpful to download the modules, TailBehavior, and StableTailBehavior and study them.
The graph below shows the fit and parameters to the rescaled returns. This fit is usually much better on the tails, with significantly higher α. The scale factor is now close to 1. In the probability chart, the γ and δ parameters are adjusted to the most recent 30 day scale parameter.
Do not use this program for investing without fully understanding and testing it. It comes as is with no waranty as to its accuracy, and it has not been tested in any prospective trial. It has been developed to provoke new thinking about financial market models.
Comments about this document or error reports would be greatly appreciated, please email mathestate@gmail.com. More information about the computable document format can be found at http://www.wolfram.com/cdf/.
This document’s home page: ScaledStableProbability.
mathestate ComputableDocumentFormat page.
Download this page as a computable document.
© Copyright 2011 Robert H. Rimmer 24 July 2011