Open AlessandroLovo opened 2 years ago
Original line of code:
xx = xn*np.exp(-self.theta*dt) + np.sqrt(self.D0/self.theta*(1-np.exp(-2*self.theta*dt)))*dw
Proposed fix
xx = (xn - self.mu)*np.exp(-self.theta*dt) + self.mu + np.sqrt(self.D0/self.theta*(1-np.exp(-2*self.theta*dt)))*dw
In
sr.dynamics.diffusion1d.OrnsteinUhlenbeck1D.update
the position update due to the drift term is obtained by multiplication by an exponential term. This assumes mu=0