Basically I want to simulated the underlying asset in the Bachelier Model. Thank you.
I adjusted your function slightly:
import numpy as np from matplotlib import pyplot as plt def terminal_value(S0, sigma, M): S = np.zeros(M) S = S0 for i in range(1, M): S[i] = S[i-1] + sigma * np.random.standard_normal() * np.sqrt(1/M) return S for i in range(10): series = terminal_value(100, 10, 100) plt.plot(series)
It works now and produces the following: