# Simulating a GBM with martingale condition - Ito process moving downwards

I want to correctly simulate a $\mathcal{Q}$ - martingale $S$, which is a geometric Brownian motion and an exponential of a process $X$, \begin{equation} X_t = X_0 + \mu t + \sigma B_t = X_{t-\Delta t} + \mu \Delta t + \sigma B_{\Delta t}, \end{equation} where $X_0 = 0$ and $B$ is a Brownian motion under $\mathcal{Q}$, such that \begin{equation} S_t = S_0 \exp(X_t) = S_0 \exp(\mu t + \sigma B_t) = S_{t-\Delta t} \exp(\mu \Delta t + \sigma B_{\Delta t}), \end{equation}
with $\mu = -\sigma^2/2$ from the martingale condition (no interest rates, or $r=0$).

But when I run many (eg. N=1000) simulations of $(X_t)_{t=\Delta t}^T$ over a one-year time horizon ($T=1$, using the first equation above for simulation) with $\Delta t = 1/250$, the average of $X_T$ is significantly lower than $X_0 = 0$, which implies that also $S_T$ is on average significantly lower than $S_0$.
This seems understandable to me since I learnt that the above equation for $S_t$ is the solution of the dynamics $dS/S = \mu dt + \sigma dB_t$, and that, from Ito's lemma applied to the latter, in order for $S$ to be a martingale, the drift $\mu$ of the process $X$ needs to equal $-\sigma^2/2$; thus $X$ should go down on average.
However, from the martingale property of $S$, I would expect $S_T$ to be on average on the level of $S_0$. What is wrong? Can anybody write a concise illustration of the concept?

The average of the exponentials is not the exponential of the average. It is always higher due to convexity (Jensen inequality). So there is no contradiction between the average of $X_T$ being negative and the average of $S_T$ being $S_0$.
• Indeed, here, $X$ is a super-martingale, while $E^{X}$ is a martingale. The mean of $X$ drop significantly does not imply that the mean of $e^X$ will also drop significantly. – Gordon Apr 1 '15 at 17:03
• Ok thanks! I guess the wrong part in my exposee was: "which implies that also $S_T$ is on average significantly lower than $S_0$." I computed the mean of $S_T$ and it gets closer to $S_0$ as I increase the simulation number $N (1000, 10000,...)$. Re AFK: How would you report a confidence interval $\mathcal{I}$ - denoting the mean of $S_T$ by $\bar{S}_T$ and and $sd =$ RMS $= \sqrt{ \frac{1}{N} \sum_{j=1}^N (S_T^{(j)} - \bar{S}_T)^2 }$, just by $\mathcal{I} = [\bar{S}_T - sd, \bar{S}_T + sd] \,$ ? – Futurist Apr 3 '15 at 8:19