\n",
+ " "
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
}
],
"source": [
"with pm.Model() as model:\n",
" # A variable Q has to be defined if you want to use the variance reduction feature\n",
" # Q can be of any dimension - here it a scalar\n",
- " Q = pm.Data(\"Q\", np.float(0.0))\n",
+ " Q = pm.Data(\"Q\", np.float64(0.0))\n",
"\n",
" # Define priors\n",
" intercept = pm.Normal(\"Intercept\", 0, sigma=20)\n",
@@ -418,6 +493,7 @@
" tune=ntune,\n",
" discard_tuned_samples=True,\n",
" random_seed=RANDOM_SEED,\n",
+ " cores=1,\n",
" )\n",
"\n",
" trace2 = pm.sample(\n",
@@ -427,6 +503,7 @@
" tune=ntune,\n",
" discard_tuned_samples=True,\n",
" random_seed=RANDOM_SEED,\n",
+ " cores=1,\n",
" )"
]
},
@@ -439,17 +516,9 @@
},
{
"cell_type": "code",
- "execution_count": 8,
+ "execution_count": 22,
"metadata": {},
"outputs": [
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "/home/mikkel/venv/pymc3_mlda_develop/lib/python3.6/site-packages/arviz/data/io_pymc3.py:91: FutureWarning: Using `from_pymc3` without the model will be deprecated in a future release. Not using the model will return less accurate and less useful results. Make sure you use the model argument or call from_pymc3 within a model context.\n",
- " FutureWarning,\n"
- ]
- },
{
"data": {
"text/html": [
@@ -487,30 +556,30 @@
" \n",
"
\n",
"
Intercept
\n",
- "
1.001
\n",
- "
0.040
\n",
- "
0.929
\n",
- "
1.078
\n",
+ "
1.002
\n",
+ "
0.039
\n",
+ "
0.933
\n",
+ "
1.080
\n",
"
0.001
\n",
"
0.001
\n",
- "
2319.0
\n",
- "
2319.0
\n",
- "
2314.0
\n",
- "
2934.0
\n",
+ "
2487.0
\n",
+ "
2481.0
\n",
+ "
2501.0
\n",
+ "
2887.0
\n",
"
1.0
\n",
"
\n",
"
\n",
"
x
\n",
"
1.996
\n",
- "
0.068
\n",
- "
1.874
\n",
- "
2.126
\n",
+ "
0.067
\n",
+ "
1.875
\n",
+ "
2.123
\n",
"
0.001
\n",
"
0.001
\n",
- "
2271.0
\n",
- "
2261.0
\n",
- "
2257.0
\n",
- "
2782.0
\n",
+ "
2535.0
\n",
+ "
2535.0
\n",
+ "
2536.0
\n",
+ "
2862.0
\n",
"
1.0
\n",
"
\n",
" \n",
@@ -519,36 +588,30 @@
],
"text/plain": [
" mean sd hdi_3% hdi_97% mcse_mean mcse_sd ess_mean \\\n",
- "Intercept 1.001 0.040 0.929 1.078 0.001 0.001 2319.0 \n",
- "x 1.996 0.068 1.874 2.126 0.001 0.001 2271.0 \n",
+ "Intercept 1.002 0.039 0.933 1.080 0.001 0.001 2487.0 \n",
+ "x 1.996 0.067 1.875 2.123 0.001 0.001 2535.0 \n",
"\n",
" ess_sd ess_bulk ess_tail r_hat \n",
- "Intercept 2319.0 2314.0 2934.0 1.0 \n",
- "x 2261.0 2257.0 2782.0 1.0 "
+ "Intercept 2481.0 2501.0 2887.0 1.0 \n",
+ "x 2535.0 2536.0 2862.0 1.0 "
]
},
- "execution_count": 8,
+ "execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "pm.stats.summary(trace1)"
+ "with model:\n",
+ " trace1_az = az.from_pymc3(trace1)\n",
+ "az.summary(trace1_az)"
]
},
{
"cell_type": "code",
- "execution_count": 9,
+ "execution_count": 23,
"metadata": {},
"outputs": [
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "/home/mikkel/venv/pymc3_mlda_develop/lib/python3.6/site-packages/arviz/data/io_pymc3.py:91: FutureWarning: Using `from_pymc3` without the model will be deprecated in a future release. Not using the model will return less accurate and less useful results. Make sure you use the model argument or call from_pymc3 within a model context.\n",
- " FutureWarning,\n"
- ]
- },
{
"data": {
"text/html": [
@@ -587,29 +650,29 @@
"