In [1]:
%matplotlib inline
import os

working_directory = os.path.pardir

import sys
sys.path.insert(0, working_directory)

from models import smc
import matplotlib.pyplot as plt
import numpy as np
import logging

In [2]:
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)

In [3]:
true_t1 = 2.5
noise = smc.GaussianDistribution(standard_deviation=0.1)

In [4]:
model = smc.T1Model(true_t1, noise=noise)

In [5]:
parameter_space = np.linspace(2, 3, 1000)

In [6]:
prior = np.ones(1000) / sum(np.ones(1000))

In [7]:
simulator = smc.SequentialMonteCarlo(model, parameter_space, prior, number_of_iterations=20)

In [8]:
weights = [weight for weight in simulator]

In [ ]:
print(weights)

In [ ]:
plt.plot(parameter_space, weights[19].weights)
plt.show()

In [ ]:
prior

In [ ]:
weights[1].weights

In [ ]:
print([a for a in range(10)])

In [ ]: