Say we have to following data:
p = 0.95 -> rate of **true positive** result of pcr test.
q = 0.1 -> rate of **false positive** result of pcr test.
s = 0.2 -> rate of **total** patients in the population
Our goal is to **estimate** the **parameters** **p**, **q** and **s** with Bayesian methods
I generated data of 1000 people who come to check and I got data with zeros and ones.
Something like that:
Now, I to compute the **likelihood** of these parameters in order to calculate the posterior later, how can I do it?
I'm really got stuck on this.
If it helps I have information about the priors:
**Prior for the parameter p:**
[math]f_q(q)=\begin{cases}2q, &\text{if } 0\leq q\leq1\\ 0, &\text{otw } \end{cases}.[/math]
**prior for the parameter q:**
[math]f_p(p)=\begin{cases}2(1-p), &\text{if } 0\leq p\leq1\\ 0, &\text{otw } \end{cases}.[/math]
**prior for the parameter s:**
[math]s\sim U(0,1)[/math]
p = 0.95 -> rate of **true positive** result of pcr test.
q = 0.1 -> rate of **false positive** result of pcr test.
s = 0.2 -> rate of **total** patients in the population
Our goal is to **estimate** the **parameters** **p**, **q** and **s** with Bayesian methods
I generated data of 1000 people who come to check and I got data with zeros and ones.
Something like that:
Code:
really <- rbinom(1000,1,s);
test <- rbinom(1000,1,really*p+(1-really)*q)
Now, I to compute the **likelihood** of these parameters in order to calculate the posterior later, how can I do it?
I'm really got stuck on this.
If it helps I have information about the priors:
**Prior for the parameter p:**
[math]f_q(q)=\begin{cases}2q, &\text{if } 0\leq q\leq1\\ 0, &\text{otw } \end{cases}.[/math]
**prior for the parameter q:**
[math]f_p(p)=\begin{cases}2(1-p), &\text{if } 0\leq p\leq1\\ 0, &\text{otw } \end{cases}.[/math]
**prior for the parameter s:**
[math]s\sim U(0,1)[/math]