Bayes Theorem (4A) Young Won Lim 3/5/18

Similar documents
Bayes Theorem (10B) Young Won Lim 6/3/17

Relations (3A) Young Won Lim 3/27/18

Higher Order ODE's (3A) Young Won Lim 7/7/14

Matrix Transformation (2A) Young Won Lim 11/10/12

General CORDIC Description (1A)

Higher Order ODE's (3A) Young Won Lim 12/27/15

Expected Value (10D) Young Won Lim 6/12/17

CT Rectangular Function Pairs (5B)

The Growth of Functions (2A) Young Won Lim 4/6/18

Detect Sensor (6B) Eddy Current Sensor. Young Won Lim 11/19/09

Root Locus (2A) Young Won Lim 10/15/14

Background Trigonmetry (2A) Young Won Lim 5/5/15

Fourier Analysis Overview (0A)

Hamiltonian Cycle (3A) Young Won Lim 5/5/18

Higher Order ODE's (3A) Young Won Lim 7/8/14

DFT Frequency (9A) Each Row of the DFT Matrix. Young Won Lim 7/31/10

Differentiation Rules (2A) Young Won Lim 1/30/16

Implication (6A) Young Won Lim 3/17/18

Fourier Analysis Overview (0A)

General Vector Space (2A) Young Won Lim 11/4/12

Complex Trigonometric and Hyperbolic Functions (7A)

Resolution (7A) Young Won Lim 4/21/18

Propositional Logic Resolution (6A) Young W. Lim 12/12/16

Matrix Transformation (2A) Young Won Lim 11/9/12

Introduction to ODE's (0A) Young Won Lim 3/9/15

Signal Functions (0B)

Separable Equations (1A) Young Won Lim 3/24/15

Discrete Time Rect Function(4B)

Propositional Logic Resolution (6A) Young W. Lim 12/31/16

Down-Sampling (4B) Young Won Lim 10/25/12

Line Integrals (4A) Line Integral Path Independence. Young Won Lim 10/22/12

Implication (6A) Young Won Lim 3/12/18

Capacitor Young Won Lim 06/22/2017

Discrete Time Rect Function(4B)

Linear Equations with Constant Coefficients (2A) Young Won Lim 4/13/15

Capacitor and Inductor

Capacitor and Inductor

Fourier Analysis Overview (0B)

Capacitor in an AC circuit

Dispersion (3A) 1-D Dispersion. Young W. Lim 10/15/13

Propositional Logic Logical Implication (4A) Young W. Lim 4/11/17

Signal Processing. Young Won Lim 2/20/18

Down-Sampling (4B) Young Won Lim 11/15/12

Differentiation Rules (2A) Young Won Lim 2/22/16

Group & Phase Velocities (2A)

Up-Sampling (5B) Young Won Lim 11/15/12

Probability (10A) Young Won Lim 6/12/17

Propagating Wave (1B)

Magnetic Sensor (3B) Magnetism Hall Effect AMR Effect GMR Effect. Young Won Lim 9/23/09

Higher Order ODE's, (3A)

Complex Series (3A) Young Won Lim 8/17/13

Audio Signal Generation. Young Won Lim 1/29/18

Sequential Circuit Timing. Young Won Lim 11/6/15

ODE Background: Differential (1A) Young Won Lim 12/29/15

Propositional Logic Logical Implication (4A) Young W. Lim 4/21/17

Definitions of the Laplace Transform (1A) Young Won Lim 1/31/15

Digital Signal Octave Codes (0A)

Propositional Logic Arguments (5A) Young W. Lim 11/30/16

Line Integrals (4A) Line Integral Path Independence. Young Won Lim 11/2/12

Signals and Spectra (1A) Young Won Lim 11/26/12

Phasor Young Won Lim 05/19/2015

General Vector Space (3A) Young Won Lim 11/19/12

Propositional Logic Arguments (5A) Young W. Lim 11/8/16

FSM Examples. Young Won Lim 11/6/15

Propositional Logic Arguments (5A) Young W. Lim 10/11/16

Digital Signal Octave Codes (0A)

Bayesian Updating: Discrete Priors: Spring

Signal Processing. Young Won Lim 2/22/18

First Order Logic Implication (4A) Young W. Lim 4/6/17

