I want to simulate stock price paths with different stochastic processes. I started with the famous geometric brownian motion. I simulated the values with the following formula:
$$R_i=\frac{S_{i+1}-S_i}{S_i}=\mu \Delta t + \sigma \varphi \sqrt{\Delta t}$$
with:
$\mu= $ sample mean
$\sigma= $ sample volatility
$\Delta t = $ 1 (1 day)
$\varphi=$ random number
I used a short way of simulating: Simulate normally distributed random numbers with sample mean and sample standard deviation.
Multiplicate this with the stock price, this gives the price increment.
Calculate Sum of price increment and stock price and this gives the simulated stock price value. (This methodology can be found here)
So I thought I understood this, but now I found the following formula, which is also the geometric brownian motion:
$$ S_t = a \exp\left[\left(\mu - \frac{\sigma^2}{2}\right) t + \sigma W_t \right] $$
I do not understand the difference? What does the second formula says in comparison to the first? Should I have taken the second one? How should I simulate with the second formula?