Created
August 21, 2018 15:35
-
-
Save Vayel/fb2f1bade4b912399c4fb8a98e92b8e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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