All problems
OU Noise Step
Problem
Take one Ornstein-Uhlenbeck step: x + theta*(mu - x)*dt + sigma*sqrt(dt)*noise. The process mean-reverts toward mu.
Hint
OU noise creates temporally correlated exploration for continuous control.
Test cases
case 1
in: [0,0,0.15,0.2,0.01,1]
expected: 0.020000000000000004
case 2
in: [1,0,0.5,0.3,0.25,-1]
expected: 0.725
case 3
in: [0.5,0.5,0.1,0.1,0,1]
expected: 0.5
Starter codePython
import math
def ou_noise_step(x, mu, theta, sigma, dt, noise):
# Your code here
pass3 test cases · run your code against them in the editor