Editing
Bayesian Statistics
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== <span style="color: #FFFFFF;">Applying</span> == '''Calculating Posterior Probability (Medical Test):''' <syntaxhighlight lang="python"> def bayes_update(prior, sensitivity, specificity): """ prior: P(Disease) sensitivity: P(+ | Disease) specificity: P(- | No Disease) """ # P(Positive Test | No Disease) false_positive_rate = 1 - specificity # P(Evidence) = P(E|H)P(H) + P(E|~H)P(~H) p_evidence = (sensitivity * prior) + (false_positive_rate * (1 - prior)) # Posterior P(H|E) posterior = (sensitivity * prior) / p_evidence return posterior # Rare disease: 0.1% of population # Test: 95% sensitive, 95% specific prior_prob = 0.001 result = bayes_update(prior_prob, 0.95, 0.95) print(f"Prior Probability: {prior_prob*100:.2f}%") print(f"Posterior Probability after Positive Test: {result*100:.2f}%") # Even with a '95% accurate' test, you only have ~1.8% chance of being sick! </syntaxhighlight> ; Bayesian Applications : '''Spam Filters''' β Updating the probability that an email is "Spam" based on the presence of words like "Free" or "Viagra." : '''Self-Driving Cars''' β Constantly updating the "Belief State" of where other cars are based on noisy sensor data (Kalman Filters). : '''Medical Diagnosis''' β Doctors implicitly use Bayesian reasoning when they consider a patient's symptoms alongside their age and history. : '''Scientific Discovery''' β Using "Bayesian Search Theory" to find missing ships or planes (like the search for MH370). </div> <div style="background-color: #8B4500; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;">
Summary:
Please note that all contributions to BloomWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
BloomWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information