Processing math: 100%
본문 바로가기

교육/Bayesian Deep Learning

1-2) Elementary of mathmatics

출처: https://www.edwith.org/bayesiandeeplearning/lecture/24678?isDesc=false

Probability

학습 목표

Set이 정의되어 있어야 그 위에 Measure를 정의할 수 있고,
Measure가 있어야 Probability를 정의할 수 있습니다.
그래서 이전 학습을 통해 Set과 Measure에 대해서 공부해보았습니다.
이제부터는 베이지안 딥러닝을 공부하기에 앞서 꼭 필요한 개념인 Probability에 대해서 구체적으로 공부해보도록 합시다. 

Keywords

  • 확률(Probability)
  • 표본공간(Sample space)
  • 확률 시행(Random experiment)
  • 확률 질량 함수(Probability mass function)
  • 베이즈정리(Bayes' theorem)
  • 기댓값(Expectation)

Toss a fair dice and observe the outcomes. 모든 가능한 경우의 수를 고려야해하므로 σ-field를 power set이라고 정의하자. 여기서 Ω는 sample space이다.

여기서 각각의 눈이 나올 확률은 sample space에서 정의된 면적과 같다.

P({1})=P({2})=P({3})=P({4})=P({5})=P({6})=1/6
P(A)=P(2,4,6)=P({2})+P({4})+P({6})=1/2

 

  • The random experiment should be well defined.
  • The outcomes are all the possible results of the random experiment each of which canot be further divided. (outcome sample space)
  • The sample point w: a point representing an outcome.
  • The sample space Ω
    : the set of all the sample points.
  • Definition (probability)
    • P defined on a measurable space (Ω,A) is a set function 
      P : A[0,1] such that (probability axioms). (A는 σ-field 이며, 0에서 1사이로 measure되고)
      1. P()=0 (empty set은 0)
      2. P(A)0AΩ (항상 0이상이고)
      3. For disjoint sets Ai and AjP(ki=1Ai)=ki=1P(Ai) (countable additivity, disjoint set에 대해서 더하면 더해지는)
      4. P(Ω)=1 (normalize 되었기 때문에 set 전체가 들어가면 1)
  • probability allocation function
    • For discrete Ω: (probability mass function)
      p:Ω[0,1] such that wΩp(w)=1 and P(A)=wAp(w)
    • For continuous Ω: (probability distribution function)
      f:Ω[0,) such that wΩf(w)dw=1 and P(A)=wΩf(w)dw.
    • Recall that probability P is a set function P:A[0;1] where A is a σ-field.
      :결국 sample space에서 확률의 정의를 만족하는 함수들을 찾다보니 gaussian distribution 같은 분포가 나온 것

Examples of probability allocation function. Sample space (Ω).Boldline\sigma$-field 이며, 이를 통해 probability가 정의되는 것을 알 수 있다. 해당 값은 아직 measure된 것이 아니며 probability space 안에서만 정의된 값이다.

  • conditional probability of A given B:
    P(A|B)def=P(AB)P(B)
  • Again, recall that probability P is a set function, i.e., P:A[0;1].

Sample space(Ω) 안에 sigma-field 인 A 와 B의 교집합은 역시 sigma-field이고 따라서 확률을 면적을 통해 정의할 수 있다.

  • From the definition of conditional probability, we can derive:
  • chain rule:
    P(AB)=P(A|B)P(B)
    P(ABC)=P(A|BC)P(BC)=P(A|BC)P(B|C)P(C)
  • total probability law:
    P(A)=P(AB)+P(ABC)=P(A|B)P(B)+P(A|BC)P(BC)
  • Bayes' rule
    p(B|A)=P(BA)P(A)=P(AB)P(A)=P(A|B)P(B)P(A)
  • When B(로또를 맞을 확률) is the event that is considered and A(전날 밤에 꾼 꿈) is an observation,
    • P(B|A) is called posterior probability.
    • P(B) is called prior probability.
  • independent events A and B: P(AB)=P(A)P(B)

즉 정의에 따라 교집합이 없는게 independent가 아니다

  • independent disjoint, mutually exclusive

independent 한 예시

Random variable

학습 목표

이전 수업을 통해서 확률에 대해서 공부하면서, 확률 공간에 대해서 정의하였습니다.

확률 공간에서는 확률적인 과정에 따라 값이 결정되는 변수가 있는데

그 변수를 확률 변수(Random variable)이라고 부릅니다.

이번 시간에는 확률 변수에 대해서 공부해보도록 해요.

Keywords

  • 확률변수(Random variable)
  • 확률공간(Probability space)
  • 확률 밀도 함수(Probability density function)
  • 상관분석(Correlation analysis)

 

  • random variable:
    A random variable is a real-valued function defined on Ω that is measurable w.r.t. the probability space (Ω,A,P) and the Borel measurable space (R,B), i.e.,
    X:ΩR such that BB,X1(B)A.
    :sample space에서 하나의 원소가 특정 실수에 대응되는 함수, 확률은 sample space σ-field 에서 정의된 set function
    :여기서 inverse image(역함수)로 표시한 것은 주사위의 1과 2가 나올 확률을 구하기 위해 1과 2가 차지하는 면적을 구하기 위해 원래 sample space에서 만들어지는 σ-field 안에 들어가게하고 싶은 것
    *Borel set: 실수들의 집합(R)으로 만들어지는 σ-field 
    • What is random here?
      : sample space에서 하나를 뽑는 것, 함수이기 때문에 그에 해당하는 값이 튀어나옴
    • What is the result of carrying out the random experiment?
      : 결과는 관측치가 하나 나오는 것

  • Random variables are real numbers of our interest that are associated with the outcomes of a random experiment.
  • X(w) for a specific wΩ is called a realization. (즉, sampling이 realization)
  • The set of all realizations of X is called the alphabet of X. (주사위를 던질 때 alphabet은 1~6)
  • We are interested in P(XB) for BB:
    P(XB)def=P(X1(B))=P({w:X(w)B})
    :역함수가 차지하는 면적을 계산하는 것이 확률
  • discrete random variable: There is a discrete set
    {xi:i=1,2,...} such that P(X=xi)=1 (X라는 random variable이 x_i 값이 나올 면적의 크기)
  • probability mass function: pX(x)def=P(X=x) that satisfies
    1. 0pX(x)1
    2. $\sum_x p_X(x)=1
    3. P(XB)=xBpX(x)
  • example: three fair-coin tosses
    • X = number of heads
    • probability mass function (pmf)
      pX(x){1/8,x=03/8,x=13/8,x=21/8,x=30,else
    • P(X1)=38+38+18=78

probability mass function 예시, x가 distribution을 따를 때 k가 나올 확률

  • continuous random variable
    There is an integrable function fX(x) such that
    P(XB)=BfX(x)dx
  • probability density function
    fX(x)def=limΔx0P(x<Xx+Δx)Δx that satisfies
    :pmf와 다른점은 단일 값의 확률은 면적이 0이기 때문에 0이다
    1. fX(x)>1 is possible
    2. fX(x)dx=1
    3. P(XB)=xBfX(x)dx

probability density function 예시

EXdef={xxpX(x),discreteXxfX(x)dx,continuousX

  • Conditional expectation E(X|Y) (mean 0 gaussian의 expectation 은 0이다. 즉, random variable의 expectation은 radom variable이 아니라 그 평균이다. 그러나 다른 random variable (Y)에 contional하게 되면 그 expectation (E(X|Y))는 random variable이 된다.)
    • Expectation E(X) of random variable X is EX=xfX(x)dx and is a deterministic variable.
    • E(X|Y) is a function of Y and hence a random variable.
    • For each y, E(X|Y) is X average over the event where Y=y.

몸무게가 50, 60, 70, 80 kg인 사람들의 평균 키라고 생각하면 된다. 이 때 키는 연속적인 값을 가지지만 conditional expectation은 몸무게로 제한된 sample space에서 4개의 값만 가진다

  • Definition (conditional expectation)
    • Given a random variable Y with E|Y|< defined on a probability space (Ω,A,P) and some sub-σ-field GA we will define the conditional expectation as the almost surely unique random variable E(Y|G) which satisfies the following two conditions
      1. (Y|G) is G-measurable.
      2. E(YZ)=E(E(Y|GZ)) for all Z which are bounded and G-measurable.
    • Conditional expectation E(X|Y) with different σ-fields.

즉 condition Y를 더 자잘하게 나눌수 있다면 더 세밀하게 X의 기대값을 얻을 수 있고 이것이 resolution이 된다.

  • Moment

    평균은 분포를 고려하지 않기 때문에 다른 분포를 의미하는 다른 수치들과 함께 봐야한다.
  • Joint Moment

'교육 > Bayesian Deep Learning' 카테고리의 다른 글

1-1) Elementary of mathmatics  (0) 2022.11.22