# Lognormal distribution



## SmithyB (28 April 2015)

Hi All,

I was doing some research as to what type of probability distribution was the best use when trying to predict a stocks price for over a certain time period.

My research has led me to believe that a lognormal distribution is the most widely used distribution model for such purposes. 

I have attached the equation for the lognormal distribution formula.

What I want to know is that how do I calculate the mean and the standard deviation of a lognormal distribution.

When I was researching this I received conflicting information I would really appreciate it if someone can point out me to the right direction.

Thanks in advance


----------



## DeepState (28 April 2015)

SmithyB said:


> Hi All,
> 
> I was doing some research as to what type of probability distribution was the best use when trying to predict a stocks price for over a certain time period.
> 
> ...




Starting from a non-stationary series (like, say, stock prices) calculate periodic returns.
r(t,t+1) = P(t+1)/P(t)-1

Lognormal returns will be
logRet(t,t+1) = ln[r(t+1,t)+1]  note: I have added the 1 back in within the brackets. "ln" is the natural log operator.

The mean of the distribution is then the arithmetic average of these logRet figures.
The standard deviation of the distribution is also then the straight up calculation, but based on the logRet figures instead of the raw return figures.

All the best with it.


----------



## SmithyB (28 April 2015)

Hello,

does that mean that the above equation I have for the probability density function of the lognormal distribution is incorrect.

Also I understood the standard deviation calculation to be different based on the website below.

https://creprep.wordpress.com/2012/08/04/calculating-lognormal-distribution-parameters/.

Can you please gat back to me.

Thanks


----------



## DeepState (28 April 2015)

SmithyB said:


> Hello,
> 
> does that mean that the above equation I have for the probability density function of the lognormal distribution is incorrect.
> 
> ...




1. The pdf is correct.  
2. The web site you provided has a formulation for the stdev which is as I have stated.  

Take the logRet(t,t+1) observations as your data points and then calculate the sample standard deviation from these using the standard formulation.

In the example, you will see that the time-to-fail was log adjusted first and then fed in to the standard deviation formula. Replace time-to-fail with P(t+1)/P(t) and everything proceeds accordingly.

As you proceed through this, despite the lognormal being the most used distribution in describing return patterns, please be aware that the underlying assumptions to this are known to be wrong.  This will become apparent as you experiment with this and get to know it better with time.  Meanwhile, just be careful with how hard you are pushing whatever application you plan on using this for.


----------



## SmithyB (29 April 2015)

DeepState said:


> As you proceed through this, despite the lognormal being the most used distribution in describing return patterns, please be aware that the underlying assumptions to this are known to be wrong.  This will become apparent as you experiment with this and get to know it better with time.  Meanwhile, just be careful with how hard you are pushing whatever application you plan on using this for.




If the lognormal distribution is is not the best model to accurately predict stock prices within a time frame then what should I be using?

Can you please point me to the right direction.

Thanks in advance


----------



## DeepState (29 April 2015)

SmithyB said:


> If the lognormal distribution is is not the best model to accurately predict stock prices within a time frame then what should I be using?
> 
> Can you please point me to the right direction.
> 
> Thanks in advance




In order to direct you in the right direction, I need to know where you are trying to get to.

How were you planning on using a lognormal distribution 'to accurately predict stock prices within a time frame'?


----------



## luutzu (29 April 2015)

SmithyB said:


> If the lognormal distribution is is not the best model to accurately predict stock prices within a time frame then what should I be using?
> 
> Can you please point me to the right direction.
> 
> Thanks in advance




you're trying to work out the distribution under the lognormal curve right? Finding its area under x standard deviation, then plug in a share price or some figure and it returns the probability of that happening, yes?

I've done this with just the normal curve whereI just look up what's the mean and sd for a normal curve... maybe the same approach could apply here. Just look up what's the mean and sd for this standard log curve, plug it into your excel function or some library you could download with your programming language.

Or if the curve is specific to that index/stock, look up how to find the mean etc. given the curve before plugging in the data to get its probabilities.


----------



## Triathlete (29 April 2015)

SmithyB said:


> If the lognormal distribution is is not the best model to accurately predict stock prices within a time frame then what should I be using?
> 
> Can you please point me to the right direction.
> 
> Thanks in advance




I use a combination of price, pattern and time extensions to have some idea where stock prices are today and where they are likely to go  into the future whether that be up or down.

These principle are based on W D GANN Studies.


----------



## SmithyB (29 April 2015)

Hello

The attached is a graph that I got from the web, this is of what I am trying to achieve.

