Last active
January 2, 2022 05:55
-
-
Save arosh/69331f37ae160b71917d53ddcd3c279c to your computer and use it in GitHub Desktop.
hotbath
This file contains hidden or 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
data { | |
int<lower=0> Y[4]; | |
} | |
parameters { | |
real mu; | |
real<lower=0> sigma; | |
} | |
transformed parameters { | |
vector<lower=0>[4] theta; | |
theta[1] = normal_cdf(39.5 | mu, sigma); | |
theta[2] = normal_cdf(40.5 | mu, sigma) - normal_cdf(39.5 | mu, sigma); | |
theta[3] = normal_cdf(41.5 | mu, sigma) - normal_cdf(40.5 | mu, sigma); | |
theta[4] = 1 - normal_cdf(41.5 | mu, sigma); | |
} | |
model { | |
Y ~ multinomial(theta); | |
} | |
generated quantities { | |
int<lower=0> Y_pred[4]; | |
Y_pred = multinomial_rng(theta, sum(Y)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment