Probabilities in R (Bayes Rule example)
This code shows an example that implements Bayes Rule. In this case it calculates a posteriori probabilities for a case of a components based system failure. (code is documented) #Probability #Bayes Rule #Problem2: # C1:"Components of type 1 in a system", # C2="Components of type 2 in a system", # C3="Components of type 3 in a system" # F ="A component of the system fails" # F given C1 = "System fails because a component of type 1" # F given C2 = "System fails because a component of type 2" # F given C3 = "System fails because a component of type 3" # We want to know (posteriori): If system fails what are: P(C1| F) , P(C2|F), P(C3|F) # Priori probs pC1 P(A given B) = P(A and B) / P(B) intersections