Wiener Processes¶
Stochastic Processes¶
A stochastic process is a collection of random variables, indexed by time.
- More simply, it can be thought of as a single random variable that evolves dynamically with time.
- Stochastic processes can be discrete/continuous time: either they evolve discretely or continuously.
- They can be discrete/continuous value: at each time, they are drawn from either a discrete or continuous probability distribution.
- We will develop a continuous time/continuous value model for asset
prices.
- Note that we only observe discrete value and discrete time observations for actual asset prices.
Properties of Expected Value¶
Given random variables \(\smash{X}\) and \(\smash{Y}\), define a new random variable \(\smash{Z = X + Y}\). Then:
Suppose \(\smash{E[X] = E[Y] = \mu}\). Then:
Properties of Expected Value¶
Extending the prior result, given random variables \(\smash{\left\{X_i\right\}_{i=1}^n}\), define a new random variable \(\smash{Z = \sum_{i=1}^n X_i}\). Then:
Suppose \(\smash{E[X_i] = \mu, \,\, i=1,\ldots,n}\). Then:
Properties of Variance¶
Given random variables \(\smash{X}\) and \(\smash{Y}\), define a new random variable \(\smash{Z = X + Y}\). Then:
Suppose \(\smash{Var(X) = Var(Y) = \sigma^2}\) and that they are independent \(\smash{(Cov(X,Y)=0)}\). Then:
Properties of Variance¶
Extending the prior result, given random variables \(\smash{\left\{X_i\right\}_{i=1}^n}\), define a new random variable \(\smash{Z = \sum_{i=1}^n X_i}\). Then:
Suppose \(\smash{Var(X_i) = \sigma^2, \,\, i=1,\ldots,n}\) and that each random variable is independent of the others \(\smash{(Cov(X_i,X_j)=0, \,\, i \neq j)}\). Then:
Normal Random Variables¶
Suppose \(\smash{X_i \sim N(\mu,\sigma), \,\, i=1,\ldots, n}\).
- Define a new random variable \(\smash{Z = \sum_{i=1}^n X_i}\).
- We already know \(\smash{E[Z] = n\mu}\) and \(\smash{Sd(Z) = \sqrt{n} \sigma}\).
- However, the sum of Normals is also Normal: \(\smash{Z \sim N\left(n\mu, \sqrt{n} \sigma\right)}\).
Additive Normal Example¶
Suppose the monthly return on an asset is Normally distributed for each month over the next year.
We will assume the expected value is 1% and standard deviation is 5% and that returns across months are independent:
\[\begin{align} R_i \stackrel{i.i.d.}{\sim} N(0.01,0.05), \,\,\,\, i = 1,\ldots, 12. \end{align}\]
- The annual return is the sum of monthly returns: \(\smash{R_a = \sum_{i=1}^{12} R_i}\).
- The distribution of the annual return is \(\smash{R_a \sim N(0.12,0.1732)}\).
Additive Normal Example¶
Note that we can also work backwards.
- Suppose you know that the annual expected return is \(\smash{\mu_a = 0.12}\), the annual standard deviation is \(\smash{\sigma_a = 0.1732}\) and that monthly returns are independent.
The monthly expected return and standard deviation are:
\[\begin{split}\begin{align} \mu_m & = \frac{\mu_a}{n} = \frac{0.12}{12} = 0.01 \\ \sigma_m & = \frac{\sigma_a}{\sqrt{n}} = \frac{0.1732}{\sqrt{12}} = 0.05. \end{align}\end{split}\]
Wiener Process¶
A random variable \(\smash{Z(t)}\) follows a Wiener process if:
During a short time interval \(\smash{\Delta t}\),
\[\begin{split}\begin{align} \Delta Z(t) & = Z(t) - Z(t-\Delta t) = \varepsilon \sqrt{\Delta t}, \,\,\, \varepsilon \sim N(0,1). \end{align}\end{split}\]
- The values of \(\smash{\Delta Z(t)}\) for any two short intervals \(\smash{\Delta t}\) are independent.
- As \(\smash{\Delta t \to 0}\), we use the notation \(\smash{dZ = \varepsilon \sqrt{dt}}\).
Moments of the Wiener Process¶
What are the first two moments of \(\smash{\Delta Z(t)}\)?
Wiener Process Over Long Horizon¶
Consider the evolution of \(\smash{Z(t)}\) over a longer horizon \(\smash{T}\).
- Divide the time interval \(\smash{(0,T)}\) into \(\smash{N}\) small intervals of equal length \(\smash{\Delta t}\).
Then:
\[\begin{split}\begin{align} Z(T) - Z(0) & = \sum_{i=1}^N \varepsilon_i \sqrt{\Delta t}, \,\,\, \varepsilon_i \stackrel{i.i.d.}{\sim} N(0,1). \end{align}\end{split}\]
Wiener Process Over Long Horizon¶
The resulting moments are:
\[\begin{split}\begin{align} E\left[Z(T) - Z(0)\right] & = \sum_{i=1}^N \sqrt{\Delta t} E[\varepsilon_i] = 0 \\ Var\left(Z(T) - Z(0)\right) & = \sum_{i=1}^N \Delta t Var(\varepsilon_i) = T \\ Sd\left(Z(T) - Z(0)\right) & = \sum_{i=1}^N \sqrt{\Delta t} Sd(\varepsilon_i) = \sqrt{T}. \end{align}\end{split}\]
Wiener Process Sample Paths¶
Generalized Wiener Process¶
Consider the generalized Wiener process:
- \(\smash{a}\) is the drift rate and \(\smash{b^2}\) is the variance rate.
- The basic Wiener process has drift rate zero and unit variance rate.
Generalized Wiener Process¶
In discrete time, the generalize Wiener process is
The moments are:
Wiener Process Comparison¶
Ito Process¶
An Ito process is a generalization of a generalized Wiener process:
- The drift rate and variance rate are functions of the process value and time - i.e. they are variable.
In discrete time:
- The discrete time analog requires an approximation: the drift and variance rate are constant over small intervals \(\smash{\Delta t}\).
Model for Asset Prices¶
We will use an Ito process as a model for asset prices.
- We think of percentage returns as being constant for a particular asset.
- This means that the size of the moves (the drift) changes with the level of the price.
- Variance also typically changes with the level of asset prices.
- This means an Ito process is a better model than a generalized Wiener process.
Model for Asset Prices¶
We will employ the following Ito process:
- The drift rate function takes the specific form:
\(\smash{a(S,t) = \mu S}\).
- The drift rate increases proportionally with the asset price and does not depend on time.
- The variance rate function takes the specific form:
\(\smash{b^2(S,t) = \sigma^2 S^2}\).
- The volatility, \(\smash{b(S,t) = \sigma S}\), increases proportionally with the asset price and does not depend on time.
- This form of an Ito process is known as geometric Brownian motion.
Geometric Brownian Motion¶
Geometric Brownian motion can also be written as:
- \(\smash{\frac{dS}{S}}\) is effectively the return.
- Note that returns evolve as a generalized Wiener process (constant drift and variance rates).
- \(\smash{\mu}\) and \(\smash{\sigma}\) are the expected return and volatility of the asset.
Geometric Brownian Motion¶
In discrete time, geometric Brownian motion is described as:
This means \(\smash{\frac{\Delta S}{S} \sim N(\mu \Delta t, \sigma \sqrt{\Delta t})}\).
Parameter Estimation¶
We can estimate the parameters \(\smash{\mu}\) and \(\smash{\sigma}\) from historical data.
- Set an interval of time, \(\smash{\Delta t}\) in years (days, weeks, months, etc).
- Collect \(\smash{n+1}\) price observations for the beginning and end of each interval.
- Compute \(\smash{n}\) returns for the invervals.
- Set \(\smash{\hat{\mu}}\) and \(\smash{\hat{\sigma}}\) to the sample mean and sample standard deviation of the returns.
- \(\smash{\hat{\mu}}\) is an estimate of \(\smash{\mu \Delta t}\), not \(\smash{\mu}\).
- \(\smash{\hat{\sigma}}\) is an estimate of \(\smash{\sigma \sqrt{\Delta t}}\), not \(\smash{\sigma}\).
Simulating Geometric Brownian Motion¶
Let’s estimate the daily mean and standard deviation of Lockheed Martin (LMT) returns using data prior to January 1, 2015:
> library(quantmod)
> getSymbols("LMT",src="yahoo", from="2010-01-01", to="2014-12-31")
> lmtRets = dailyReturn(LMT)
> mu = mean(lmtRets)
> sigma = sd(lmtRets)
> cat(mu,sigma)
0.0008037858 0.01122918
We now simulate 1000 price paths of one year (250 trading days) starting on Jan 2, 2015:
> nSim = 1000
> nDays = 252
> S0 = 186.21 # price on Jan 2, 2015
> S = matrix(0,nrow=nDays,ncol=nSim)
> for(ix in 1:nSim){
+ SVec = rep(0,nDays)
+ SVec[1] = S0
+ for(jx in 2:nDays){
+ DeltaS = mu*SVec[jx-1] + sigma*SVec[jx-1]*rnorm(1)
+ SVec[jx] = SVec[jx-1]+DeltaS
+ }
+ S[,ix] = SVec
+ }
> matplot(S,type='l',col=rgb(0,0,1,0.3),lty=1,ylab='',main='Simulated Price of LMT')
Ito’s Lemma¶
Suppose \(\smash{X}\) follows and Ito process:
For some function \(\smash{G(X,t)}\), Ito’s lemma says:
Ito’s Lemma¶
Ito’s lemma says that \(\smash{G(X,t)}\) is an Ito process with drift and variance rates
Ito’s Lemma for Geometric Brownian Motion¶
Recall our model for stock prices:
In this case, Ito’s lemma says that \(\smash{G(S,t)}\) follows:
Application to Forward Contracts¶
Recall the formula for the value of a forward contract (given current time \(\smash{t}\) and horizon \(\smash{T-t}\)):
- In this case \(\smash{F = G(S,t)}\).
The derivatives are
Application to Forward Contracts¶
Following Ito’s lemma,
Distribution of Prices¶
What is the distribution of \(\smash{S}\) if it follows geometric Brownian motion?
- We know that returns, \(\smash{\frac{dS}{S}}\), are Normal.
Let’s use Ito’s lemma to derive the law of motion of \(\smash{G(S,t) = \ln(S)}\):
- \(\smash{\ln(S)}\) follows a generalized Wiener process with drift rate \(\smash{\mu - \frac{\sigma^2}{2}}\) and variance rate \(\smash{\sigma^2}\).
Distribution of Prices¶
The discrete analog to the process for \(\smash{\Delta \ln(S)}\) is
For \(\smash{\Delta t = T}\), \(\smash{\Delta \ln(S) = \ln(S_T) - \ln(S_0)}\), which results in:
- This means that prices are lognormally distributed.
Lognormal Distribution¶
Suppose \(\smash{S_T \sim LN\left(\ln(S_0) + \left(\mu - \frac{\sigma^2}{2}\right)T, \sigma \sqrt{T}\right)}\).
- By defintion, this means \(\smash{\ln(S_T) \sim N\left(\ln(S_0) + \left(\mu - \frac{\sigma^2}{2}\right)T, \sigma \sqrt{T}\right)}\).
- It can be shown that the mean and variance of \(\smash{S_T}\) are
Simulation Distribution¶
We can check that our simulated geometric Brownian motion results in a lognormal distribution for LMT prices.
> lnMean = S0*exp(mu*nDays)
> lnSD = S0*exp(mu*nDays)*sqrt(exp((sigma^2)*nDays)-1)
> cat(lnMean,mean(S[nDays,]))
228.019 230.529
> cat(lnSD,sd(S[nDays,]))
40.97119 43.21174
Simulation Distribution¶
We can also plot the theoretical lognormal and the empirical distribution of LMT prices.
> meanOfLog = log(S0) + (mu-(sigma^2)/2)*nDays
> sdOfLog = sigma*sqrt(nDays)
> priceGrid = seq(0,lnMean+6*lnSD,length=10000)
> theoreticalDens = dlnorm(priceGrid,meanOfLog,sdOfLog)
> empiricalDens = density(S[nDays,])
> plot(priceGrid,theoreticalDens,type='l',xlab='Prices',ylab='Density')
> lines(empricalDens,col='blue')