Today, one of my friends came to ask me about a question in their course , The Bayes formula must be applied , The title is as follows :

Known incidence rate 5%, False negative rate 5%, False positive rate 5%, If a person has a positive result , So how likely is he to have the disease ?

First of all, it needs to be explained , False Yang is to test the healthy into the sick , False Yin is to test those who are sick and have no disease .

Then we move out the Bayesian formula :
p(x∣y)=p(x)∗p(y∣x)p(y)=p(x)∗p(y∣x)∑i=1np(xi)∗p(y∣xi) \begin{aligned} p(x|y) &=
\frac {p(x)*p(y|x)} {p(y)} \\ &= \frac {p(x)*p(y|x)}
{\sum_{i=1}^np(x_i)*p(y|x_i)} \end{aligned}p(x∣y)​=p(y)p(x)∗p(y∣x)​=∑i=1n​p(xi​)
order p(x) Incidence rate ,p(y) Is the probability of positive detection , that p(x|y) Is the probability of illness when positive ,p(y|x) It's the probability that a patient is known to be positive ( That is the true positive rate ).

So the result is p(x|y) Value of , Next, go through the other three values :

* p(x) The incidence rate has been given as 5%
* p(y|x) Is the true positive rate , use 1 Subtract the false negative rate ( True Yang means that there is a disease and a disease is detected , False Yin is a disease, not a disease ), by 95%
* p(y) Is the probability of positive detection , It's divided into two parts , One is the detection of disease , The other is that the disease is not detected ( incidence rate x True positive rate + Non incidence rate x False positive rate ):5%*95%+(1-5%)*5%
p(y) It is better to use formula to express the problem :


p(y∣xˉ)p(y|\bar{x})p(y∣xˉ) Detection of disease for no disease , The false positive rate .p(y) Put it in the Bayesian formula , mean :

\begin{aligned} p(x|y) &= \frac {p(x)*p(y|x)}
{p(x)*p(y|x)+p(\bar{x})*p(y|\bar{x})} \\ &= \frac {5\%*95\%}
{5\%*95\%+(1-5\%)*5\%} \\ &= 50\% \end{aligned}p(x∣y)​=p(x)∗p(y∣x)+p(xˉ)∗p(y∣xˉ)

So our answer is 50%,3 individual 5% The final accuracy of 50%, So the false positive rate and false negative rate seem to be small, but they have a great impact .

©2020 ioDraw All rights reserved
JavaScript study ( Scope )R Language group summation , Group average , Group count antd table sort 2021 Front end high frequency interview questions ( You have to watch it !!!)Android end Firefox Testing credit card and address auto fill function Sql What is the order of execution of ?vue+element-ui Realize the input limit of price 2021 Front end interview questions and written questions ——Vuejavascript Adding and deleting form information FastAPI to write get,post Interface , adopt json Interface for parameter transfer