-
-
Notifications
You must be signed in to change notification settings - Fork 123
Issue/870 affine xform clarification #872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 3 commits
8052139
4ede2d7
1eb1bc2
9383f77
c9731d2
168a99e
b3291de
a5dccff
acba64c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
+0 −136 | Jenkinsfile | |
+1 −2 | stan.xml | |
+0 −1 | theme-colors.scss | |
+4 −4 | theme-dark.scss | |
+2 −4 | theme.scss |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -266,8 +266,6 @@ funnel's neck is particularly sharp because of the exponential | |
function applied to $y$. A plot of the log marginal density of $y$ | ||
and the first dimension $x_1$ is shown in the following plot. | ||
|
||
|
||
|
||
The funnel can be implemented directly in Stan as follows. | ||
|
||
```stan | ||
|
@@ -327,14 +325,26 @@ model { | |
``` | ||
|
||
In this second model, the parameters `x_raw` and `y_raw` are | ||
sampled as independent standard normals, which is easy for Stan. These | ||
are then transformed into samples from the funnel. In this case, the | ||
same transform may be used to define Monte Carlo samples directly | ||
based on independent standard normal samples; Markov chain Monte Carlo | ||
methods are not necessary. If such a reparameterization were used in | ||
Stan code, it is useful to provide a comment indicating what the | ||
distribution for the parameter implies for the distribution of the | ||
transformed parameter. | ||
sampled as independent standard normals, which is easy for Stan, | ||
and then transformed into samples from the funnel. | ||
When this reparameterization is used in Stan code, a comment indicating what the | ||
|
||
distribution for the parameter implies for the distribution of the transformed parameter | ||
will improve readibility and maintainability. | ||
|
||
As of Stan release v2.19.0, this program can be written using Stan's | ||
[affinely transformed real type](https://mc-stan.org/docs/reference-manual/types.html#affine-transform.section). | ||
The affine transform on the vector `x` is applied to each element of `x`. | ||
|
||
```stan | ||
parameters { | ||
real<multiplier=3> y; | ||
vector<multiplier=exp(y/2)>[9] x; | ||
} | ||
model { | ||
y ~ std_normal(); // implies y ~ normal(0, 3) | ||
|
||
x ~ std_normal(); // implies x ~ normal(0, exp(y/2)) | ||
} | ||
``` | ||
|
||
### Reparameterizing the Cauchy {-} | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.