Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@fonnesbeck
Created May 31, 2019 22:21
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/8547066aa7bbd6363b1bb6ec37b327bf to your computer and use it in GitHub Desktop.
Save fonnesbeck/8547066aa7bbd6363b1bb6ec37b327bf to your computer and use it in GitHub Desktop.
with pm.Model() as curve_spin_model:
spin = pm.Data('spin', curveball_data['spin_rate'])
β = pm.Normal('β', shape=2)
θ = β[0] + β[1]*(spin/1000)
swing_miss = pm.Data('swing_miss', curveball_data['miss'])
miss = pm.Bernoulli('miss', pm.invlogit(θ), observed=swing_miss)
trace = pm.sample(1000, tune=6000, cores=2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment