Academic
  • Introduction
  • Artificial Intelligence
    • Introduction
    • AI Concepts, Terminology, and Application Areas
    • AI: Issues, Concerns and Ethical Considerations
  • Biology
    • Scientific Method
    • Chemistry of Life
    • Water, Acids, Bases
    • Properties of carbon
    • Macromolecules
    • Energy and Enzymes
    • Structure of a cell
    • Membranes and transport
    • Cellular respiration
    • Cell Signaling
    • Cell Division
    • Classical and molecular genetics
    • DNA as the genetic material
    • Central dogma
    • Gene regulation
  • Bioinformatics
    • Bioinformatics Overview
  • Deep Learning
    • Neural Networks and Deep Learning
      • Introduction
      • Logistic Regression as a Neural Network
      • Python and Vectorization
      • Shallow Neural Network
      • Deep Neural Network
    • Improving Deep Neural Networks
      • Setting up your Machine Learning Application
      • Regularizing your Neural Network
      • Setting up your Optimization Problem
      • Optimization algorithms
      • Hyperparameter, Batch Normalization, Softmax
    • Structuring Machine Learning Projects
    • Convolutional Neural Networks
      • Introduction
    • Sequence Models
      • Recurrent Neural Networks
      • Natural Language Processing & Word Embeddings
      • Sequence models & Attention mechanism
  • Linear Algebra
    • Vectors and Spaces
      • Vectors
      • Linear combinations and spans
      • Linear dependence and independence
      • Subspaces and the basis for a subspace
      • Vector dot and cross products
      • Matrices for solving systems by elimination
      • Null space and column space
    • Matrix transformations
      • Functions and linear transformations
      • Linear transformation examples
      • Transformations and matrix multiplication
      • Inverse functions and transformations
      • Finding inverses and determinants
      • More Determinant Depth
  • Machine Learning
    • Introduction
    • Linear Regression
      • Model and Cost Function
      • Parameter Learning
      • Multivariate Linear Regression
      • Computing Parameters Analytically
      • Octave
    • Logistic Regression
      • Classification and Representation
      • Logistic Regression Model
    • Regularization
      • Solving the Problem of Overfitting
    • Neural Networks
      • Introduction of Neural Networks
      • Neural Networks - Learning
    • Improve Learning Algorithm
      • Advice for Applying Machine Learning
      • Machine Learning System Design
    • Support Vector Machine
      • Large Margin Classification
      • Kernels
      • SVM in Practice
  • NCKU - Artificial Intelligence
    • Introduction
    • Intelligent Agents
    • Solving Problems by Searching
    • Beyond Classical Search
    • Learning from Examples
  • NCKU - Computer Architecture
    • First Week
  • NCKU - Data Mining
    • Introduction
    • Association Analysis
    • FP-growth
    • Other Association Rules
    • Sequence Pattern
    • Classification
    • Evaluation
    • Clustering
    • Link Analysis
  • NCKU - Machine Learning
    • Probability
    • Inference
    • Bayesian Inference
    • Introduction
  • NCKU - Robotic Navigation and Exploration
    • Kinetic Model & Vehicle Control
    • Motion Planning
    • SLAM Back-end (I)
    • SLAM Back-end (II)
    • Computer Vision / Multi-view Geometry
    • Lie group & Lie algebra
    • SLAM Front-end
  • Python
    • Numpy
    • Pandas
    • Scikit-learn
      • Introduction
      • Statistic Learning
  • Statstics
    • Quantitative Data
    • Modeling Data Distribution
    • Bivariate Numerical Data
    • Probability
    • Random Variables
    • Sampling Distribution
    • Confidence Intervals
    • Significance tests
Powered by GitBook
On this page
  • Introduction
  • Quantifying plausibility
  • Example

Was this helpful?

  1. NCKU - Machine Learning

Bayesian Inference

Introduction

  • Probability theory

    • The probability of an event is the limit of its relative frequency in a large number of trials.

  • Baye's theory

    • Probability is a measure of the degree of belief about an event.

  • 概率論主要應用在能重複觀察的實驗來定義出概率

    • 用多次投擲硬幣來預測出 probability

  • 貝葉斯概率則是用類似常識、自己的信仰來定義概率

    • 珠寶店遭小偷,剛好有一個人破窗而出,他是小偷的機率 ?

  • Baye's theory 認為所有的機率都是條件機率 (conditional probability)

    • 根據已知的信息得出

    • 大家都接受的某種假設所得出

Quantifying plausibility

  • Bayesian probability 需要符合以下條件

    • Plausibility(A)∈R with boundary\text{Plausibility(A)} \in \mathbb{R} \text{ with boundary}Plausibility(A)∈R with boundary

    • Transitivity

      • plaus(A)→plaus(B) and\text{plaus(A)} \rightarrow \text{plaus(B)} \text{ and}plaus(A)→plaus(B) and

      • plaus(B)→plaus(C) then\text{plaus(B)} \rightarrow \text{plaus(C)} \text{ then}plaus(B)→plaus(C) then

      • plaus(A)→plaus(C)\text{plaus(A)} \rightarrow \text{plaus(C)}plaus(A)→plaus(C)

    • Consistency

      • Event A 發生只跟所有與 A 直接相關資訊有關,不包括其他推理到 A 之前的資訊

  • 根據條件,可以計算以下的條件機率

    Pr(A∣B)=Pr(B∣A)Pr(A)Pr(B)∝Pr(B∣A)Pr(A)\begin{aligned} Pr(A\mid B) &= \frac{Pr(B\mid A)Pr(A)}{Pr(B)} \\ &\propto Pr(B\mid A)Pr(A) \end{aligned}Pr(A∣B)​=Pr(B)Pr(B∣A)Pr(A)​∝Pr(B∣A)Pr(A)​
    • 寫成文字 : posterior odds ∝ likelihood × prior odds

      • posterior probability : B 發生情況下 A 發生機率

      • likelihood : A 發生情況下 B 發生機率

      • prior probability : A 發生機率

    • 以珠寶店為例

      • AAA : 珠寶店被偷

      • BBB : 有一個人破窗而出

      • Pr(A)Pr(A)Pr(A) = 珠寶店被偷機率 (prior)

      • Pr(B∣A)Pr(B\mid A)Pr(B∣A) = 珠寶店被偷的同時,剛好有一個人破窗而出的機率 (likelihood)

      • Pr(A∣B)Pr(A\mid B)Pr(A∣B) = 用有人破窗而出來推測珠寶店被偷的機率 (posterior)

  • Bayes 對整個世界的理解源於我們每個人自己認為的事件發生概率 (personalisitic probability),或者叫信念度 (degree of belief)

Example

  • Mr. Smith 有 2 個小孩,一個小孩是男生,另一個是女生的機率為何 ?

    • 男女比例為 50-50

  • 先看所有可能性

第一個小孩

第二個小孩

男

男

男

女

女

男

女

女

  • 因為第四個不可能,所以機率是 2/3

  • 現在用 Baye's theorem 來計算 Pr(1 girl∣no 2 girls)Pr(\text{1 girl}\mid \text{no 2 girls})Pr(1 girl∣no 2 girls)

=Pr(no 2 girls∣1 girl)×Pr(1 girl)∑j=02Pr(no 2 girls∣j girls)×Pr(j girls)=1×121×14+1×12+0×14=1234=23\begin{aligned} &= \frac{Pr(\text{no 2 girls}\mid \text{1 girl}) \times Pr(\text{1 girl})}{\sum_{j=0}^2Pr(\text{no 2 girls}\mid \text{j girls}) \times Pr(\text{j girls})}\\ &=\frac{1\times\frac{1}{2}}{1\times\frac{1}{4} + 1 \times \frac{1}{2} + 0\times \frac{1}{4}} \\ &= \frac{\frac{1}{2}}{\frac{3}{4}} = \frac{2}{3} \end{aligned}​=∑j=02​Pr(no 2 girls∣j girls)×Pr(j girls)Pr(no 2 girls∣1 girl)×Pr(1 girl)​=1×41​+1×21​+0×41​1×21​​=43​21​​=32​​
PreviousInferenceNextIntroduction

Last updated 5 years ago

Was this helpful?