Skip to content

Commit

Permalink
Add example script of running MA2 (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
vuolleko authored May 19, 2017
1 parent e718e28 commit 819ed5e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions scripts/MA2_run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import matplotlib.pyplot as plt

import elfi
from elfi.examples import ma2


# load the model from elfi.examples
model = ma2.get_model()

# setup and run rejection sampling
rej = elfi.Rejection(model['d'], batch_size=10000)
result = rej.sample(1000, quantile=0.01)

# show summary of results on stdout
result.summary

# save a figure of results
result.plot_pairs()
plt.savefig('ma2.png')

0 comments on commit 819ed5e

Please sign in to comment.