Complex Functions (1A) Young Won Lim 2/22/14

Digital Signal Octave Codes (0A)

Group Velocity and Phase Velocity (1A) Young Won Lim 5/26/12

Propositional Logic Arguments (5B) Young W. Lim 11/30/16

Audio Signal Generation. Young Won Lim 2/2/18

Hyperbolic Functions (1A)

Digital Signal Octave Codes (0A)

Logic Background (1A) Young W. Lim 5/14/18

Group Delay and Phase Delay (1A) Young Won Lim 7/19/12

Background ODEs (2A) Young Won Lim 3/7/15

Digital Signal Octave Codes (0A)

Introduction to ODE's (0P) Young Won Lim 12/27/14

CMOS Inverter. Young Won Lim 3/31/16

CLTI Differential Equations (3A) Young Won Lim 6/4/15

MA : Introductory Probability

Automata Theory (2A) Young Won Lim 5/31/18

Bayesian Updating: Discrete Priors: Spring

Audio Signal Generation. Young Won Lim 2/2/18

Finite State Machine (1A) Young Won Lim 6/9/18

Digital Signal Octave Codes (0A)

Surface Integrals (6A)

CS-E3210 Machine Learning: Basic Principles

Propositional Logic Arguments (5A) Young W. Lim 11/29/16

Background LTI Systems (4A) Young Won Lim 4/20/15

CLTI System Response (4A) Young Won Lim 4/11/15

CT Correlation (2A) Young Won Lim 9/9/14

Bandpass Sampling (2B) Young Won Lim 3/27/12

Second Order ODE's (2A) Young Won Lim 5/5/15

Propositional Logic Arguments (5A) Young W. Lim 2/23/17

Capacitor in an AC circuit

Capacitor in an AC circuit

Transcription:

Bayes Theorem (4A)

Copyright (c) 2017-2018 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". Please send corrections (or suggestions) to youngwlim@hotmail.com. This document was produced by using LibreOffice and Octave.

Intersection Probability https://en.wikipedia.org/wiki/conditional_probability Bayes Theorem (4A) 3

Bayes' Rule (1) P(F E) = P(E F) P( E) P(E F) = P(E F) P(F) P(F E) P(E) = P(E F) P( E F) P(F) = P(E F) P(E F) = P(F E) P(E) = P(E F) P(F) P(F E) = P(E F) P(F) P( E) P( E F) = P(F E) P(E) P(F) Bayes Theorem (4A) 4

Bayes' Rule (2) E = ( E F) (E F) F E F E E F F F E F E S = E F F F S + E F F F S P( E) = P(E F) P(F) + P(E F) P(F) Bayes Theorem (4A) 5

Bayes' Rule (3) P(F E) = P(E F) P(F) P( E) P( E) = P(E F) P(F) + P(E F) P(F) P(F E) = P(E F) P(F) P(E F) P(F) + P(E F) P(F) Bayes Theorem (4A) 6

A Priori and a Posteriori Two types of knowledge, justification, or arguments A Priori - from the earlier independent of experience All bachelors are unmarried A Posteriori - from the later Dependent on experience or empirical evidence Some bachelors are happy Bayes Theorem (4A) 7

Bayes' Rule (1) means given H : Hypothesis E : Evidence The prior probability the probability of H before E is observed. The likelihood of observing E given H P(H E) = P(E H ) P(H ) P(E) The posterior probability the probability of H given E, i.e., after E is observed. the marginal likelihood or "model evidence" the same for all possible hypotheses Bayes Theorem (4A) 8

Bayes' Rule (2) P( H E) = P( E H ) P(H) P(E) P(H), the prior probability the probability of H before E is observed. This indicates one's preconceived beliefs about how likely different hypotheses are, absent evidence regarding the instance under study. P(H E), the posterior probability the probability of H given E, i.e., after E is observed. the probability of a hypothesis given the observed evidence P(E H), the probability of observing E given H, is also known as the likelihood. It indicates the compatibility of the evidence with the given hypothesis. P(E), the marginal likelihood or "model evidence". This factor is the same for all possible hypotheses being considered. This means that this factor does not enter into determining the relative probabilities of different hypotheses. Bayes Theorem (4A) 9