This graph shows the price probability of GE stock price in 10 weeks.

I am trying to do the same.

Thanks in advance


----------



## DeepState (29 April 2015)

SmithyB said:


> Hello
> 
> The attached is a graph that I got from the web, this is of what I am trying to achieve.
> 
> ...




For that to be useful, you'd need to have a good forecast of the mean and standard deviation of the future 10-week distribution as described by a lognormal pdf.  Any idea where that might come from?  

Get that right and nothing else matters.


----------



## SmithyB (29 April 2015)

DeepState said:


> For that to be useful, you'd need to have a good forecast of the mean and standard deviation of the future 10-week distribution as described by a lognormal pdf.  Any idea where that might come from?
> 
> Get that right and nothing else matters.




I was under the impression that was the graph I posted earlier was the lognormal pdf and the equation I posted in my first post when I began this thread was the equation for the lognormal pdf.

Anyway how would I go about getting calculating a good forecast of the mean and standard deviation. I was under the impression that if I use the last years closing price to calculate the mean and standard deviation it would be sufficient. 

Can someone please clarify.

Thanks in advance


----------



## DeepState (29 April 2015)

SmithyB said:


> I was under the impression that was the graph I posted earlier was the lognormal pdf and the equation I posted in my first post when I began this thread was the equation for the lognormal pdf.
> 
> Anyway how would I go about getting calculating a good forecast of the mean and standard deviation. I was under the impression that if I use the last years closing price to calculate the mean and standard deviation it would be sufficient.
> 
> ...




The graph and the distribution pdf are lognormal.  That's not in doubt.

As for the rest, at this point, I might defer to others.


----------



## SmithyB (30 April 2015)

Hello,

Since someone in this forum was kind enough to point out to me that I need to forecast the mean and the standard deviation in order to use the pdf of the lognormal accurately.

Can someone please point me in the right direction of how I actually go about forecasting the mean and the standard distribution.

Thanks in advance


----------



## howardbandy (1 May 2015)

Greetings --

I am interested in how a trading system would make use of assuming the price data came from a log-normal distribution.  There are several points that enter into system development related to prices of financial issues that I think are important:

1.  I recommend using the entire distribution.  Knowing the mean and standard deviation does not provide any information about skew or kurtotis.

2.  Even knowing the first four moments does not describe the tails.  (Black swans hide in the tails.)

3.  Financial data is notoriously non-stationary.  Using analysis techniques that assume stationarity when the data is not stationary introduces unfavorable biases -- overestimating profit and underestimating risk.  One of the first tasks is identifying the length of periods over which it is stationary.  Then working with sliding windows of that length.

4.  The data is what it is.  In the end, my trading system must recognize patterns in data as it occurs, then trade prices as they occur, not as samples drawn from a distribution I wish they had come from.

Is this an alternative ---

Gather data that represents actual trades.  Do whatever would have been done using the distribution of actual data in place of the ideal distribution.  For example, compare recent prices with the distribution of actual data and look for patterns that predict price changes in the actual data.

Best regards,
Howard


----------



## DeepState (1 May 2015)

howardbandy said:


> Greetings --
> 
> I am interested in how a trading system would make use of assuming the price data came from a log-normal distribution.




I strongly suspect you know this already, but:

+ Issues relating to higher moments can be overcome via diversification.
+ If we are able to ascertain an accurate enough expected return (or relative return would be sufficient) and covariance matrix, you have the means to produce well considered portfolios which balance off reward for risk.
+ Whilst the risk elements can be more reliably estimated from history, and routinely are, after applying various stabilizing techniques, the quest for a conditional mean useful for money-making above and beyond buy-hold remains very hard.

Observation of outcomes relative to some historical window could be useful in identifying regime change.  Whether that means that a new price trend has formed or not remains open and is fairly specific to the situation.

A question which openly asks where can I get good estimates from for the mean is tantamount to saying how can I figure out which stocks will do well and poorly.  Drawing a mean from historical observation is not entirely without validity given the presence of momentum effects, but it is hardly sufficient. Without a decent answer to that chestnut, application of distributional properties from the lognormal pdf/cdf is really constrained to risk management, options pricing or for efficient markets straw men.


----------



## SmithyB (4 May 2015)

Hi All,

Thank for all your inputs I finally got the lognormal distribution to work.

However 1 thing I noticed is that the it does not take in account any price direction either up or down.

I know this is a stupid question (and I apologise in advance) but is there anyway to incorporate a price direction into the lognormal distribution. I found that when prices are on their way up or down the lognormal distribution results are not very accurate.

Thanks in advance


----------

