Skip to content

Instantly share code, notes, and snippets.

@fonnesbeck
Created May 31, 2019 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fonnesbeck/943aadc780722b2c467459f1fb6cdd0d to your computer and use it in GitHub Desktop.
Save fonnesbeck/943aadc780722b2c467459f1fb6cdd0d to your computer and use it in GitHub Desktop.
df = pd.DataFrame(dict(y=np.array([2, 4, 2, 0, 4])))
with pm.Model() as glm:
x = np.array([0.3, 1.1, 0.6, -0.2, 3.3])
pm.glm.GLM.from_formula('y ~ x', data=df, family=pm.glm.families.Poisson())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment