Before giving the Bayes theorem statement is important to define the conditional probability. Once done, the Bayes theorem is easy to derive. Conditional Probability The conditional probability measures the likelihood of an event given that another event has occurred. For instance, assuming that A is the event of interest and that B consists of a different event which has already occurred. The probability of the event A to occur, given the occurrence of B , (written as) P ( A | B ), can be computed as detailed by the following equality. P(A | B) = P(A ∩ B) / P(B) P( B ) > 0 (1) It is defined as the quotient of the probability of the joint events A and B and the probability of B . Now consider P(B | A), which is equals to P(B ∩ A) / P(A). Since P(B ∩ A) = P(A ∩ B), then the fo...
Before giving the notion of conditional frequency first is important to define what is a contingency table, sometimes called two-way frequency table. A contingency table is a table which displays the (multivariate) frequency distribution of the variables of interest. For instance, consider the following dataset which contains information regarding a basket experiment made on a sample of 33 students. Boys Girls Totals Made 7 (21.2%) 6 (18.2%) 13 (39,4%) Missed 11 (33,3%) 9 (27.3%) 20 (60.6%) Totals 18 (54.5%) 15 (45.5%) 100% Every cell contains a joint relative frequency, which is the ratio of the frequency in a particular category and the total number of data values. As an example, 21.2% is obtained dividing 7 (the number of boys that made a basket) by the total of students, which is 33. Thus 7/33 = 21.2% is the joint relative frequency of boys that made a basket. The numbers in...
The variance is the expectation of the squared deviation of a random variable form its mean. Informally, it measures how far a set of (random) numbers are spread out from their average value. The variance is the square of the standard deviation, the second central moment of a distribution and the covariance of the random variable with itself, and it is often represented by Var(X), σ 2 , s 2 . One of the most widely known formula for computing the variance is: where x-bar is the mean of the sample. The definition given above can be converted into an algorithm that computed the variance and the standard deviation in two passes: 1. Compute the mean (O(n)) 2. Compute the square differences (O(n)) Output the variance Even though this algorithm seems working properly, it may become too expensive on some input instances. Just consider a sampling procedu...
Commenti
Posta un commento