Skip to content

Commit 91d6183

Browse files
committed
changes per code review
1 parent 5ab4bf4 commit 91d6183

1 file changed

Lines changed: 39 additions & 3 deletions

File tree

docsrc/examples/VI as Sampler Inits.ipynb

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,44 @@
3333
"model = CmdStanModel(stan_file=stan_file)"
3434
]
3535
},
36+
{
37+
"cell_type": "markdown",
38+
"metadata": {},
39+
"source": [
40+
"The earnings dataset is a set of 1192 observations of annual earnings in USD, height in inches, and indicator for sex==male."
41+
]
42+
},
43+
{
44+
"cell_type": "code",
45+
"execution_count": null,
46+
"metadata": {},
47+
"outputs": [],
48+
"source": [
49+
"import json\n",
50+
"with open(data_file, 'r') as fd:\n",
51+
" data_dict = json.load(fd)\n",
52+
"print(data_dict.keys())\n",
53+
"print(data_dict['N'])\n",
54+
"for i in range(5):\n",
55+
" print(data_dict['earn'][i], data_dict['height'][i])\n"
56+
]
57+
},
58+
{
59+
"cell_type": "markdown",
60+
"metadata": {},
61+
"source": [
62+
"The \"logearn_height\" model regresses the log earnings on height."
63+
]
64+
},
65+
{
66+
"cell_type": "code",
67+
"execution_count": null,
68+
"metadata": {},
69+
"outputs": [],
70+
"source": [
71+
"print(model.code())"
72+
]
73+
},
3674
{
3775
"cell_type": "markdown",
3876
"metadata": {},
@@ -143,9 +181,7 @@
143181
"cell_type": "markdown",
144182
"metadata": {},
145183
"source": [
146-
"On my machine, using the variational estimates to skip warmup phase I shows improved N_Eff/s (number of effective sampler per second) values for all parameters.\n",
147-
"\n",
148-
"This is a simple model run on a small dataset. For complex models where the initial parameter values are far from the default initializations, this procedure may allow for faster and better adaptation during warmup."
184+
"Using the variational estimates to skip warmup phase I shows improved N_Eff/s (number of effective sampler per second) values for all parameters. This is a simple model run on a small dataset. For complex models where the initial parameter values are far from the default initializations, this procedure may allow for faster and better adaptation during warmup."
149185
]
150186
}
151187
],

0 commit comments

Comments
 (0)