from __future__ import print_function
from numpy import *
from matplotlib.pyplot import *

# load the data
import gzip, pickle
datafile = gzip.open('ws7.pkl.gz')
artificial, simulation = pickle.load(datafile)

# Task 7.1: Artificial Time Series
d = artificial
N, n = d.shape

figure(figsize=(10,5))
for i in range(n):
  plot(d[:1000,i], label='set={} mean={}'.format(i, d[:,i].mean()))
legend()

# Task 7.2: Real Simulation Data
ts, n1, n2, n3 = simulation

figure()
title('Simulation data')
xlabel('Time $t$')
plot(ts, n1, label='$N_{+3}$')
plot(ts, n2, label='$N_{-1}$')
plot(ts, n3, label='$N_{+1}$')
legend(loc='best')

show()
