Skip to content

Instantly share code, notes, and snippets.

@fonnesbeck
Last active June 1, 2019 00:21
Show Gist options
  • Select an option

  • Save fonnesbeck/2291ca98dc0d7c59931e67177380b208 to your computer and use it in GitHub Desktop.

Select an option

Save fonnesbeck/2291ca98dc0d7c59931e67177380b208 to your computer and use it in GitHub Desktop.

Revisions

  1. fonnesbeck revised this gist Jun 1, 2019. 1 changed file with 9 additions and 4 deletions.
    13 changes: 9 additions & 4 deletions predict_curves.py
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,9 @@
    more_curves = [1810, 2225, 3015]
    with curve_spin_model:
    pm.set_data({'spin': more_curves})
    post_pred = pm.sample_posterior_predictive(trace, samples=1000)
    traces = {}

    for year in years:
    with curve_spin_model:
    year_data = curveball_data.query('year==@year')
    pm.set_data({'spin': year_data.spin_rate,
    'swing_miss': year_data.miss})
    traces[year] = pm.sample(1000, tune=2000,
    cores=2, progressbar=False)
  2. fonnesbeck created this gist May 31, 2019.
    4 changes: 4 additions & 0 deletions predict_curves.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    more_curves = [1810, 2225, 3015]
    with curve_spin_model:
    pm.set_data({'spin': more_curves})
    post_pred = pm.sample_posterior_predictive(trace, samples=1000)