This question https://www.quora.com/What-is-an-intuitive-explanation-of-Monte-Carlo-simulations gives intuitive explanation for monte carlo :
Another example I ran into recently was modeling the effects of monthly cashflows on an investment portfolio. I knew the average return and variance of the portfolio, so I could build a MCS to help me understand how the timing of cashflows effected the goal of staying above a critical account value.
In https://www.youtube.com/watch?v=3gcLRU24-w0&feature=youtu.be monte carlo is defined as :
This is in the context of an asset price but I assume this can generalized for prices of any value ?
For my simple dataset I define 3 return values :
2 , 6 , 7
Periodic Daily Return = natural logarithm(todays return / yesterdays return)
This is defined at point 10:23 in https://www.youtube.com/watch?v=3gcLRU24-w0&feature=youtu.be
So for each value in dataset the 'periodic daily return' is calculated as (Assuming initial closing price is 1
ln(2/1) ) :
ln(2/1)=.3 , ln(6/2)=1.4 , ln(7/6)=.2
Standard deviation : https://en.wikipedia.org/wiki/Standard_deviation
Variance : https://en.wikipedia.org/wiki/Standard_deviation in section 'Basic Examples'
Variance is defined as deviations of each data point from the mean, and square the result , variance is the mean of results.
Based on above this is how I implement monte carlo for simple example
average(Periodic Daily Return) = (.3 + 1.4 + .2) / 3 = .6 variance(Periodic Daily Return) = ((2-.6)^2 + (6-.6)^2 + (7-.6)^2) / 3 = (2+29+41)/3=24 standard-deviation(Periodic Daily Return) = squareRoot(24) = 5 drift(Periodic Daily Return) = mean - (variance / 2) = .6 - (24 / 2) = -.11.4
To run a monte carlo simulation of possible returns is this correct.
Possible return = Previous days price * exp(drift + standard-deviation * random(zscore))
zscore = ((Periodic Daily Return) - average(Periodic Daily Return) / standard-deviation(Periodic Daily Return) and random(zscore) is a random standard deviation away from mean.
Geometric brownian motion is defined at http://www.investopedia.com/articles/07/montecarlo.asp as :
The formula for GBM is found below, where "S" is the stock price, "m" (the Greek mu) is the expected return, "s" (Greek sigma) is the standard deviation of returns, "t" is time, and "e" (Greek epsilon) is the random variable:
This post provides an alternative definition to geometric brownian motion : https://quant.stackexchange.com/questions/4589/how-to-simulate-stock-prices-with-a-geometric-brownian-motion