{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "(pymc3_schema)=\n", "# Example of `InferenceData` schema in PyMC3\n", "\n", "The description of the `InferenceData` structure can be found {ref}`here `." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import arviz as az\n", "import pymc3 as pm\n", "import pandas as pd\n", "import numpy as np\n", "import xarray\n", "\n", "xarray.set_options(display_style=\"html\");" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
commentscommitstime
Alice7500254.5
Bob10100326.0
Cole18600497.0
Danielle252006612.0
Erika275009618.0
\n", "
" ], "text/plain": [ " comments commits time\n", "Alice 7500 25 4.5\n", "Bob 10100 32 6.0\n", "Cole 18600 49 7.0\n", "Danielle 25200 66 12.0\n", "Erika 27500 96 18.0" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# read data\n", "data = pd.read_csv(\"linear_regression_data.csv\", index_col=0)\n", "time = data.time.values\n", "slack_comments = data.comments.values\n", "github_commits = data.commits.values\n", "names = data.index.values\n", "N = len(names)\n", "data" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "# data for out of sample predictions\n", "candidate_devs = [\"Francis\", \"Gerard\"]\n", "candidate_devs_time = np.array([3.6, 5.1])" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Only 400 samples in chain.\n", "Auto-assigning NUTS sampler...\n", "Initializing NUTS using jitter+adapt_diag...\n", "Multiprocess sampling (4 chains in 4 jobs)\n", "NUTS: [c1, c0, b1, b0, c_sigma, b_sigma]\n" ] }, { "data": { "text/html": [ "\n", "
\n", " \n", " \n", " 100.00% [3600/3600 00:04<00:00 Sampling 4 chains, 2 divergences]\n", "
\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stderr", "output_type": "stream", "text": [ "There was 1 divergence after tuning. Increase `target_accept` or reparameterize.\n", "There was 1 divergence after tuning. Increase `target_accept` or reparameterize.\n" ] }, { "data": { "text/html": [ "\n", "
\n", " \n", " \n", " 100.00% [1600/1600 00:03<00:00]\n", "
\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "dims = {\n", " \"slack_comments\": [\"developer\"],\n", " \"github_commits\": [\"developer\"],\n", " \"time_since_joined\": [\"developer\"],\n", "}\n", "with pm.Model() as model:\n", " time_since_joined = pm.Data(\"time_since_joined\", time)\n", "\n", " b_sigma = pm.HalfNormal(\"b_sigma\", sd=300)\n", " c_sigma = pm.HalfNormal(\"c_sigma\", sd=6)\n", " b0 = pm.Normal(\"b0\", mu=0, sd=200)\n", " b1 = pm.Normal(\"b1\", mu=0, sd=200)\n", " c0 = pm.Normal(\"c0\", mu=0, sd=10)\n", " c1 = pm.Normal(\"c1\", mu=0, sd=10)\n", "\n", " pm.Normal(\n", " \"slack_comments\", mu=b0 + b1 * time_since_joined, sigma=b_sigma, observed=slack_comments\n", " )\n", " pm.Normal(\n", " \"github_commits\", mu=c0 + c1 * time_since_joined, sigma=c_sigma, observed=github_commits\n", " )\n", "\n", " trace = pm.sample(400, chains=4)\n", " posterior_predictive = pm.sample_posterior_predictive(trace)\n", " prior = pm.sample_prior_predictive(150)\n", " idata_pymc3 = az.from_pymc3(\n", " trace,\n", " prior=prior,\n", " posterior_predictive=posterior_predictive,\n", " coords={\"developer\": names},\n", " dims=dims,\n", " )" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " \n", " 100.00% [1600/1600 00:07<00:00]\n", "
\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "dims_pred = {\n", " \"slack_comments\": [\"candidate developer\"],\n", " \"github_commits\": [\"candidate developer\"],\n", " \"time_since_joined\": [\"candidate developer\"],\n", "}\n", "with model:\n", " pm.set_data({\"time_since_joined\": candidate_devs_time})\n", " predictions = pm.sample_posterior_predictive(trace)\n", " az.from_pymc3_predictions(\n", " predictions,\n", " idata_orig=idata_pymc3,\n", " inplace=True,\n", " coords={\"candidate developer\": candidate_devs},\n", " dims=dims_pred,\n", " )" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Inference data with groups:\n", "\t> posterior\n", "\t> posterior_predictive\n", "\t> sample_stats\n", "\t> prior\n", "\t> prior_predictive\n", "\t> observed_data\n", "\t> log_likelihood\n", "\t> constant_data\n", "\t> predictions\n", "\t> predictions_constant_data" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "idata_pymc3" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In this example, each variable has as dimensions a combination of the following three: `chain`, `draw` and `developer`. Moreover, each dimension has specific coordinate values.\n", "\n", "* In the case of `chain` and `draw` it is an integer identifier starting at `0`.\n", "* In the case of `developer` dimension, its coordinate values are the following strings: `[\"Alice\", \"Bob\", \"Cole\", \"Danielle\", \"Erika\"]`." ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", "Show/Hide data repr\n", "\n", "\n", "\n", "\n", "\n", "Show/Hide attributes\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
xarray.Dataset
    • chain: 4
    • draw: 400
    • chain
      (chain)
      int64
      0 1 2 3
      array([0, 1, 2, 3])
    • draw
      (draw)
      int64
      0 1 2 3 4 5 ... 395 396 397 398 399
      array([  0,   1,   2, ..., 397, 398, 399])
    • b0
      (chain, draw)
      float64
      619.3 313.6 88.4 ... 273.1 185.8
      array([[ 619.30334334,  313.57972958,   88.40069813, ...,   86.50877829,\n",
             "         209.76527942,  259.75718   ],\n",
             "       [ -11.02038872,   33.40805828, -113.50897834, ...,  446.11783706,\n",
             "        -116.16682146,  108.30910847],\n",
             "       [-100.02157877,  329.40951249,  411.80180413, ...,  304.66719455,\n",
             "          25.6214615 ,   66.7679782 ],\n",
             "       [ -23.04302795,  228.32265612,  -25.77693619, ...,  325.8748248 ,\n",
             "         273.05245828,  185.78243209]])
    • b1
      (chain, draw)
      float64
      1.516e+03 1.525e+03 ... 1.485e+03
      array([[1516.03232735, 1524.74272889, 1490.03337057, ..., 1572.29989631,\n",
             "        1625.3059752 , 1571.74424293],\n",
             "       [1636.72804519, 1626.22427857, 1690.18786572, ..., 1676.93356261,\n",
             "        1641.80643617, 1496.03948842],\n",
             "       [1639.96161765, 1607.09120127, 1604.45613865, ..., 1449.73855792,\n",
             "        1722.48243714, 1686.04136914],\n",
             "       [1555.04708013, 1540.12021417, 1705.40462246, ..., 1588.25824197,\n",
             "        1620.52009524, 1484.82316904]])
    • c0
      (chain, draw)
      float64
      -15.82 -10.81 -15.5 ... 4.305 2.761
      array([[-15.81906054, -10.81011788, -15.50198374, ...,   6.56434381,\n",
             "         -0.50750007,   2.69776545],\n",
             "       [ -1.94953744,  -0.30238737,   3.10205678, ...,  -4.25143102,\n",
             "          7.74451248,  -9.45069889],\n",
             "       [  9.79674617,  11.40941896,  -0.97428464, ...,   6.58785802,\n",
             "          7.03364269,   8.99532889],\n",
             "       [ -3.28067461,  24.78784126,  16.31078974, ...,   6.43170307,\n",
             "          4.30476907,   2.76097108]])
    • c1
      (chain, draw)
      float64
      6.507 7.465 6.517 ... 5.07 5.189
      array([[6.50678863, 7.46454211, 6.51747415, ..., 5.00148126, 5.53430053,\n",
             "        5.76080182],\n",
             "       [5.45672499, 5.65062742, 4.91592914, ..., 5.91086493, 4.77355821,\n",
             "        6.46433539],\n",
             "       [4.61091412, 4.61919367, 5.90586605, ..., 5.00453555, 4.86307639,\n",
             "        4.87946413],\n",
             "       [5.68466235, 2.54628608, 4.60572306, ..., 5.16815823, 5.0701375 ,\n",
             "        5.18895417]])
    • b_sigma
      (chain, draw)
      float64
      1.512e+03 1.815e+03 ... 1.8e+03
      array([[1512.47768934, 1815.2198992 , 1812.51271589, ..., 1553.58941483,\n",
             "        1778.91986664, 1834.98805985],\n",
             "       [1834.58934978, 1690.02900839, 1809.19366886, ..., 1290.21915743,\n",
             "        1513.45623476, 1713.82028877],\n",
             "       [1719.00931232, 1586.87256375, 1388.81172907, ..., 1681.10548734,\n",
             "        1718.17237199, 1680.09581278],\n",
             "       [1564.86739502, 1499.60743638, 1674.69654847, ..., 1705.90383399,\n",
             "        1412.25273998, 1800.39424699]])
    • c_sigma
      (chain, draw)
      float64
      7.493 15.52 8.19 ... 4.379 5.154
      array([[ 7.49348452, 15.51931696,  8.18986939, ...,  3.85834311,\n",
             "         6.14802584,  6.53386705],\n",
             "       [ 9.24187281,  7.17949865,  5.47055063, ...,  3.10000522,\n",
             "        12.17010895,  7.13077749],\n",
             "       [ 5.30566752,  3.81042318,  7.31160479, ...,  4.72557784,\n",
             "         4.26385976,  4.28738777],\n",
             "       [ 5.39497422,  9.61525159, 10.67059339, ...,  4.68448828,\n",
             "         4.37858258,  5.15357695]])
  • created_at :
    2020-01-27T22:36:59.510665
    inference_library :
    pymc3
    inference_library_version :
    3.8
" ], "text/plain": [ "\n", "Dimensions: (chain: 4, draw: 400)\n", "Coordinates:\n", " * chain (chain) int64 0 1 2 3\n", " * draw (draw) int64 0 1 2 3 4 5 6 7 8 ... 392 393 394 395 396 397 398 399\n", "Data variables:\n", " b0 (chain, draw) float64 619.3 313.6 88.4 236.1 ... 325.9 273.1 185.8\n", " b1 (chain, draw) float64 1.516e+03 1.525e+03 ... 1.621e+03 1.485e+03\n", " c0 (chain, draw) float64 -15.82 -10.81 -15.5 ... 6.432 4.305 2.761\n", " c1 (chain, draw) float64 6.507 7.465 6.517 7.087 ... 5.168 5.07 5.189\n", " b_sigma (chain, draw) float64 1.512e+03 1.815e+03 ... 1.412e+03 1.8e+03\n", " c_sigma (chain, draw) float64 7.493 15.52 8.19 13.64 ... 4.684 4.379 5.154\n", "Attributes:\n", " created_at: 2020-01-27T22:36:59.510665\n", " inference_library: pymc3\n", " inference_library_version: 3.8" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "idata_pymc3.posterior" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", "Show/Hide data repr\n", "\n", "\n", "\n", "\n", "\n", "Show/Hide attributes\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
xarray.Dataset
    • chain: 4
    • draw: 400
    • chain
      (chain)
      int64
      0 1 2 3
      array([0, 1, 2, 3])
    • draw
      (draw)
      int64
      0 1 2 3 4 5 ... 395 396 397 398 399
      array([  0,   1,   2, ..., 397, 398, 399])
    • energy_error
      (chain, draw)
      float64
      0.1398 -0.232 ... 0.3555 -0.02345
      array([[ 0.13983636, -0.23195565,  0.02042407, ...,  0.00255139,\n",
             "         0.09591954,  0.3563224 ],\n",
             "       [ 0.24171132, -0.12041609,  0.14018251, ...,  0.11161431,\n",
             "        -0.32508047, -0.10969865],\n",
             "       [-0.12160326, -0.32012348,  0.43671993, ..., -0.23224975,\n",
             "         0.06337494,  0.08542817],\n",
             "       [ 0.01980747,  0.4951588 ,  0.13668189, ..., -0.09915747,\n",
             "         0.3554587 , -0.02345344]])
    • energy
      (chain, draw)
      float64
      149.4 151.4 150.4 ... 142.6 140.7
      array([[149.38408699, 151.44592656, 150.4231448 , ..., 139.86512224,\n",
             "        140.2389336 , 144.83722516],\n",
             "       [147.9169999 , 142.96251245, 144.23751706, ..., 151.43118902,\n",
             "        150.18209199, 148.19097069],\n",
             "       [142.04807622, 145.87775499, 146.40052954, ..., 141.93543187,\n",
             "        142.15818289, 142.23989061],\n",
             "       [142.39359546, 152.51942216, 152.50938944, ..., 144.12266928,\n",
             "        142.56036496, 140.74251769]])
    • step_size_bar
      (chain, draw)
      float64
      0.3863 0.3863 ... 0.4529 0.4529
      array([[0.38626878, 0.38626878, 0.38626878, ..., 0.38626878, 0.38626878,\n",
             "        0.38626878],\n",
             "       [0.34886932, 0.34886932, 0.34886932, ..., 0.34886932, 0.34886932,\n",
             "        0.34886932],\n",
             "       [0.40656223, 0.40656223, 0.40656223, ..., 0.40656223, 0.40656223,\n",
             "        0.40656223],\n",
             "       [0.45290133, 0.45290133, 0.45290133, ..., 0.45290133, 0.45290133,\n",
             "        0.45290133]])
    • tree_size
      (chain, draw)
      float64
      15.0 15.0 7.0 7.0 ... 7.0 7.0 15.0
      array([[15., 15.,  7., ...,  7., 15.,  7.],\n",
             "       [ 7.,  7.,  7., ..., 15.,  7., 15.],\n",
             "       [ 7.,  7., 15., ...,  7.,  7.,  7.],\n",
             "       [15., 15., 15., ...,  7.,  7., 15.]])
    • max_energy_error
      (chain, draw)
      float64
      -0.1656 -0.6437 ... 1.534 -0.06507
      array([[-0.16557173, -0.64374494,  0.08244838, ..., -0.03327802,\n",
             "         0.10929876,  0.58329817],\n",
             "       [ 0.87332475, -0.12041609,  0.35134843, ..., -0.2688141 ,\n",
             "        -0.52489134, -0.16164011],\n",
             "       [ 0.45200611,  1.1549677 ,  0.73168338, ..., -0.23224975,\n",
             "         0.13261637,  0.17179817],\n",
             "       [-0.13627861,  0.91811481,  0.58884787, ..., -0.33052978,\n",
             "         1.53362732, -0.06507489]])
    • diverging
      (chain, draw)
      bool
      False False False ... False False
      array([[False, False, False, ..., False, False, False],\n",
             "       [False, False, False, ..., False, False, False],\n",
             "       [False, False, False, ..., False, False, False],\n",
             "       [False, False, False, ..., False, False, False]])
    • lp
      (chain, draw)
      float64
      -148.2 -147.3 ... -139.5 -139.2
      array([[-148.24152428, -147.32486112, -145.53044042, ..., -138.90737003,\n",
             "        -139.85764801, -141.04208534],\n",
             "       [-142.33067926, -139.91236047, -142.55350999, ..., -148.06902828,\n",
             "        -143.84193462, -142.65061779],\n",
             "       [-140.56882223, -140.61070755, -141.89125629, ..., -140.01146968,\n",
             "        -141.19380329, -140.43253954],\n",
             "       [-140.88991242, -149.1931938 , -145.39972337, ..., -139.10882302,\n",
             "        -139.50844213, -139.23783667]])
    • depth
      (chain, draw)
      int64
      4 4 3 3 3 3 3 3 ... 4 4 4 3 4 3 3 4
      array([[4, 4, 3, ..., 3, 4, 3],\n",
             "       [3, 3, 3, ..., 4, 3, 4],\n",
             "       [3, 3, 4, ..., 3, 3, 3],\n",
             "       [4, 4, 4, ..., 3, 3, 4]])
    • tune
      (chain, draw)
      bool
      True False False ... False False
      array([[ True, False, False, ..., False, False, False],\n",
             "       [ True, False, False, ..., False, False, False],\n",
             "       [ True, False, False, ..., False, False, False],\n",
             "       [ True, False, False, ..., False, False, False]])
    • mean_tree_accept
      (chain, draw)
      float64
      0.9897 0.9751 ... 0.713 0.9966
      array([[0.98967279, 0.97509465, 0.97234547, ..., 0.99874907, 0.93778425,\n",
             "        0.68093223],\n",
             "       [0.79969486, 0.99914181, 0.83092996, ..., 0.9894557 , 1.        ,\n",
             "        0.991907  ],\n",
             "       [0.8565305 , 0.72621462, 0.58558934, ..., 0.99390142, 0.94692235,\n",
             "        0.95435264],\n",
             "       [0.99729841, 0.63255491, 0.90015449, ..., 0.98522739, 0.71304518,\n",
             "        0.9966133 ]])
    • step_size
      (chain, draw)
      float64
      0.3952 0.3952 ... 0.4748 0.4748
      array([[0.3951527 , 0.3951527 , 0.3951527 , ..., 0.3951527 , 0.3951527 ,\n",
             "        0.3951527 ],\n",
             "       [0.36115452, 0.36115452, 0.36115452, ..., 0.36115452, 0.36115452,\n",
             "        0.36115452],\n",
             "       [0.50326903, 0.50326903, 0.50326903, ..., 0.50326903, 0.50326903,\n",
             "        0.50326903],\n",
             "       [0.47478076, 0.47478076, 0.47478076, ..., 0.47478076, 0.47478076,\n",
             "        0.47478076]])
  • created_at :
    2020-01-27T22:36:59.515483
    inference_library :
    pymc3
    inference_library_version :
    3.8
" ], "text/plain": [ "\n", "Dimensions: (chain: 4, draw: 400)\n", "Coordinates:\n", " * chain (chain) int64 0 1 2 3\n", " * draw (draw) int64 0 1 2 3 4 5 6 ... 393 394 395 396 397 398 399\n", "Data variables:\n", " energy_error (chain, draw) float64 0.1398 -0.232 ... 0.3555 -0.02345\n", " energy (chain, draw) float64 149.4 151.4 150.4 ... 142.6 140.7\n", " step_size_bar (chain, draw) float64 0.3863 0.3863 ... 0.4529 0.4529\n", " tree_size (chain, draw) float64 15.0 15.0 7.0 7.0 ... 7.0 7.0 15.0\n", " max_energy_error (chain, draw) float64 -0.1656 -0.6437 ... 1.534 -0.06507\n", " diverging (chain, draw) bool False False False ... False False False\n", " lp (chain, draw) float64 -148.2 -147.3 ... -139.5 -139.2\n", " depth (chain, draw) int64 4 4 3 3 3 3 3 3 3 ... 4 4 4 3 4 3 3 4\n", " tune (chain, draw) bool True False False ... False False False\n", " mean_tree_accept (chain, draw) float64 0.9897 0.9751 ... 0.713 0.9966\n", " step_size (chain, draw) float64 0.3952 0.3952 ... 0.4748 0.4748\n", "Attributes:\n", " created_at: 2020-01-27T22:36:59.515483\n", " inference_library: pymc3\n", " inference_library_version: 3.8" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "idata_pymc3.sample_stats" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", "Show/Hide data repr\n", "\n", "\n", "\n", "\n", "\n", "Show/Hide attributes\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
xarray.Dataset
    • chain: 4
    • developer: 5
    • draw: 400
    • chain
      (chain)
      int64
      0 1 2 3
      array([0, 1, 2, 3])
    • draw
      (draw)
      int64
      0 1 2 3 4 5 ... 395 396 397 398 399
      array([  0,   1,   2, ..., 397, 398, 399])
    • developer
      (developer)
      object
      'Alice' 'Bob' ... 'Erika'
      array(['Alice', 'Bob', 'Cole', 'Danielle', 'Erika'], dtype=object)
    • slack_comments
      (chain, draw, developer)
      float64
      -8.241 -8.273 ... -16.4 -8.468
      array([[[ -8.24119229,  -8.27275698, -20.10760119, -17.16042219,\n",
             "          -8.27680667],\n",
             "        [ -8.43893608,  -8.48465992, -17.21815491, -15.01186896,\n",
             "          -8.43307555],\n",
             "        [ -8.49736526,  -8.59611498, -18.36120233, -16.37985789,\n",
             "          -8.47456743],\n",
             "        ...,\n",
             "        [ -8.29094799,  -8.33687506, -19.94276691, -16.34865995,\n",
             "          -8.43057918],\n",
             "        [ -8.40278849,  -8.40572655, -16.17369137, -13.15887684,\n",
             "          -9.01294336],\n",
             "        [ -8.43789264,  -8.45866622, -16.42954894, -13.9217099 ,\n",
             "          -8.59780431]],\n",
             "\n",
             "       [[ -8.43667003,  -8.44606435, -16.03644324, -13.04294126,\n",
             "          -8.99845028],\n",
             "        [ -8.35530423,  -8.36818086, -17.38369218, -13.94348527,\n",
             "          -8.92206379],\n",
             "        [ -8.41958404,  -8.42037538, -15.65482765, -12.28638187,\n",
             "          -9.62564682],\n",
             "        ...,\n",
             "        [ -8.15430668,  -8.13143634, -20.44335297, -14.52219689,\n",
             "         -11.02584292],\n",
             "        [ -8.25244101,  -8.27022351, -19.63120825, -15.12207825,\n",
             "          -9.05954993],\n",
             "        [ -8.43946219,  -8.54095224, -19.31316609, -17.04183972,\n",
             "          -8.40190796]],\n",
             "\n",
             "       [[ -8.37664596,  -8.39040164, -17.18954425, -13.71360176,\n",
             "          -8.99173694],\n",
             "        [ -8.28920555,  -8.29171431, -18.07609741, -14.48300382,\n",
             "          -8.9014508 ],\n",
             "        [ -8.15964917,  -8.15612156, -20.70179605, -16.09614375,\n",
             "          -8.98760587],\n",
             "        ...,\n",
             "        [ -8.4259236 ,  -8.55901583, -20.08951889, -18.29390778,\n",
             "          -8.56023525],\n",
             "        [ -8.38093109,  -8.37944987, -15.56132134, -11.80469706,\n",
             "         -10.47882297],\n",
             "        [ -8.34974304,  -8.34676539, -16.37070387, -12.59980876,\n",
             "          -9.85122143]],\n",
             "\n",
             "       [[ -8.33084326,  -8.40281627, -20.49925113, -17.0677698 ,\n",
             "          -8.31917803],\n",
             "        [ -8.25777161,  -8.3204114 , -21.04322172, -17.59749809,\n",
             "          -8.27701815],\n",
             "        [ -8.34625955,  -8.3443536 , -16.31645164, -12.38324148,\n",
             "         -10.13552651],\n",
             "        ...,\n",
             "        [ -8.3609138 ,  -8.37106639, -17.15992655, -14.17063028,\n",
             "          -8.70456924],\n",
             "        [ -8.17295196,  -8.17458243, -20.39740179, -15.70228308,\n",
             "          -9.11774422],\n",
             "        [ -8.47641212,  -8.57058566, -18.33746722, -16.40306748,\n",
             "          -8.46792298]]])
    • github_commits
      (chain, draw, developer)
      float64
      -4.118 -3.619 ... -2.576 -2.559
      array([[[-4.11847356, -3.61913349, -6.23998027, -3.05736297,\n",
             "         -3.18339169],\n",
             "        [-3.67125237, -3.6691392 , -3.77962158, -3.99926387,\n",
             "         -5.23689158],\n",
             "        [-3.95247895, -3.54746476, -5.67891635, -3.10263684,\n",
             "         -3.27369091],\n",
             "        ...,\n",
             "        [-2.82581397, -2.97162515, -4.12097966, -2.28055767,\n",
             "         -2.28090786],\n",
             "        [-2.73988179, -2.74151996, -4.26869758, -2.7351912 ,\n",
             "         -2.86300597],\n",
             "        [-2.94953215, -3.12029671, -3.21428865, -3.19365727,\n",
             "         -4.06080275]],\n",
             "\n",
             "       [[-3.17624124, -3.15124237, -4.0946857 , -3.17836392,\n",
             "         -3.14311463],\n",
             "        [-2.89032071, -2.91504343, -3.81191651, -2.91214347,\n",
             "         -3.17396042],\n",
             "        [-2.61915416, -2.62428507, -4.8226587 , -2.87332289,\n",
             "         -2.94342389],\n",
             "        ...,\n",
             "        [-2.41641614, -2.08250537, -9.38770408, -2.07432615,\n",
             "         -4.01445785],\n",
             "        [-3.4781971 , -3.4828582 , -3.62544975, -3.42111601,\n",
             "         -3.43627111],\n",
             "        [-3.16598901, -2.9531802 , -4.5967921 , -2.92760857,\n",
             "         -4.05321854]],\n",
             "\n",
             "       [[-3.13400972, -3.11765821, -3.43995455, -2.60122882,\n",
             "         -2.77036998],\n",
             "        [-4.03979891, -4.00468204, -3.20809717, -2.28096257,\n",
             "         -2.32859327],\n",
             "        [-2.9117921 , -2.96504306, -3.60549386, -3.05037457,\n",
             "         -3.72278542],\n",
             "        ...,\n",
             "        [-2.84982908, -2.94881704, -3.69153326, -2.48116505,\n",
             "         -2.48196433],\n",
             "        [-2.79117818, -2.85704807, -4.09631589, -2.37932806,\n",
             "         -2.42542944],\n",
             "        [-3.33854328, -3.44468648, -3.30499948, -2.43987366,\n",
             "         -2.39316051]],\n",
             "\n",
             "       [[-2.72961097, -2.62803101, -5.2834494 , -2.6238809 ,\n",
             "         -2.76350477],\n",
             "        [-3.86628702, -3.53410664, -3.40298776, -3.79646994,\n",
             "         -6.66564641],\n",
             "        [-3.92263428, -3.91300726, -3.28731609, -3.42313326,\n",
             "         -3.33178591],\n",
             "        ...,\n",
             "        [-2.96403383, -3.13764195, -3.39389381, -2.59991667,\n",
             "         -2.73573763],\n",
             "        [-2.51291917, -2.58940626, -4.60509979, -2.41466529,\n",
             "         -2.40054774],\n",
             "        [-2.58187767, -2.62621164, -4.40984152, -2.57640043,\n",
             "         -2.55912451]]])
  • created_at :
    2020-01-27T22:37:00.122554
    inference_library :
    pymc3
    inference_library_version :
    3.8
" ], "text/plain": [ "\n", "Dimensions: (chain: 4, developer: 5, draw: 400)\n", "Coordinates:\n", " * chain (chain) int64 0 1 2 3\n", " * draw (draw) int64 0 1 2 3 4 5 6 7 ... 393 394 395 396 397 398 399\n", " * developer (developer) object 'Alice' 'Bob' 'Cole' 'Danielle' 'Erika'\n", "Data variables:\n", " slack_comments (chain, draw, developer) float64 -8.241 -8.273 ... -8.468\n", " github_commits (chain, draw, developer) float64 -4.118 -3.619 ... -2.559\n", "Attributes:\n", " created_at: 2020-01-27T22:37:00.122554\n", " inference_library: pymc3\n", " inference_library_version: 3.8" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "idata_pymc3.log_likelihood" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", "Show/Hide data repr\n", "\n", "\n", "\n", "\n", "\n", "Show/Hide attributes\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
xarray.Dataset
    • chain: 4
    • developer: 5
    • draw: 400
    • chain
      (chain)
      int64
      0 1 2 3
      array([0, 1, 2, 3])
    • draw
      (draw)
      int64
      0 1 2 3 4 5 ... 395 396 397 398 399
      array([  0,   1,   2, ..., 397, 398, 399])
    • developer
      (developer)
      object
      'Alice' 'Bob' ... 'Erika'
      array(['Alice', 'Bob', 'Cole', 'Danielle', 'Erika'], dtype=object)
    • slack_comments
      (chain, draw, developer)
      float64
      6.758e+03 9.359e+03 ... 2.689e+04
      array([[[ 6758.20107593,  9359.32381273,  8989.16457557, 19264.85125442,\n",
             "         28597.00621649],\n",
             "        [ 5922.99115335,  9480.83903632, 15654.3641546 , 17751.42362953,\n",
             "         28652.11060436],\n",
             "        [ 7835.94130901,  8434.12646419,  8368.19511593, 16966.67724994,\n",
             "         28459.01987462],\n",
             "        ...,\n",
             "        [ 8301.931907  , 10211.89652582, 11072.85899136, 16459.05834074,\n",
             "         30031.56174545],\n",
             "        [ 8161.61554339, 15458.96403853, 13314.08461967, 20231.15447864,\n",
             "         30248.29941464],\n",
             "        [ 7328.10680985,  8769.20253545,  8934.92834002, 20792.02162123,\n",
             "         28943.26841822]],\n",
             "\n",
             "       [[ 8501.62673199, 10301.34310757, 11844.64623926, 19399.87985706,\n",
             "         31642.23509482],\n",
             "        [ 6634.40023629,  6356.45820678, 12977.75466452, 20381.82629607,\n",
             "         27891.44692092],\n",
             "        [ 5712.65533159, 13194.10518098, 13465.19929795, 20269.27518977,\n",
             "         29777.16680212],\n",
             "        ...,\n",
             "        [ 6935.98341575, 10785.6526626 , 12347.96724621, 19990.99669045,\n",
             "         32611.34120678],\n",
             "        [ 8982.24431527, 11380.6087484 , 11075.42432976, 18822.64383171,\n",
             "         28721.20657001],\n",
             "        [ 5679.16616732,  9097.02283442, 10330.52453437, 19423.36555902,\n",
             "         24916.47904853]],\n",
             "\n",
             "       [[ 5523.61430428,  8182.61239811,  8175.87750135, 19071.33176908,\n",
             "         27457.70394603],\n",
             "        [ 8503.20872353, 12758.92506465, 10271.76956401, 18777.29056953,\n",
             "         31535.09640007],\n",
             "        [ 7385.79055082, 11480.56277465,  9652.29148086, 20125.09089213,\n",
             "         31265.37289228],\n",
             "        ...,\n",
             "        [ 9346.35275189,  6581.81467968, 10724.80531469, 13866.13916387,\n",
             "         25487.13793426],\n",
             "        [ 8481.56029119, 11740.02410192, 13069.61463719, 19941.44909395,\n",
             "         30577.91446128],\n",
             "        [ 6917.64816966, 12175.30056678,  9816.96118712, 20822.917858  ,\n",
             "         30614.48355752]],\n",
             "\n",
             "       [[ 2825.89133452,  6804.57491013,  9462.8239833 , 18736.94452561,\n",
             "         26549.33167684],\n",
             "        [ 8648.66455765, 10270.26242749, 11521.11794697, 19940.99649291,\n",
             "         27022.53490645],\n",
             "        [ 7312.43191078, 10283.95424841, 13136.48677076, 18343.28865168,\n",
             "         26028.71278359],\n",
             "        ...,\n",
             "        [ 6337.79533867,  6930.26548659, 11854.93673455, 18323.53140164,\n",
             "         27861.19608944],\n",
             "        [ 7373.44246971,  9075.20366041, 10002.40647772, 21223.18021474,\n",
             "         27179.56596164],\n",
             "        [ 7895.26568153, 10302.36521921, 11546.10905926, 17719.22958481,\n",
             "         26885.37587044]]])
    • github_commits
      (chain, draw, developer)
      float64
      2.162 21.91 32.69 ... 70.43 88.62
      array([[[  2.16214906,  21.90691698,  32.68628654,  67.3165049 ,\n",
             "         111.93493753],\n",
             "        [ 33.32587645,  22.77820046,  23.89547953, 100.3368886 ,\n",
             "         118.72312226],\n",
             "        [ 10.21935734,  23.29032416,  35.55447919,  54.55620636,\n",
             "         104.07115224],\n",
             "        ...,\n",
             "        [ 26.49015305,  37.56863164,  41.24845552,  67.90822891,\n",
             "          93.0018113 ],\n",
             "        [ 31.28977585,  34.21342484,  45.17482592,  59.09396148,\n",
             "          94.17547034],\n",
             "        [ 20.99300382,  25.10126721,  49.96405441,  80.05970469,\n",
             "         104.47149367]],\n",
             "\n",
             "       [[  2.60853784,  33.20035645,  35.02790686,  50.97421915,\n",
             "         108.5300065 ],\n",
             "        [ 22.33707058,  38.36058008,  42.86053618,  61.01478594,\n",
             "         110.13235317],\n",
             "        [ 25.82681983,  25.00395595,  27.52781598,  57.29075797,\n",
             "          97.8667649 ],\n",
             "        ...,\n",
             "        [ 23.42965017,  33.03430407,  35.82510945,  64.93176003,\n",
             "         102.4048237 ],\n",
             "        [ 42.9008982 ,  43.30246256,  51.89352135,  77.7102926 ,\n",
             "          92.18987002],\n",
             "        [ 20.00546269,  33.07244728,  19.05806858,  72.01393755,\n",
             "         109.01363074]],\n",
             "\n",
             "       [[ 28.10831961,  44.7499762 ,  36.85180426,  61.23056962,\n",
             "          90.81484984],\n",
             "        [ 36.51657134,  35.86096215,  39.80309884,  60.33903374,\n",
             "          96.45195559],\n",
             "        [ 20.69134568,  25.19818446,  59.50097813,  72.87772967,\n",
             "         112.24400038],\n",
             "        ...,\n",
             "        [ 30.77574259,  36.50455012,  42.35570953,  61.12675329,\n",
             "          97.50935953],\n",
             "        [ 30.67444184,  36.82389671,  39.24176453,  64.87959278,\n",
             "          90.61305399],\n",
             "        [ 32.8926128 ,  42.29477179,  35.19599528,  63.31380706,\n",
             "          94.46684327]],\n",
             "\n",
             "       [[ 16.37803819,  29.84251319,  31.9648445 ,  60.56443173,\n",
             "          96.12169888],\n",
             "        [ 51.17053224,  49.61874045,  30.1928834 ,  70.2036244 ,\n",
             "          62.06927411],\n",
             "        [ 31.23073143,  63.94204617,  51.14208773,  49.65952038,\n",
             "          96.12906013],\n",
             "        ...,\n",
             "        [ 20.8383117 ,  40.68624114,  39.09210967,  65.63067874,\n",
             "         103.24738141],\n",
             "        [ 17.75742338,  34.4329082 ,  42.38317261,  60.79344956,\n",
             "         100.56920348],\n",
             "        [ 22.93708523,  26.65696701,  33.35404174,  70.42668951,\n",
             "          88.61937237]]])
  • created_at :
    2020-01-27T22:37:00.125917
    inference_library :
    pymc3
    inference_library_version :
    3.8
" ], "text/plain": [ "\n", "Dimensions: (chain: 4, developer: 5, draw: 400)\n", "Coordinates:\n", " * chain (chain) int64 0 1 2 3\n", " * draw (draw) int64 0 1 2 3 4 5 6 7 ... 393 394 395 396 397 398 399\n", " * developer (developer) object 'Alice' 'Bob' 'Cole' 'Danielle' 'Erika'\n", "Data variables:\n", " slack_comments (chain, draw, developer) float64 6.758e+03 ... 2.689e+04\n", " github_commits (chain, draw, developer) float64 2.162 21.91 ... 70.43 88.62\n", "Attributes:\n", " created_at: 2020-01-27T22:37:00.125917\n", " inference_library: pymc3\n", " inference_library_version: 3.8" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "idata_pymc3.posterior_predictive" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", "Show/Hide data repr\n", "\n", "\n", "\n", "\n", "\n", "Show/Hide attributes\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
xarray.Dataset
    • developer: 5
    • developer
      (developer)
      object
      'Alice' 'Bob' ... 'Erika'
      array(['Alice', 'Bob', 'Cole', 'Danielle', 'Erika'], dtype=object)
    • slack_comments
      (developer)
      float64
      7.5e+03 1.01e+04 ... 2.75e+04
      array([ 7500., 10100., 18600., 25200., 27500.])
    • github_commits
      (developer)
      float64
      25.0 32.0 49.0 66.0 96.0
      array([25., 32., 49., 66., 96.])
  • created_at :
    2020-01-27T22:37:00.136543
    inference_library :
    pymc3
    inference_library_version :
    3.8
" ], "text/plain": [ "\n", "Dimensions: (developer: 5)\n", "Coordinates:\n", " * developer (developer) object 'Alice' 'Bob' 'Cole' 'Danielle' 'Erika'\n", "Data variables:\n", " slack_comments (developer) float64 7.5e+03 1.01e+04 ... 2.52e+04 2.75e+04\n", " github_commits (developer) float64 25.0 32.0 49.0 66.0 96.0\n", "Attributes:\n", " created_at: 2020-01-27T22:37:00.136543\n", " inference_library: pymc3\n", " inference_library_version: 3.8" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "idata_pymc3.observed_data" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", "Show/Hide data repr\n", "\n", "\n", "\n", "\n", "\n", "Show/Hide attributes\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
xarray.Dataset
    • developer: 5
    • developer
      (developer)
      object
      'Alice' 'Bob' ... 'Erika'
      array(['Alice', 'Bob', 'Cole', 'Danielle', 'Erika'], dtype=object)
    • time_since_joined
      (developer)
      float64
      4.5 6.0 7.0 12.0 18.0
      array([ 4.5,  6. ,  7. , 12. , 18. ])
  • created_at :
    2020-01-27T22:37:00.137808
    inference_library :
    pymc3
    inference_library_version :
    3.8
" ], "text/plain": [ "\n", "Dimensions: (developer: 5)\n", "Coordinates:\n", " * developer (developer) object 'Alice' 'Bob' ... 'Danielle' 'Erika'\n", "Data variables:\n", " time_since_joined (developer) float64 4.5 6.0 7.0 12.0 18.0\n", "Attributes:\n", " created_at: 2020-01-27T22:37:00.137808\n", " inference_library: pymc3\n", " inference_library_version: 3.8" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "idata_pymc3.constant_data" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", "Show/Hide data repr\n", "\n", "\n", "\n", "\n", "\n", "Show/Hide attributes\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
xarray.Dataset
    • chain: 1
    • draw: 150
    • chain
      (chain)
      int64
      0
      array([0])
    • draw
      (draw)
      int64
      0 1 2 3 4 5 ... 145 146 147 148 149
      array([  0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,\n",
             "        14,  15,  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,\n",
             "        28,  29,  30,  31,  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,\n",
             "        42,  43,  44,  45,  46,  47,  48,  49,  50,  51,  52,  53,  54,  55,\n",
             "        56,  57,  58,  59,  60,  61,  62,  63,  64,  65,  66,  67,  68,  69,\n",
             "        70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,  81,  82,  83,\n",
             "        84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96,  97,\n",
             "        98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,\n",
             "       112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125,\n",
             "       126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139,\n",
             "       140, 141, 142, 143, 144, 145, 146, 147, 148, 149])
    • b0
      (chain, draw)
      float64
      -93.49 -417.1 ... 261.1 -114.7
      array([[ -93.48509007, -417.135459  , -159.29159642,   38.31785293,\n",
             "          -5.47215308,  -58.18215648,  -79.90631413,   24.68703683,\n",
             "         220.57257438, -292.5889643 ,  172.90611112,  314.76155879,\n",
             "         133.10779137,  -94.29243828,  315.66632768,  145.2885036 ,\n",
             "           6.00489281,  344.63128274,  -45.7402679 ,   92.02446619,\n",
             "        -128.1562264 ,   86.05723156,    8.4659268 ,   48.98368978,\n",
             "        -215.40303978,   -3.66841182, -137.5826574 ,   -8.08220401,\n",
             "         373.27164298, -513.42429899, -143.58610095,    5.04942219,\n",
             "        -115.36831728,  206.37110659, -238.24617306,  -25.10297294,\n",
             "          32.87525319,   24.27814341, -462.92789802,  110.62431899,\n",
             "         216.19720608,  319.03544461,  215.81994327,  -51.23350699,\n",
             "         445.67534782, -286.74991116,  326.43682121, -100.1197999 ,\n",
             "        -367.2972472 , -112.95618052,  113.52190441,  -80.76223549,\n",
             "         -22.81703933,  -48.06737479,   70.21432464, -277.59001939,\n",
             "         150.68201965, -240.49808335, -210.19417265,    8.14727838,\n",
             "         -56.81360492, -168.11979773, -124.7581684 ,  111.27300812,\n",
             "          76.86223798,  173.62595011, -170.80979454,  195.45915247,\n",
             "          41.99463047,  -97.72210178,  390.20446612,  212.20093851,\n",
             "        -140.26942071,  -57.97140754, -172.7117303 ,   77.89613308,\n",
             "          97.73658297,   40.93914615,  133.09535471, -238.67533175,\n",
             "         128.01314266,  175.0403364 , -131.24374844,  121.45911445,\n",
             "         346.94299095, -203.80803427, -293.05303857,  -68.81459448,\n",
             "          38.83818583,  331.4340236 ,  326.7115683 ,   33.24241832,\n",
             "         -32.1190104 ,  425.28725456,   -1.33818043, -119.99999094,\n",
             "        -200.49501029, -118.91191045,   89.0074623 ,   53.25902874,\n",
             "        -168.66759777,  174.16890137,  -50.61732385, -115.94238122,\n",
             "        -276.38511968,  -72.37424605, -164.89543664,  228.56382591,\n",
             "         -16.81120052,  232.18919445, -230.03436758,  185.72071008,\n",
             "          59.76416662,  -14.49717732, -202.54661612, -145.06630345,\n",
             "          18.9197056 ,  381.35979145,   25.4025697 ,   71.64893218,\n",
             "         179.94975383,  238.73307706,  -92.06397147, -387.19686929,\n",
             "         345.800152  ,  231.8201769 , -374.19059993,  -68.25458821,\n",
             "         -72.69140634,   70.14800432,  211.50602647, -119.70056741,\n",
             "         111.16281124,   93.48365161, -104.36678751,   80.87790038,\n",
             "         -42.90566642, -256.35157809,   83.72049209, -155.48629346,\n",
             "         169.47628404,   55.76092594,   26.95322213,  -50.78393031,\n",
             "          81.47365136,  522.13645649,  213.15014383, -386.84103862,\n",
             "         261.08054995, -114.73272875]])
    • b1
      (chain, draw)
      float64
      166.7 391.6 -41.08 ... 15.14 120.7
      array([[ 1.66707251e+02,  3.91641654e+02, -4.10760452e+01,\n",
             "         6.59752363e+01, -5.25345209e+01,  2.94670360e+02,\n",
             "        -2.27832818e+02,  1.65098696e+02, -2.42305041e+01,\n",
             "        -3.05493214e+02, -4.16162302e+02,  2.15323425e+02,\n",
             "        -9.40368087e+01,  4.36147584e+01, -2.92773449e+02,\n",
             "        -1.27756493e+02,  2.53976527e+02, -1.80790003e+02,\n",
             "        -2.52588152e+01, -5.31052363e+00,  3.38514779e+02,\n",
             "        -2.11084673e+02, -1.19480927e+02,  3.54247219e+02,\n",
             "        -3.82729322e+01, -8.15345626e+01, -8.45602435e+01,\n",
             "        -1.35649318e+02,  2.12421688e+01, -1.38144914e+01,\n",
             "        -2.15125981e+02,  2.86299880e+02, -6.19442206e+01,\n",
             "         6.42387246e+01, -3.22620293e+01,  8.48239131e+01,\n",
             "         1.92961476e+02, -1.65381174e+02,  3.09216402e+02,\n",
             "        -3.20061468e+01, -5.29773325e+01,  1.08898696e+02,\n",
             "        -3.11850889e+02, -1.16106101e+02,  1.37837836e+02,\n",
             "         7.54907673e+00, -1.56509230e+01,  3.74777288e+01,\n",
             "        -1.65489396e+02, -8.12877862e+01,  2.10096450e+01,\n",
             "        -2.80099473e+02, -1.33184563e+02, -7.07792987e+01,\n",
             "         2.53446937e+02, -1.10122314e+02,  6.88296125e+01,\n",
             "        -2.88838211e+02, -2.14833086e+02,  1.79248245e+02,\n",
             "         1.58282138e+02, -2.58717759e+02, -3.72205058e+02,\n",
             "         2.06623810e+02, -1.53121098e+02,  1.71989397e+02,\n",
             "        -2.55141909e+02, -2.39310659e+02, -1.50544186e+02,\n",
             "        -1.02518021e+02,  7.78799258e+01,  3.78813330e+01,\n",
             "         1.75004039e+02, -3.31491087e+01, -2.68749970e+00,\n",
             "        -6.14824740e+01, -8.21333773e+01,  1.23513622e+02,\n",
             "         2.61211361e+02,  3.56770989e+02,  4.89691050e+00,\n",
             "         1.32580406e+02,  1.81864873e+02,  3.19881447e+01,\n",
             "         2.28848631e+02,  4.79216717e+01,  3.50649069e+02,\n",
             "         3.44788926e+02, -5.16107550e+01,  9.28225583e+01,\n",
             "        -1.42550632e+01,  1.70666829e+02, -1.89572850e+02,\n",
             "         3.71322556e+02, -5.15677197e+02, -2.37500697e+02,\n",
             "        -1.17028565e+01, -2.20417851e+02,  1.78674805e+02,\n",
             "         1.50520082e+02, -2.42254268e+02,  2.33906058e+02,\n",
             "        -3.21254306e+02,  6.97584948e+01,  4.14082148e-01,\n",
             "         3.01747636e+02, -1.67987557e+02, -7.12043526e+00,\n",
             "        -1.07408587e+02,  9.97973672e+01,  1.40330026e+00,\n",
             "         4.20724973e+02,  7.41205548e+01,  2.58185658e+02,\n",
             "         3.27274220e+01, -4.33013491e+02,  3.26228417e+01,\n",
             "        -7.45070769e+01,  1.50790510e+02, -7.61486421e+01,\n",
             "         1.24774374e+02,  3.18966130e+02, -1.22127583e+02,\n",
             "         2.82593390e+02,  1.27971319e+02,  1.65348920e+02,\n",
             "        -1.14395987e+02, -1.86013513e+02, -5.62176450e+01,\n",
             "        -2.86739937e+01, -1.51484389e+02, -1.40646716e+02,\n",
             "        -4.68079696e+02,  2.83916956e+02, -1.57213798e+02,\n",
             "         1.81323710e+02,  1.37242029e+02,  7.94246293e+01,\n",
             "         5.62616970e+01, -2.06529834e+02,  3.06155756e+02,\n",
             "         1.65934101e+02,  2.72576363e+02, -5.03248499e+02,\n",
             "         6.22718397e+01,  2.39013033e+02, -5.25434072e+01,\n",
             "        -1.92251647e+01,  1.51421570e+01,  1.20695928e+02]])
    • c0
      (chain, draw)
      float64
      2.135 8.599 2.809 ... 5.763 -7.103
      array([[ 2.13514678e+00,  8.59869608e+00,  2.80938386e+00,\n",
             "         1.69196496e+01, -3.57940896e+00,  9.44858207e+00,\n",
             "        -6.56356047e+00,  2.57507846e-01,  1.91460134e-02,\n",
             "        -1.21883143e+00, -1.48267536e+01,  4.10682166e+00,\n",
             "         4.92657725e+00, -2.95433876e+00,  6.81914016e+00,\n",
             "         2.84282657e+00,  4.68031400e+00, -5.47146770e+00,\n",
             "         8.09248667e+00, -9.84417305e+00, -7.39903965e+00,\n",
             "         4.46965101e+00,  1.00349417e+01,  3.15625176e+00,\n",
             "        -6.03251036e+00, -5.22825014e+00,  1.16572519e+01,\n",
             "         1.80145346e+00, -4.79905913e+00,  1.42634962e+01,\n",
             "         9.42502779e+00,  4.08792920e+00,  6.32609295e+00,\n",
             "         5.31154516e+00,  9.55928760e+00, -1.27629479e+00,\n",
             "         1.45798579e+01,  1.45475392e+01,  2.59726532e+00,\n",
             "        -1.79436003e+01, -6.51566612e+00, -1.50585509e+01,\n",
             "        -1.34825074e+01,  1.30756615e+01, -9.28522125e+00,\n",
             "        -1.05711495e+01,  2.18100887e+00,  4.07422152e+00,\n",
             "        -1.10832630e+01,  2.46964888e+00, -3.45496168e-01,\n",
             "         9.46767364e+00, -2.02521787e+00,  3.03875335e+00,\n",
             "         1.00646203e+01,  5.93229882e+00,  5.99244443e+00,\n",
             "        -1.80304980e+01, -1.20489949e+01, -1.20043990e+01,\n",
             "         1.47542976e+01,  1.37136922e+01,  2.23648052e+01,\n",
             "         1.25345680e+00,  9.61116324e+00, -4.79461707e+00,\n",
             "         3.79824066e+00,  3.05035502e+00,  8.70005727e+00,\n",
             "         9.13899294e+00, -7.14491076e+00, -1.28689146e+00,\n",
             "         3.54180167e+00, -1.90301868e+01,  1.38868846e+01,\n",
             "        -1.79181657e+01,  6.96628695e+00,  1.58086941e-01,\n",
             "        -2.06483483e+00,  6.16176184e+00,  2.03560113e+01,\n",
             "        -5.66240849e+00, -1.35530460e+01,  5.81203156e+00,\n",
             "         3.86645807e+00, -1.50888025e+01, -3.62022063e+01,\n",
             "        -7.55405716e+00,  1.05111553e+00, -5.69661501e-01,\n",
             "        -1.71951134e+01, -1.54807394e+00,  1.72455845e+01,\n",
             "         4.52105583e+00,  9.72034039e+00,  1.81592743e+00,\n",
             "         7.25720113e+00,  5.89490060e-01,  5.38518856e+00,\n",
             "         1.54653988e+01,  1.26921541e+01, -5.88006164e+00,\n",
             "        -4.12531124e+00, -1.72417319e+01, -2.27398002e+00,\n",
             "         1.24731090e+01, -4.84067978e+00, -1.10223399e+01,\n",
             "        -1.74574397e+00, -5.89785420e+00,  1.13243965e+01,\n",
             "         1.37869509e+01, -7.22828165e-01,  3.87074524e+00,\n",
             "         1.55921954e+01,  6.97113477e+00,  1.98742172e+01,\n",
             "         9.67968321e+00,  2.28768970e+00, -3.01397036e+00,\n",
             "        -8.11803151e+00,  1.04606083e+01, -1.46963196e+01,\n",
             "         6.99207353e+00, -1.34630887e+01,  6.77926560e+00,\n",
             "         2.44637224e+00, -5.48035464e-01, -9.92023252e+00,\n",
             "        -2.22678293e+01, -2.73086867e-01, -8.88407695e+00,\n",
             "        -6.66450123e+00, -1.02065668e+01, -2.84684725e+00,\n",
             "        -1.32151619e+01,  3.40790710e+00, -8.10389363e+00,\n",
             "        -2.29915270e+00, -8.28141108e+00,  3.37615295e+00,\n",
             "         2.31135319e+00, -2.24485288e+01,  2.64832866e+01,\n",
             "        -3.54735906e+00, -8.79161967e+00,  1.20617953e+01,\n",
             "         1.50854119e+01,  5.76327312e+00, -7.10260152e+00]])
    • c1
      (chain, draw)
      float64
      2.985 -3.813 ... -13.68 10.66
      array([[  2.98470499,  -3.81320289, -13.97840041,  -4.67516308,\n",
             "        -10.74764138,  -1.66130462,  13.42282842,  23.02831568,\n",
             "          7.06232138,  14.58241637,   5.66117974,   4.42614873,\n",
             "         -1.01117066,  -2.43453955,   2.68665429,   9.74220003,\n",
             "         -0.39129385,  14.10822045,   5.96514026,   6.12911908,\n",
             "         -2.31691858,  -0.98751463,   1.79936968,   7.09929155,\n",
             "         14.72482214,  12.53652871,   3.02069335,   7.00878405,\n",
             "         -2.31712955,  -0.58384264,  10.24517213,  -0.92378998,\n",
             "          0.81395992,   4.91324981,  13.93210892,  -6.68263917,\n",
             "          0.13488442,  15.17396946, -12.86676008,  -1.52305875,\n",
             "         -6.06915088,  -4.57615979,  -4.12303912,  -0.09021986,\n",
             "         -4.67653311,  13.04817165,   3.67961676,  -3.0079671 ,\n",
             "         10.72752539,  15.0113386 ,  -8.92477814,  -2.55927662,\n",
             "        -16.64186781, -11.98909178,  -8.01249545,   3.74336128,\n",
             "         -4.59065671, -14.95271779,   7.54191215,  -7.88984992,\n",
             "         10.08120225,  -4.38874643,   3.81446542, -17.64690805,\n",
             "          2.88517971,   1.06854355,  -2.7880162 , -20.00389646,\n",
             "         -3.38497011,  -7.44699942,  10.80372587,  12.84443706,\n",
             "          5.38741102,   6.77435447,  10.93788403,  -4.39068383,\n",
             "         -7.92092723,  -7.563736  ,   9.54651729,  -0.28843252,\n",
             "          3.85993764,  10.661499  ,   9.48342268,  -2.60531197,\n",
             "          4.01874875,   9.5789432 ,   5.2483648 ,  11.061762  ,\n",
             "          0.55215343,  -2.0862188 ,  13.87351442, -10.15957715,\n",
             "        -10.76728662,  -8.03791934,   1.21171548,  -1.97868909,\n",
             "         -7.72625626,  -2.04400236,  12.14253339,  -1.72440518,\n",
             "          2.32318224,  -0.03346814,   9.65400719,   4.48867991,\n",
             "         -3.28134731,  -6.00953318,   9.56486499,  -7.62066225,\n",
             "         -6.48788449,  -2.95854427,  -9.41515618,  -3.69534456,\n",
             "         12.22850607,  22.45771546,  -6.03852078,   4.39940675,\n",
             "         -7.6550522 ,   8.00623414,   6.79252191, -10.60458456,\n",
             "         18.06872443,  -3.83418954,   3.82585733,   9.28269961,\n",
             "          3.63628814,   5.44372576, -12.11683906,  -2.09483771,\n",
             "         -7.90890232,  -2.42221316,   9.1523903 ,   2.47215773,\n",
             "         -8.22055145,  -2.80736714, -15.21282983,   9.91286265,\n",
             "          0.80330564,  -9.23636031,  -8.87199556, -10.37206002,\n",
             "        -14.91449238,   0.57053159,  -1.82240064,  -0.49508484,\n",
             "         -8.87161038,  -4.71770571,  -9.08406316,  -2.94991633,\n",
             "        -13.67557605,  10.65778078]])
    • b_sigma
      (chain, draw)
      float64
      528.2 726.8 438.8 ... 36.9 127.3
      array([[528.23711425, 726.75634331, 438.77018873, 185.5974599 ,\n",
             "        187.29610663, 155.34854381, 292.7711614 , 201.52262933,\n",
             "        423.46533503, 424.46402739,  67.88911166, 207.84858594,\n",
             "         30.97309564, 172.95570581, 206.54071365, 279.01194855,\n",
             "         65.63255415, 246.96724639, 225.80126492, 108.35495668,\n",
             "        355.79551106,  84.29340168, 190.52823695,  49.05730384,\n",
             "        402.99379965, 228.29636857,  79.34322641,  67.63853628,\n",
             "        352.4796671 ,  87.54424665, 187.29404949, 372.96434821,\n",
             "        313.61195345, 258.98160237, 561.02780724,  21.98321378,\n",
             "        468.16671945, 644.89131871, 254.70452994, 263.13782916,\n",
             "         33.99719547, 251.77489756, 150.83445543, 493.5081883 ,\n",
             "        177.19785399, 122.65025669,  76.81260875, 145.89054071,\n",
             "         88.15973244,   5.6732434 , 228.22069443, 425.37083528,\n",
             "        128.14934612, 330.8320204 , 255.59866143, 121.6176112 ,\n",
             "        241.316665  , 277.77309929, 467.37572885, 603.23402064,\n",
             "        262.12317714,  19.79471118, 168.85739258, 548.28501914,\n",
             "         55.86436486, 100.81932262, 246.57869616,  62.44653933,\n",
             "        147.87332956, 221.07641855, 151.10074041, 234.95736019,\n",
             "         98.90752745,  98.93115816,  89.21387764, 599.98214851,\n",
             "        133.48843602,  59.49790845, 277.43849093,  37.13688907,\n",
             "        666.11616141, 513.19879444, 247.34811541, 280.00621551,\n",
             "        501.57915881,  77.38941124, 544.91954993, 193.85856319,\n",
             "        324.70467219, 419.90769154, 130.50457023, 334.93801719,\n",
             "        464.55395243, 236.49226296,  86.85654363, 334.27895894,\n",
             "        281.16609105, 120.481762  , 596.78715426, 292.9086711 ,\n",
             "        224.1940135 ,  20.8407661 , 235.65985307, 158.96100385,\n",
             "         27.14461422, 177.46275128, 250.8062993 ,   6.71784792,\n",
             "        266.05461672, 234.92368838,  39.60407026, 603.3210229 ,\n",
             "        492.96677453, 433.59720963, 166.49457764, 408.53946048,\n",
             "         75.26601595, 302.62450885, 626.04386448, 437.78817987,\n",
             "         79.02220934,  25.60639164,  68.06282505, 286.39408996,\n",
             "        340.23401355,  30.58215066, 198.48595284,  70.36108505,\n",
             "         80.88363944, 341.26887539, 346.17023573, 210.08709645,\n",
             "        217.27165867, 298.6070234 , 311.41733674, 384.98746132,\n",
             "        334.92406324, 278.37659785, 118.77833039, 125.96874673,\n",
             "        275.79564008, 121.62080613, 156.20188375, 751.32508029,\n",
             "          9.23604036, 361.43334425, 131.61006904, 145.84172743,\n",
             "         36.8953005 , 127.26144803]])
    • c_sigma
      (chain, draw)
      float64
      1.223 3.522 0.4642 ... 11.57 3.553
      array([[ 1.22288242,  3.52177051,  0.46418876,  2.83556405,  9.19033784,\n",
             "         5.06973944,  3.52176873,  5.34188805,  2.50066861, 10.0792298 ,\n",
             "         7.05368432,  2.8236868 ,  9.67798122,  2.29045641, 10.85754571,\n",
             "         4.73993163, 10.25762458,  5.0975449 ,  3.40716321, 12.0106394 ,\n",
             "         1.69596564,  7.0401133 ,  5.51475558,  6.72170262,  8.58369956,\n",
             "         5.28702372,  0.37238539,  2.13258426, 11.14890632,  3.13277051,\n",
             "         7.44895483,  3.16033315,  0.50942229,  3.39408482,  1.72141798,\n",
             "         5.00988403,  2.79183503,  5.22671002,  4.14428493,  2.54943697,\n",
             "         1.0078325 ,  1.84550021,  4.08505805,  2.44611783, 14.41595369,\n",
             "         7.01485955,  2.394333  ,  0.46508681,  6.80360716,  1.23487565,\n",
             "         2.780502  ,  1.18903398,  2.98888774,  2.87178392, 11.34392974,\n",
             "         2.14561424,  4.52951564,  4.26729775,  2.82855423, 11.60518545,\n",
             "         3.23140055,  6.35398408,  8.37997815,  5.28183324,  2.11935491,\n",
             "         2.02880854,  1.46893345,  5.3705682 ,  8.01733528, 16.39729143,\n",
             "         4.2694474 ,  0.60322704,  0.36513581, 10.40615156,  8.13881496,\n",
             "         9.14459563,  1.65744818,  4.92854531,  8.00161904,  1.06456732,\n",
             "         9.43851453,  9.77272135,  0.90701218,  1.43784307,  0.37635436,\n",
             "         9.12341376,  0.25743942,  1.61466584,  8.99924824,  0.29209885,\n",
             "         8.89984758,  4.38987134,  0.99458862,  4.23206713,  5.10350836,\n",
             "         2.73214447,  6.67390874,  2.10256921, 10.91001773,  2.96318235,\n",
             "         6.22078312,  6.34208617, 10.11836996,  5.07509994,  2.17094107,\n",
             "         3.53481404,  4.65513714,  7.52415867, 13.04754615,  1.70876137,\n",
             "        14.98184438,  4.22013446,  0.98008103,  5.93933025,  5.35291029,\n",
             "         3.34925548,  1.31070019,  2.08140542,  0.52935791,  1.54308953,\n",
             "         7.86524041,  1.87109161,  3.00546464, 10.88846951,  1.0064474 ,\n",
             "         2.4326204 , 12.07798049,  7.20319921,  6.99296112,  1.15043009,\n",
             "         5.12628494,  3.8169647 ,  2.42048592,  3.78302462,  0.36618393,\n",
             "         4.58352435,  0.7190233 ,  3.2937264 ,  0.69941209,  3.27909063,\n",
             "         2.50473517,  1.96875606,  4.85985417,  6.12652268, 12.87658619,\n",
             "         7.41032989,  0.91677403,  2.64947695, 11.57481653,  3.55299734]])
  • created_at :
    2020-01-27T22:37:00.129095
    inference_library :
    pymc3
    inference_library_version :
    3.8
" ], "text/plain": [ "\n", "Dimensions: (chain: 1, draw: 150)\n", "Coordinates:\n", " * chain (chain) int64 0\n", " * draw (draw) int64 0 1 2 3 4 5 6 7 8 ... 142 143 144 145 146 147 148 149\n", "Data variables:\n", " b0 (chain, draw) float64 -93.49 -417.1 -159.3 ... -386.8 261.1 -114.7\n", " b1 (chain, draw) float64 166.7 391.6 -41.08 ... -19.23 15.14 120.7\n", " c0 (chain, draw) float64 2.135 8.599 2.809 ... 15.09 5.763 -7.103\n", " c1 (chain, draw) float64 2.985 -3.813 -13.98 ... -2.95 -13.68 10.66\n", " b_sigma (chain, draw) float64 528.2 726.8 438.8 185.6 ... 145.8 36.9 127.3\n", " c_sigma (chain, draw) float64 1.223 3.522 0.4642 ... 2.649 11.57 3.553\n", "Attributes:\n", " created_at: 2020-01-27T22:37:00.129095\n", " inference_library: pymc3\n", " inference_library_version: 3.8" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "idata_pymc3.prior" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", "Show/Hide data repr\n", "\n", "\n", "\n", "\n", "\n", "Show/Hide attributes\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
xarray.Dataset
    • candidate developer: 2
    • chain: 1
    • draw: 1600
    • chain
      (chain)
      int64
      0
      array([0])
    • draw
      (draw)
      int64
      0 1 2 3 4 ... 1596 1597 1598 1599
      array([   0,    1,    2, ..., 1597, 1598, 1599])
    • candidate developer
      (candidate developer)
      <U7
      'Francis' 'Gerard'
      array(['Francis', 'Gerard'], dtype='<U7')
    • slack_comments
      (chain, draw, candidate developer)
      float64
      3.537e+03 1.095e+04 ... 8.227e+03
      array([[[ 3536.93469044, 10946.35353244],\n",
             "        [ 3283.41196721,  8804.09750257],\n",
             "        [ 3519.01368551,  5445.588128  ],\n",
             "        ...,\n",
             "        [ 6475.17499188, 11071.60735234],\n",
             "        [ 7801.48611356, 11197.82909995],\n",
             "        [ 8070.86988497,  8226.97278995]]])
    • github_commits
      (chain, draw, candidate developer)
      float64
      4.627 22.14 16.92 ... 29.06 35.58
      array([[[ 4.62683704, 22.14496593],\n",
             "        [16.91542147, 33.60558345],\n",
             "        [17.91251374, 19.19516229],\n",
             "        ...,\n",
             "        [23.85175217, 38.4484609 ],\n",
             "        [17.8965216 , 31.59160004],\n",
             "        [29.06334661, 35.58299212]]])
  • created_at :
    2020-01-27T22:37:07.840756
    inference_library :
    pymc3
    inference_library_version :
    3.8
" ], "text/plain": [ "\n", "Dimensions: (candidate developer: 2, chain: 1, draw: 1600)\n", "Coordinates:\n", " * chain (chain) int64 0\n", " * draw (draw) int64 0 1 2 3 4 5 ... 1595 1596 1597 1598 1599\n", " * candidate developer (candidate developer) \n", "\n", "\n", "Show/Hide data repr\n", "\n", "\n", "\n", "\n", "\n", "Show/Hide attributes\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
xarray.Dataset
    • candidate developer: 2
    • candidate developer
      (candidate developer)
      <U7
      'Francis' 'Gerard'
      array(['Francis', 'Gerard'], dtype='<U7')
    • time_since_joined
      (candidate developer)
      float64
      3.6 5.1
      array([3.6, 5.1])
  • created_at :
    2020-01-27T22:37:07.842636
    inference_library :
    pymc3
    inference_library_version :
    3.8
" ], "text/plain": [ "\n", "Dimensions: (candidate developer: 2)\n", "Coordinates:\n", " * candidate developer (candidate developer)