You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/stan-users-guide/efficiency-tuning.qmd
+13-9Lines changed: 13 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -267,9 +267,6 @@ function applied to $y$. A plot of the log marginal density of $y$
267
267
and the first dimension $x_1$ is shown in the following plot.
268
268
269
269
270
-
The marginal density of Neal's funnel for the upper-level variable $y$ and one lower-level variable $x_1$ (see the text for the formula). The blue region has log density greater than -8, the yellow region density greater than -16, and the gray background a density less than -16.
271
-
272
-

273
270
274
271
The funnel can be implemented directly in Stan as follows.
275
272
@@ -289,16 +286,23 @@ the neck of the funnel, where $y$ is small and thus $x$ is constrained
289
286
to be near 0. This is due to the fact that the density's scale
290
287
changes with $y$, so that a step size that works well in the body will
291
288
be too large for the neck, and a step size that works in the neck will be
292
-
inefficient in the body. This can be seen in the following plot.
289
+
inefficient in the body. This can be seen in the following plots.
290
+
291
+
::: {#fig-funnel layout="[55, 45]"}
292
+
293
+

294
+
295
+

296
+
293
297
294
-
4000 draws are taken from a run of Stan's sampler with default settings. Both
295
-
plots are restricted to the shown window of $x_1$ and $y$ values; some
296
-
draws fell outside of the displayed area as would be expected given
298
+
Neal's funnel. (Left) The marginal density of Neal's funnel for the upper-level variable $y$ and one lower-level variable $x_1$ (see the text for the formula). The blue region has log density greater than -8, the yellow region density greater than -16, and the gray background a density less than -16.
299
+
(Right) 4000 draws are taken from a run of Stan's sampler with default settings.
300
+
Both plots are restricted to the shown window of $x_1$ and $y$ values;
301
+
some draws fell outside of the displayed area as would be expected given
297
302
the density. The samples are consistent with the marginal density
298
303
$p(y) = \textsf{normal}(y \mid 0,3)$, which has mean 0 and standard
299
304
deviation 3.
300
-
301
-

305
+
:::
302
306
303
307
In this particular instance, because the analytic form of the density
304
308
from which samples are drawn is known, the model can be converted to
0 commit comments