Skip to content

Commit

Permalink
updated mle-params knitr case study
Browse files Browse the repository at this point in the history
  • Loading branch information
Bob Carpenter committed Apr 19, 2016
1 parent 024b497 commit 67e4ba7
Show file tree
Hide file tree
Showing 6 changed files with 537 additions and 280 deletions.
7 changes: 7 additions & 0 deletions knitr/mle-params/license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
The code in this repository is copyrighted by Columbia University and licensed under the new BSD (3-clause) license:

https://opensource.org/licenses/BSD-3-Clause

The text in this repository is copyrighted by Bob Carpenter and licensed under the CC-BY 4.0 license:

https://creativecommons.org/licenses/by/4.0/
13 changes: 7 additions & 6 deletions knitr/mle-params/logodds-jac.stan
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ data {
parameters {
real alpha;
}
model {
for (n in 1:N)
y[n] ~ bernoulli(inv_logit(alpha));
increment_log_prob(log(inv_logit(alpha)) + log(1 - inv_logit(alpha)));
}
generated quantities {
transformed parameters {
real<lower=0, upper=1> theta;
theta <- inv_logit(alpha);
}
model {
for (n in 1:N)
y[n] ~ bernoulli(theta);
theta ~ uniform(0, 1);
increment_log_prob(log(theta) + log(1 - theta));
}
11 changes: 6 additions & 5 deletions knitr/mle-params/logodds.stan
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ data {
parameters {
real alpha;
}
model {
for (n in 1:N)
y[n] ~ bernoulli(inv_logit(alpha));
}
generated quantities {
transformed parameters {
real<lower=0, upper=1> theta;
theta <- inv_logit(alpha);
}
model {
for (n in 1:N)
y[n] ~ bernoulli(theta);
theta ~ uniform(0, 1);
}
Loading

0 comments on commit 67e4ba7

Please sign in to comment.