Skip to content
All library documents

Time Scaling in Geometric Brownian Motion Stock Simulations

Article Quant Q&A · Author: xrdty

Summary

The document discusses simulating a stock price with geometric Brownian motion when the risk-free rate, dividend yield, and volatility are annualized. Its central implementation point is to keep the time step and parameter units consistent: for a one-day step, the time increment should be expressed as a fraction of a year if the inputs remain annualized. The Brownian shock is scaled by the square root of that time increment, while the drift uses the increment itself.

The questioner reports that paths look jumpy and considers dividing annualized inputs by the square root of 252. The answer clarifies that volatility follows square-root-of-time scaling, whereas rates scale linearly with time; alternatively, one can use annual parameters with a time step measured in years. The exchange offers no plotted evidence or validation of the code, and the brief answer does not examine implementation details such as trading-day conventions or calibration. Its practical lesson is dimensional consistency, not a specific preferred calendar convention.

Key ideas

  • Use annualized parameters with time steps expressed in years, or convert parameters consistently to the step unit.
  • Scale volatility by the square root of elapsed time in the Brownian shock.
  • Scale drift rates linearly with elapsed time.
  • The exchange clarifies units but does not validate the simulation code or specify a calendar convention.

Tags

Full text
# Matlab implementation for modelling stock price process


# Matlab implementation for modelling stock price process












I am trying to model the stock's price process. Let's assume volatility and risk-free rate is given. I've come up with the code below to try and model the price process with the geometrical Brownian motion. This should take into account risk-free rate and dividend yield q.

$$S_t = S_0 \exp\left(\left[r-q-\frac 12\sigma^2\right]t + \sigma W_t\right)$$

```
% initial price, time, risk-free rate, dividend yield pct, volatility
% p = simPrice(66, 365, 0.0088, 0.0236, 0.2);

function [path] = simPrice(initialPrice, days, r, q, sigma)

    path = zeros(1, days+1);
    path(1) = initialPrice;
    for t=1:length(path)-1
        path(t+1) = nextSt(path(t), (1/days), r, q, sigma);
    end

end

function [ expected ] = nextSt(initial, t, r, q, sigma)

    n = randn();
    expected = initial * exp( (r - q -(0.5 * (sigma^2)))*t + sigma*sqrt(t)*n);
end
```

However, as I am quite new to this, I'd like some reassurance that this is indeed correct. I feel like the price process is a bit jumpy? I am particularly worried that I am doing something wrong in the nextSt(..) function. This could be either in the formula inside the function itself (am I implementing the $W_t$ part of the formula correctly?) or the parameters I pass to it. For example, I am not sure if I am doing the time parameters right here.

Note that I am using annualised volatility, dividend yield and risk-free rate. The next St is always computed over one day. So shouldn't I have to convert those parameters to daily values by dividing by $sqrt(252)$?

This is the result when I do so:

The results on the first graph seem more plausible, but the parameters I used there make no sense?

## Answer by user18489 (score 0, accepted)

https://quant.stackexchange.com/a/31687

Time dimension of volatility and risk-free rate should match the time unit of your step (dt) in BM. If t represents year then sigma and r should be annualized, if t is in days then you should apply the square-root rule.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.