Skip to content

Instantly share code, notes, and snippets.

@Vayel
Created August 21, 2018 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vayel/fb2f1bade4b912399c4fb8a98e92b8e5 to your computer and use it in GitHub Desktop.
Save Vayel/fb2f1bade4b912399c4fb8a98e92b8e5 to your computer and use it in GitHub Desktop.
import random
import json
Y0 = 100
noise = lambda: random.gauss(0, 0.01)
def run(steps):
y = [Y0] * steps
for t in range(1, steps):
y[t] = y[t-1] * (1 + noise())
return y
if __name__ == '__main__':
steps = 60
runs = 10000
data = [run(steps) for _ in range(runs)]
with open("asset.json", "w") as f:
json.dump(data, f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment