Created
December 9, 2024 07:21
-
-
Save aakhmetz/205461cf16d1f295e808fb363b088575 to your computer and use it in GitHub Desktop.
20241209_Bayesian_class
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
{ | |
"a0": 0.700102, | |
"b0": 1, | |
"N": 94, | |
"k": 8 | |
} |
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 { | |
real<lower = 0> a0; | |
real<lower = 0> b0; | |
int<lower = 1> N; // total number of infections | |
int<lower = 0, upper = N> k; // number of infections among vaccinated | |
} | |
parameters { | |
real<lower = 0, upper = 1> theta; | |
} | |
transformed parameters { | |
real<lower = -1, upper = 1> VE = (1 - 2 * theta) / (1 - theta); | |
} | |
model { | |
theta ~ beta(a0, b0); | |
//target += beta_lpdf(theta | a0, b0); | |
k ~ binomial(N, theta); | |
} | |
generated quantities { | |
int k_pred = binomial_rng(N, theta); | |
} |
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
{"title":"Untitled"} |
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
{"num_chains":4,"num_warmup":1000,"num_samples":1000,"init_radius":2} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment