The ornstein uhlenbeck is the following SDE:
dx_{t}=\theta (\mu -x_{t})\,dt+\sigma \,dW_{t}
generally dt is in years, but is this necessary?
The ornstein uhlenbeck is the following SDE:
dx_{t}=\theta (\mu -x_{t})\,dt+\sigma \,dW_{t}
generally dt is in years, but is this necessary?
Since with OU the Green's function is known you can use whatever time step is convenient and update exactly:
ou(t + dt) = ou(t) + (mu - ou(t)) * (1 - np.exp(-theta*dt)) \
+ scipy.stats.norm(loc=0, scale=sigma*np.sqrt(1/(2*theta)*(1 - np.exp(-2*theta*dt)))).rvs()