Probability and Statistics_Khan [Unit 9~10] Random Variable, Sampling Distribution

2024. 1. 22. 17:37·Mathematics and Statistics

UNIT 9 : Random variables

random process 의 결과를 숫자로 연결하는 것이다.

확률변수에서의 변수는 함수에서처럼 특정 값을 가지고 있지 않다.

'어떤 값을 갖는 확률 변수', '어떤 값보다 크거나 같은 확률', '어떤 속성을 갖는 확률'로 이해할 수 있다. 

Lesson 1 : Discrete random variables

Discrete and Continuous (이산확률변수 & 연속확률변수)

Discrete random variables can only take on a finite number of values. For example, the outcome of rolling a die is a discrete random variable, as it can only land on one of six possible numbers.

Continuous random variables, on the other hand, can take on any value in a given interval. For example, the mass of an animal would be a continuous random variable, as it could theoretically be any non-negative number.

Mean (expected value) of a discrete random variable

weighted average of all the outcomes of that random variable based on their probabilities.

Variance and standard deviation of a discrete random variable

central tendency of this distribution

Lesson 2 : Continuous random variables

Probability density functions

연속 확률 변수 내의 특정 확률을 계산하는 것은 쉽지 않다.

확률밀도함수를 이용해 특정 구간의 확률으로 나타낼 수 있다.

확률밀도함수 내의 모든 면적의 합은 '1'이다.

Lesson 3 : Transforming random variables

shifting 과 scaling 모두 평균과 표준편차에 영향을 미친다.

단, shifting의 경우 표준편차는 그대로이다.

Lesson 4 : Combining random variables

Mean of sum and difference of random variables

mean of a sum = sum of means

Variance of sum and difference of random variables

x와 y 가 독립적일 때(independent)만 더하거나 뺀 것의 분산을 구할 수 있다.

assuming X, Y is independent

x는 어제 잔 시간이고, y는 어제 깨어 있던 시간이기 때문에 둘을 합치면 24시간이 된다.

둘은 종속(dependent)적인 관계에 있음을 알 수 있다.

x+y는 언제나 24시간이기에 분산은 0이 된다.

그러니 종속적인  것들 사이의 분산의 합과 차는 이루어질 수 없음을 알 수 있다.

variance of the different of two indepdent random variables = sum of the variances of the two random variables

Lesson 5 : Binomial random variables

동전을 5번 던져서 나온 앞면의 수를 계산할 때

이 이항분포를 시각화할 수 있다.

무한히 반복하면 히스토그램은 종 모양과 비슷하게 된다.

bell curve is normal distribution

normal distribution(정규분포) is a probability density function (확률밀도함수) in a constinuous case.

 

binomial coefficient(이항계수)를 사용하여 구할 수 있다.

Combinations(조합)을 이용한다.

 

We can use the binomial distribution to find the probability of getting a certain number of successes, like successful basketball shots, out of a fixed number of trials. We use the binomial distribution to find discrete probabilities.

 

Generalizing 'k' scores in 'n' attempts

binomial probability distribution(이항확률분포) for a random variable(확률변수) that's defined by the number of scores in your n attempts

Lesson 6 : Binomial mean and standard deviation formulas

Bernoulli distribution (베르누이 분포)

성공할 확률 P 가 있을 때 실패할 확률은 1-P이다.

평균을 계산하려면 각각을 어떤 수로 곱해주어야 한다.

성공하는 것은 1, 실패하는 것은 0이라고 가정해준다면 평균을 계산할 수 있다.

평균 = P

분산 = P ( 1 - P )

이항분포는 이항변수의 분포이다.

이항변수 X에 대해서 n번의 시행에서 성공 확률은 P와 같고 각 시행은 독립이다.

E(X) = n P

Var(X) = n P (1-P)

Lesson 7 : Geometric random variables

Binomial Random Variable 과는 달리 fixed numbers(#) of trials 이 정해져 있지 않다.

성공할 때까지 얼마나 많은 시행이 필요한지 모른다.

Geometric 이라고 부르는 이유는 기하급수적 증가, 등비수열, 등비급수와 닮아 있기 때문이다.

독립 사건이 발생할 확률이 p라면, 기하확률변수의 기대값은 1/p 이다.

누적 기하학적 확률 (값보다 큼)

P (V>4)  = P (V not ≤ 4)  : 4보다 크다는 것은 4보다 같거나 작은 것의 반대인 확률과 같다.

작은 것이 조금 더 계산하기 쉽다.

4보다 같거나 작지 않다는 것은 P(V=5)부터이므로 첫번째부터 4번째까지는 반드시 실패한다는 것과 같다.

따라서 (실패할 확률) ^4 를 해주면 된다.

누적 기하학적 확률 (값보다 작음)

P (C < 5) = 1 - P(4번째까지 실패할 확률)

5번보다 작다는 것은 5번째부터의 확률을 전체 확률인 '1'에서 빼주면 된다.

5번째부터의 확률은 첫번째부터 4번째까지 모두 실패한다는 것이다. 

따라서 1 - (실패할 확률) ^4 이다. 

Lesson 9 : Poisson Distribution (푸아송 분포)

1시간이 60분이기에 1분당 차가 1대 지나가는 것을 성공이라고 하면 이항확률분포 공식을 세울 수 있다.

그런데, 1분에 2대 이상이 지나갈 수도 있기 때문에 이것을 60초로 쪼갤 수 있다.

사실, 1초에 2대도 지나갈 수 있기 때문에 이 구간의 숫자를 무한에 가깝게 할 필요가 있다.

이것이 푸아송 분포이다.

정리를 하면 이 극한은 e^a가 된다.

 


UNIT 10 : Sampling Distributions

Lesson 2 : Sampling distribution of a sample proportion (표본비율)

 

표본분포에서 얻어지는 표본비율의 평균값은 모비율의 평균값과 같아진다.

표본비율의 평균 : P

표본비율의 표준편차 : 루트 [ P(1-P) / n ]

표본크기가 커지면 표본분포에 대한 표준편차가 작아진다.

Normal Conditions for sampling distributions of sample proportions

When a population is normally distributed, the sampling distribution of 표본평균 will also be normal regardless of sample size.

When a population is not normally distributed, the sampling distribution of 표본평균 depends on the sample size.

 

표본의 크기가 30 이상이면 모집단의 모양과 상관없이 표본의 분포가 정규분포 모양이 될 것이라고 볼 수 있다. ( n  ≥ 30 )

표본의 크기가 30보다 작으면 모집단의 모양과 동일하게 간다고 보면 된다.

 

이렇게도 계산할 수 있다.

We can only assume a normal sampling distribution when we expect at least 10 successes and a10 failures per sample.

표본의 크기와 모비율의 곱 : np ≥ 10

표본의 크기를 1에서 모비율을 뺀 값과 곱 : n(1-p) ≥ 10

경험법칙을 따르면 표본분포는 대략 정규분포 형태를 보인다.

정규분포라면 표본의 평균값과 표준편차를 이용하여 해당 정규분포를 얻을 수 있다.

 

n=40, p=0.1 이라면 성공할 횟수는 4, 실패할 횟수는 36이므로 아래와 같은 그래프가 나온다.

 

Lesson 3 : Sampling Distribution of a sample mean (표본평균)

 표본평균이 있고 모평균이 있다.

Central Limit Theorem (중심극한정리)

As your sample size becomes larger, We would find a perfect normal distribution

이 말은 어떤 행동의 빈도를 수없이 많이 극한까지 분포를 확인하면 정규분포인 것을 확인할 수 있다는 것이다.

you're gong to have a frequency plot that looks very close to a normal distribution

keep plotting the frequency distribution of my sample means

이것인 표본평균을 표분분포하는 것이다.

전체 분포가 어떻게 생겼든지 간에 거기서 특정 수의 표본을 끄집어 내서 그 평균의 분포를 만들어 보는 것이다.

그 분포가 정규분포가 된다.

표본의 크기를 늘리면, 평균은 똑같지만 더 정규분포가 된다.

standard deviation 이 작아진다.

skew 가 작아진다. 그리고 더 양수의 뾰족해진 kurtosis를 갖게 된다.

standard error of the mean (평균의 표준오차)

As you increase your sample size for every time you do the average, two things are happening.

1. You're becoming more normal, and standard deviation is getting smaller

 

모집단의 분산과 표본의 크기를 알고 표본의 표준편차를 알 수 있을까? 

표본의 분산 = 모집단의 분산 / 표본의 크기 (n)

표준편차를 구하는 것이 standard error of the mean 이다. 위의 식에 제곱근을 해준 값이다.

 

'Mathematics and Statistics' 카테고리의 다른 글

Reveiw>>Probability and Statistics_Khan  (1) 2024.01.25
Probability and Statistics_Khan [Unit 11~16] Statistics  (2) 2024.01.25
Probability and Statistics_Khan [Unit 1~8] Probability  (0) 2024.01.19
Review >> Essence of Linear Algebra_3Blue1Brown  (1) 2024.01.14
Essence of Linear Algebra_3Blue1Brown  (2) 2024.01.14
'Mathematics and Statistics' 카테고리의 다른 글
  • Reveiw>>Probability and Statistics_Khan
  • Probability and Statistics_Khan [Unit 11~16] Statistics
  • Probability and Statistics_Khan [Unit 1~8] Probability
  • Review >> Essence of Linear Algebra_3Blue1Brown
Ctrl_engineer
Ctrl_engineer
Ctrl 키는 혼자일 때보다 다른 키와 함께할 때 진짜 힘을 발휘합니다. 데이터도, 사람도 마찬가지입니다. 연결되고 흐를 때, 세상은 더 나은 방향으로 움직입니다. 저는 데이터의 흐름을 설계하고, 신뢰를 심는 엔지니어가 되고자 합니다. 이곳은, 그 여정의 작은 흔적들을 기록하는 공간입니다.
  • Ctrl_engineer
    Ctrl the flow
    Ctrl_engineer
  • 전체
    오늘
    어제
    • 분류 전체보기 (60)
      • Research (8)
        • Raspberry Pi (8)
      • Data Enginnering (24)
        • Cloud (3)
        • Elastic (6)
        • Database (9)
        • Pipeline (3)
      • CS STUDY (0)
        • Computer Science (0)
        • DataStructure & Algorithm (0)
      • Programming (13)
        • Python (13)
      • Mathematics and Statistics (10)
      • Data Science (3)
        • Data Insight (2)
        • Learning (0)
        • ML & DL (0)
      • DIARY (0)
      • TIL (Today I Learned) (2)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    라즈베리파이5
    오블완
    부스트코스
    heap size
    spark
    ssh 비밀번호 없이 접속
    Statistics and Probability
    climb-mates
    linear algebra
    py4e
    라즈베리파이 네트워크 설정
    elasticSearch
    proxyjump 설정
    점프투파이썬
    Khan
    티스토리챌린지
    3blue1brown
    Khan Academy
    indexing
    SQL
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.1
Ctrl_engineer
Probability and Statistics_Khan [Unit 9~10] Random Variable, Sampling Distribution
상단으로

티스토리툴바