-
Notifications
You must be signed in to change notification settings - Fork 5
/
Exercie_3.Rmd
45 lines (24 loc) · 1.4 KB
/
Exercie_3.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
title: "Homework - Bayer´s Rule"
author: "René Neuling - Jakob Feyrer"
date: "25 November 2018"
output: html_document
---
# Exercise Bayer´s Rule
## Task
Assume that lightning strike causes wildfires with a probability of 1/1000. You observe a wildfire and an eyewitness claims that it was lit by lightning. What is the probability that this is correct, knowing that eyewitness reports are reliable 80% of the time?
## Define all Parameters and describe Bayer´s law
we have a wildfire because of a lithning
lithning was the trigger and was seen with conditional probability of Bayer´s rule
If we write Bayer´s rule in words:
Posterior = Likelihood × Prior / Evidence # to see in lecture 4
Bayer´s rule = P(L|W) = L(W|L) * P(L) / P(W)
P(W) = PW(W|L) * P(L) + P(L|W_c) * P(W_c)
P_L = 0.001 # probability, that the wildfire was caused be lithning
P_W_c = 1 - P_L = 0.999 # probability of wildfire caused be another faktor
P_L_W = 0.8 # withness of a report, that the wildfire was caused be lithning
P_L_K_c = 0.2 # # probability that the eyewithness is wrong
# now we have defined all parameters and can calcute
## Because we have a probability, we have to multiply the result with 100
P(L|W) = (P_W_L * P_L) / (P_W_L * P_L) + (P_L_c * P_W_c) * 100
The probability, that the wildfire was caused be lithning with knowing, that was seen is 0.4%