Skip to content

Instantly share code, notes, and snippets.

@mschauer
Last active September 21, 2017 07:18
Show Gist options
  • Select an option

  • Save mschauer/2b989561565f8a09e32520c760ab5cc2 to your computer and use it in GitHub Desktop.

Select an option

Save mschauer/2b989561565f8a09e32520c760ab5cc2 to your computer and use it in GitHub Desktop.
randn!
function W!(y, t)
n = length(y)
dt = t/n
y[1] .= 0.0
for i in 2:n-1
y[i] .= y[i-1] + sqrt(dt)*randn!(y[i])
end
y
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment