Skip to content

Instantly share code, notes, and snippets.

@alchemyst
Created November 10, 2013 15:38
Show Gist options
  • Save alchemyst/7399670 to your computer and use it in GitHub Desktop.
Save alchemyst/7399670 to your computer and use it in GitHub Desktop.
Generating autoregressive data
N = 1000
h = 5
y = numpy.random.randn(N)
x = numpy.zeros_like(y)
for i in range(h, len(y)):
x[i] = x[i-1] + y[i - h]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment