Wolfram Library Archive

All Collections Articles Books Conference Proceedings
Courseware Demos MathSource Technical Notes
Title Downloads

Density Functional Stock Forecasting and American Option pricing compared to Black- Scholes(BS) using Bayesian Markov Monte Carlo Simulation and Wavelet or Fourier or Neural Network Extrapolation with Indicators.

URL: http://Mitochondrally.org
Revision date


A probability Denisty Functional Transform(DFT) is created from the past years stock price chart and the day to day ratios of price magnitude to allow us to estimate accurately the Markov Transition probabilities from one day to the next. The distribution of the number of occurrences or frequencies of the ratios creates the Density Functional. Then we use these to generate 3000 to 4000 paths into the future, with probabilities and ratios for every single day leading each day to the next price, and a most probable path with confidence limits is calculated. The 25,75, and 10,90 and 2,98 % confidence limit pair paths are calculated and displayed. The most probable path is displayed after path integration and with beautiful graphics. A Fourier extrapolation is carried out with Multiple Signal Classification technique (MUSIC) and low frequencies are estimated from a high resolution Fast Fourier Transform(FFT). The magnitude and phase of these root frequencies is calculated with the Discrete Fourier Transform (DFT) from the data and is then extrapolated into the future. This is relatively fast, efficient and accurate as only a small number of root frequencies are really needed to get the form of the data to a high level of approximation. Also for research interest, A novel neural network that uses no backpropagation but a functional insight and random perturbations that is faster and more accurate than backpropagation can be used as welll. A Wavelet extrapolation is calculated from computing the wavelets of the data, and then at each level, doing a Fourier extrapolation of the wavelet coefficients. This is thw Wavelet Functional Theory(WFT). WFT is less accurate than Fourier Extrapolation and more computationally complicated. Usually only the Fourier extrapolation and the Path integral Markov Monte Carlo Simulation is performed and this takes about 2 minutes and 20 seconds for 1 years data and a 6 month lookahead. Another breakthrough was the conception of the Integrated Price-Volume Action, which is a novel indicator chart called the Accumulation that shows if price and volume have been increasing together over the past year or have been declining or have been moving at odds with each other. Forecasting this chart with Markov Monte Carlo Path Integration and Fourier Extrapolation is also done, and it is a more realiable indicator of future performance than the analysis on the price chart alone! These methods allow us to accurately predict the true value of profit from a Call or a Put, and give confidence limits as well. The most probable statistical win percentage per day is calculated from the most probable call-put ratio per day. All the other normal traditional indicators are calculated as well and 4 legs can be calculated at once to try different call-put strategies, like strangles and iron condors. With this tool, you might find yourself relying on a bare call or put more often as you will know the probability of success. The Kelly criterion is calculated, and this automatically gives you the right amount of your purse to bet on a given strategy based on the odds of winning! Other work that i have worked on has to do with saving the oceans and creating an engine or power plant that emits no CO2 with SynGas, check out Ocean Acidity Climate Shock article at: http://www.thenakedscientists.com/forum/index.php?topic=6013 2.msg484012#msg484012 At the Science Forum at the University of Cambridge in England! See also for reference, past work: https://www.greenparty.c a/sites/default/files/picketfence.pdf See also implementation in MATLAB for comparison: https://www.mathwo rks.com/matlabcentral/profile/authors/1738497-richard-belshaw

All the relevant indicators are displayed for a timely and a long or short term investment decision based on the probability of success both in terms of the most probable path into the future and in terms of all paths into the future. In that sense this is a path integration technique that employs Bayesian and Markov thinking with a multi path Monte Carlo simulation. Alternatively Fourier Extrapolation or Wavelet Extrapolation or Neural Network training and extrapolation are also employed. Novelly, the Nets use no backpropagation and when they work they find the phase, amplitude and frequency of the main cycles more accurately than backpropagation (they find a better global minimum solution). They work about 90% of the time, and need to be rerun until the output makes sense. You will generally get slightly varying local minima each time so expect the answer to be a bit different each time from the neural nets. The probable answer and confidence limits are always unequivocal for the monte carlo simulation (the blue path and red confidence limits). The Wavelet and Fourier extropolations are also unequivocal. To Train the nets set optionflag=1 and the program will save the weights in OutOptions2.txt in the directory of your choice. To run the program once the weights are trained for different spot prices and expiry dates or different inflation or interest rates or dividend rates, set optionflag=0. If you do not wish to use the neural nets set optionflag= negative one=-1 for just the Bayesian Markov Monte Carlo Simulation or set optionflag =2 for the path Simulation and default Fourier Extrapolation wihich is the fastest and most accurate. If optionflag=3, a wavelet extrapolation and discretewavelettransform using Biorthogonalsplinewavelet[4,2] as the default. The simulation is also carried out for comparison purposes and full statistical analysis of all paths. If you wish to see the progress of the evaluation set debugflag=1. Alternatively set debugflag=0 which is the default and runs quite faster. Without the neural nets the program evaluates in 2-3 minutes depending on the length of time to expiration of the option, the lookback period and the time to expiry of the option. With the neural nets it runs in under 11 minutes on a modern PC. 3GHz intel 7 processor with 4 cores. If catastropheflag =1, a multi hour computation is carried out on an ETF or index like the "SP500" to determine the daily probability of level crossing into the future. The levels are the ratio of the next day to the previous day price. and the images are the probability of crossing the level per day with ratios of.4,.5,.6,.7,.8,.9 and also 1.1,1.2,1.3,1.4,1.5,1.6 this can take up to a 9 hours to compute. Normally catastropheflag must be set to zero for normal stock analysis. It can be run on a supercomputer to really speed things up.The simulation can be parallized if that is wished but would take a bit of work. the key routines involved would be generateMagPhase , calculateFutureValues and CalculateConfLevels and NeuralNet1. Because of the different and varied results offered by the neural nets and that they fail some of the time, no evaluation of the option price is based on them. The unequivocal answers of the Monte Carlo simulation and the confidence limits of between 1000 and 4096 or more paths into the future are calculated and the results are reliable. Also so are the Wavelet and Fourier extrapolation (optionflag =3 and optionflag=2 respectively). and option values are calculated on the wavelet and fourier results aswell. These can be compared with the Black-Scholes calculation shown at the bottom of each output panel. Periodicities in the time series are not well predicted by the Monte Carlo Simulation, however theWavelet Extrapolation and Fourier Extrapolation anMd Neural Nets do a good job of predicting the lows and the highs. The nets are reliable enough to be included for the expert to evaluate and the Wavelet and Fourier results are yielded everytime. The expert can make a rational judgment about the nature of the periodicities (phase, amplitude and frequency) of the cycles in the time series. To get Wavelet extrapolation, Fourier Extrapolation Neural Nets and Bayesian Markov Path integration use OptionsHospitality3Alpha11.nb you will need the Wavelet module available in Mathematica for this. To use the program without wavelet module, but with fourier extrapolation and neural nets aswell as the Bayesian Markov Monte Carlo Path Integration, use OptionsHospitality3alpha9.nb OTHER AUTHORS: Michael Kelly helped debug the intial code. The idea and concept and design are the original authors. . with input from Sornette et al were used in evaluating the extreme values of a distribution with fat tails.

Program OptionsHospitality3Alpha16.nb compatible with Mathematica 11.0.1

*Business and Economics > Finance

Time Series, Bayesian, Markov, Monte Carlo Simulation, Wavelet Extrapolation, Fourier Extrapolation, Neural, Networks, Stock Forecasting, American Option Pricing
Downloads Download Wolfram CDF Player

OptionsHospitality3Alpha21.nb (12.2 MB) - Mathematica Notebook