Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What does importing numpy from sampyl really do? #24

Open
Gabriel-p opened this issue Jul 30, 2018 · 0 comments
Open

What does importing numpy from sampyl really do? #24

Gabriel-p opened this issue Jul 30, 2018 · 0 comments

Comments

@Gabriel-p
Copy link

I've tried the following example importing numpy directly and from sampyl in Python 3.7, and they both seem to give the same results. What am I missing here?

import sampyl as smp
# from sampyl import np
import numpy as np
import seaborn
import matplotlib.pyplot as plt

icov = np.linalg.inv(np.array([[1., .8], [.8, 1.]]))
def logp(x, y):
    d = np.array([x, y])
    return -.5 * np.dot(np.dot(d, icov), d)

start = {'x': 1., 'y': 1.}
nuts = smp.NUTS(logp, start)
chain = nuts.sample(1000)

seaborn.jointplot(chain.x, chain.y, stat_func=None)
plt.show()

numpy_np

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant