Simple Economic / Stock price model

Click For Summary

Discussion Overview

The discussion revolves around modeling stock price variations in a virtual stock exchange game. Participants explore different statistical methods and distributions to achieve realistic price movements, addressing challenges related to stability and volatility in the model.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant suggests using daily returns from a standard normal distribution, modified for market-like characteristics.
  • Another participant proposes the Cauchy distribution with a specific scale parameter, referencing Benoit Mandelbrot's work.
  • There is a discussion about simulating trading volumes alongside price movements, with varying ideas on how to incorporate this into the model.
  • A participant mentions the standard methodology of log-normal returns and geometric Brownian motion, noting its common use despite its imperfections.
  • Concerns are raised about the limitations of traditional models, particularly regarding their ability to account for extreme price movements and fat tails.
  • Some participants express interest in the implications of autocorrelation in fat-tailed distributions and how it might be modeled.

Areas of Agreement / Disagreement

Participants express multiple competing views on the best statistical methods for modeling stock prices, with no consensus reached on a single approach. There are differing opinions on the appropriateness of traditional models versus newer methodologies.

Contextual Notes

Participants highlight limitations in existing models, such as the inability to accurately represent extreme market movements and the challenges of incorporating trading volumes into simplistic models.

Who May Find This Useful

This discussion may be useful for individuals interested in financial modeling, game development related to economics, or those exploring statistical methods in market simulations.

trollcast
Gold Member
Messages
282
Reaction score
13
I'm trying to program a simple game with a handful of fictious companies on a virtual stock exchange that is semi realistic with price variations and trends over time.

However I made a quick test using random functions and probabilities to produce the variations but I can't seem to strike a balance between stability (then the price just stays fairly constant and doesn't vary much) or instability where the price goes crazy.

Now its definitely a programming error but instead of guessing at what I need to change to get it to work I was wondering if there were any simple formulae or something that would be adequate to get a semi realistic price variation in the program?
 
Physics news on Phys.org
You might want to pick, e.g. daily returns from a standard normal distribution, then apply these to a random starting price to generate realistic-looking returns. To make the returns more like actual market returns, you should alter the standard normal distribution to one with a skinnier bell and fatter tails.
 
Use Cauchy distribution for the returns with a scale (gamma) of 1.7, it's the distribution Benoit Mandelbrot suggests.

By the way, will you simulate the volumes as well? I'd be very interested to see your program if you put it with volumes, since I guess then many differences will appear between the modeled prices and volumes and real ones.
 
Tosh5457 said:
Use Cauchy distribution for the returns with a scale (gamma) of 1.7, it's the distribution Benoit Mandelbrot suggests.

By the way, will you simulate the volumes as well? I'd be very interested to see your program if you put it with volumes, since I guess then many differences will appear between the modeled prices and volumes and real ones.

How I'm planning to model it is:

I'm creating a class called Company that has a shareprice, buyprice and sellprice (I was going to just work out the buy and sell by going say 1% above for the buy and 1% below the shareprice for sell.

So the program will create a couple of instances of Company and set them a share price.

Now I want to work out how is the best way to move the shareprice on each time step to simulate how share prices vary in real life.

Not sure how I could include volumes into that simplistic model, maybe if I set each company a fixed number of shares?
 
Not sure how I could include volumes into that simplistic model, maybe if I set each company a fixed number of shares?

Yes, and if you want it more realistically, put a small chance (like 0.001%) in each timestep that the numbers of share duplicate. I don't know how to model volumes though, I never looked at their distribution...
 
The standard methodology is log normal returns/ geometric Brownian motion

http://en.wikipedia.org/wiki/Geometric_Brownian_motion

No one really uses levy stable distributions as the fat tails have an auto correlating component. Stochastic, trending volatility such as GARCH is most typically uemployed
 
I think I'll keep updating this thread to show the progress I'm making with this.

Just playing around with a random uniform distribution to start with has produced some quite good trends but its not very consistent:

eg.
attachment.php?attachmentid=57229&stc=1&d=1364518939.jpg


attachment.php?attachmentid=57230&stc=1&d=1364518939.jpg


But the prices are far too volatile and well random to be honest, also there's quite a few runs of it that doesn't produce a good trend as the price just tends to zero.

Its just a quick mock up in python with matplotlib and the 2 different libs just represent 2 different runs of the generator.
 

Attachments

  • eg.jpeg
    eg.jpeg
    27 KB · Views: 824
  • eg2.jpeg
    eg2.jpeg
    24.6 KB · Views: 805
BWV said:
The standard methodology is log normal returns/ geometric Brownian motion

http://en.wikipedia.org/wiki/Geometric_Brownian_motion

No one really uses levy stable distributions as the fat tails have an auto correlating component. Stochastic, trending volatility such as GARCH is most typically uemployed

I took a graduate financial modeling class, and it was just as BWV said. Geometric Brownian motion is known to be an imperfect model of real stocks, but it's a good start. It's also the model used to derive the famous Black-Scholes equation.

If you want to write your own stochastic numerical solver, consider the Euler-Maruyama method. It's based on the Euler method for numerical integration. It has similar properties, too - it's relatively intuitive and easy to code, but its accuracy and stability are pretty bad.
 
I know the standard practice is using the normal distribution for the returns, but extreme movements are much much rarer in that case that in reality. In an era where we can use powerful computing and our knowledge of Mathematics is vast, I don't see the point in insisting of using a wrong model. The only reason it's still used for option valuation it's because of the properties of the normal distribution, that others don't have, such as finite variance.
Indeed the autocorrelation of the fat tails is a problem about using Cauchy distribution, but you could introduce that autocorrelation when extreme movements happen.
 

Similar threads

  • · Replies 24 ·
Replies
24
Views
4K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 31 ·
2
Replies
31
Views
9K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
6
Views
3K
  • · Replies 3 ·
Replies
3
Views
5K
Replies
4
Views
9K