Skip to content

Instantly share code, notes, and snippets.

@physicshinzui
Created July 23, 2021 23:39
Show Gist options
  • Save physicshinzui/510e50f46cf9b6dc8e801272e1b6273f to your computer and use it in GitHub Desktop.
Save physicshinzui/510e50f46cf9b6dc8e801272e1b6273f to your computer and use it in GitHub Desktop.
Julia: Autocorrelation function of 1D random walk
using Plots
using StatsBase: autocor
rw = rand([-1,1],10^2)
p1 = plot(rw)
acf = autocor(rw)
p2 = plot(acf)
plot(p1, p2,layout=(2,1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment