Skip to content

Commit

Permalink
Merge pull request #134 from Julia-Tempering/funnel-scale
Browse files Browse the repository at this point in the history
scale parameter for funnel
  • Loading branch information
miguelbiron authored Sep 20, 2023
2 parents 5f1520d + 2b37186 commit d2c4ec8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
SplittableRandoms = "8efc31e9-3fb0-4277-b18c-5a3d5d07abad"
StatsFuns = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd"

[compat]
Documenter = "0.27"

5 changes: 3 additions & 2 deletions examples/stan/funnel.stan
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
data {
int<lower=1> dim;
real<lower=0> scale;
}
parameters {
real y;
vector[dim] x;
}
model {
y ~ normal(0, 3);
x ~ normal(0, exp(y/2));
}
x ~ normal(0, exp(y/scale));
}
6 changes: 3 additions & 3 deletions src/targets/toy_stan_target.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ toy_stan_unid_target(n_trials = 100000, n_successes = ceil(Int, n_trials/2)) =
json(; n_trials, n_successes)
)

stan_funnel(dim = 9) =
stan_funnel(dim = 9, scale = 2.0) =
StanLogPotential(
stan_example_path("funnel.stan"),
json(; dim)
json(; dim, scale)
)

stan_bernoulli(y = [0,1,0,0,0,0,0,0,0,1]) =
Expand Down Expand Up @@ -62,4 +62,4 @@ json(; variables...) =
map(
pair -> "\"$(pair[1])\" : $(pair[2])",
collect(variables)), ",") *
"}"
"}"

0 comments on commit d2c4ec8

Please sign in to comment.