Skip to content

Commit ba7a06a

Browse files
committed
Created using Colaboratory
1 parent e4a9320 commit ba7a06a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

jupyter/covid-inf-rate/SantaClara_CmdStanR.ipynb

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,16 @@
350350
"execution_count": 0,
351351
"outputs": []
352352
},
353+
{
354+
"cell_type": "markdown",
355+
"metadata": {
356+
"id": "yWNEf0sdC1Kk",
357+
"colab_type": "text"
358+
},
359+
"source": [
360+
"In order to avoid divergent iterations, which result in biased estimates, we set the parameter `adapt_delta` to 0.98."
361+
]
362+
},
353363
{
354364
"cell_type": "code",
355365
"metadata": {
@@ -359,7 +369,7 @@
359369
},
360370
"source": [
361371
"hier_model <- cmdstan_model(stan_file='hier_sens_spec.stan')\n",
362-
"hier_fit <- hier_model$sample(data='santa_clara_all.data.json')\n"
372+
"hier_fit <- hier_model$sample(data='santa_clara_all.data.json', adapt_delta=0.98)\n"
363373
],
364374
"execution_count": 0,
365375
"outputs": []
@@ -421,7 +431,7 @@
421431
},
422432
"source": [
423433
"hier_model_v2 <- cmdstan_model(stan_file='hier_sens_spec_offset_mult.stan')\n",
424-
"hier_fit_v2 <- hier_model_v2$sample(data='santa_clara_all.data.json')"
434+
"hier_fit_v2 <- hier_model_v2$sample(data='santa_clara_all.data.json', adapt_delta=0.98)"
425435
],
426436
"execution_count": 0,
427437
"outputs": []

0 commit comments

Comments
 (0)