0

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?

user6437583
  • 75
  • 1
  • 1
  • 10

1 Answers1

1

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()
Paul Panzer
  • 51,835
  • 3
  • 54
  • 99