Bayes' Rule (3) means given H : Hypothesis E : Evidence P(H E) = P(E H ) P(H ) P(E) P(E H ) P( H E) Update P(H) The posterior probability the probability of H given E, i.e., after E is observed. The likelihood of observing E given H The prior probability the probability of H before E is observed. Bayes Theorem (4A) 10

Example If the Evidence doesn't match up with a Hypothesis, one should reject the Hypothesis. But if a Hypothesis is extremely unlikely a priori, one should also reject it, even if the Evidence does appear to match up. P(E H ) P(H ) Three Hypotheses about the nature of a newborn baby of a friend, including: H1: the baby is a brown-haired boy H2: the baby is a blond-haired girl. H3: the baby is a dog. Consider two scenarios: I'm presented with Evidence in the form of a picture of a blond-haired baby girl. I find this Evidence supports H2 and opposes H1 and H3. I'm presented with Evidence in the form of a picture of a baby dog. I don't find this Evidence supports H3, since my prior belief in this Hypothesis (that a human can give birth to a dog) is extremely small. Bayes' rule a principled way of combining new Evidence with prior beliefs, through the application of Bayes' rule. can be applied iteratively: after observing some Evidence, the resulting posterior probability can then be treated as a prior probability, and a new posterior probability computed from new Evidence. Bayesian updating. Bayes Theorem (4A) 11

Posterior Probability Example (1) Suppose there are two full bowls of cookies. #1 has 10 chocolate chip and 30 plain cookies, while bowl #2 has 20 of each. When picking a bowl at random, and then picking a cookie at random. No reason to treat one bowl differently from another, likewise for the cookies. The drawn cookie turns out to be a plain one. How probable is it from bowl #1? more than a half, since there are more plain cookies in bowl #1. The precise answer Let H1 correspond to bowl #1, and H2 to bowl #2. P(H1)=P(H2)=0.5. The event E is the observation of a plain cookie. From the contents of the bowls, P(E H1) = 30/40 = 0.75 and P(E H2) = 20/40 = 0.5. Bayes' formula then yields P(H1 E) = P( E H1) P( H1) P(E H1)P(H1) + P(E H2)P(H2) = 0.75 0.5 0.75 0.5 + 0.5 0.5 = 0.6 Bayes Theorem (4A) 12

Posterior Probability Example (2) #1 #2 P(H1 E) = P(E H1) P(H1) P(E H1) P(H1) + P(E H2)P(H2) P(H1)=0.5 P(H2)=0.5 = 0.75 0.5 0.75 0.5 + 0.5 0.5 = 0.6 P(E H1) = 30/40 = 0.75 P(E H2) = 20/40 = 0.5 P(E) = P(E H1) P(H1) + P(E H2)P(H2) P(H1 E) = P(E H1) P(H1) P(E) Bayes Theorem (4A) 13

Posterior Probability Example (3) #1 #2 #1 #2 P(H1)=0.5 P(H2)=0.5 P(E H1) = 30/40 = 0.75 P(E H1)P(H1) = 0.75 0.5 = 0.375 P(E H2)P(H2) = 0.5 0.5 = 0.25 P(E H2) = 20/40 = 0.5 P(H1 E) = P(E H1) P(H1) P(E H1)P(H1) + P(E H2)P(H2) = 0.75 0.5 0.75 0.5 + 0.5 0.5 = 0.6 Bayes Theorem (4A) 14

Posterior Probability Example (4) #1 #2 #1 #2 P(H1)=0.5 P(H2)=0.5 P(E C H1) = 10/40 = 0.25 P(E C H1)P(H1) = 0.25 0.5 = 0.125 P(E C H2)P(H2) = 0.5 0.5 = 0.25 P(E C H2) = 20/40 = 0.5 P(E H1)P(H1) P(E H2)P(H2) = 0.75 0.5 = 0.375 = 0.5 0.5 = 0.25 P(H1)=0.5 P(H2)=0.5 Bayes Theorem (4A) 15

Bayes Theorem (4A) 16

References [1] http://en.wikipedia.org/ [2] ttps://en.wikiversity.org/wiki/discrete_mathematics_in_plain_view [3] https://en.wikiversity.org/wiki/understanding_information_theory