-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #132 from Julia-Tempering/stan_banana
Stan banana example
- Loading branch information
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// n-dimensional banana, as defined sec 3 of https://doi.org/10.1111/sjos.12532 | ||
// uses n1 = 2, n2 = dim => total dims = dim + 1 | ||
// easier values from eq 50 of https://arxiv.org/abs/2003.03636 | ||
// x ~ N(0, s_a) // s_a = sqrt(inv(2a)), a = 1/20 (2.5 easier) | ||
// y_{1:d}|x ~ N(x^2, s_b) // s_b = sqrt(inv(2b)), b = 5 (50 easier) | ||
data { | ||
int<lower=1> dim; | ||
} | ||
transformed data { | ||
real a, b, s_a, s_b; | ||
a = inv(20); | ||
b = 5.0; | ||
s_a = sqrt(inv(2*a)); | ||
s_b = sqrt(inv(2*b)); | ||
} | ||
parameters { | ||
real x; | ||
vector[dim] y; | ||
} | ||
model { | ||
x ~ normal(0, s_a); | ||
y ~ normal(square(x), s_b); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters