기본 콘텐츠로 건너뛰기

라벨이 pdf인 게시물 표시

[matplotlib]quiver()함수

[data analysis]연속확률분포: 확률밀도 함수(pdf)

연속확률분포 내용 확률밀도함수(Probability Density Function, PDF) 일정구간 [a, b]에서 무작위로 하나의 수를 선택하는 확률이 동일하다면 그 수는 랜덤변수(random variable) 가 됩니다. 그 구간의 수들은 무한하므로 하나의 점을 특정할 수 없습니다. 즉, 연속변수에서 특정한 점에서의 확률은 정의할 수 없습니다. 대신에 전체를 일정구간으로 소그룹화하면 하나의 그룹을 선택할 확률은 전체 구간의 길이에 대해 그 선택된 부분의 길이로 정의할 수 있습니다. 이 관계는 식 1과 같이 나타낼 수 있습니다. \begin{align}P(X ∈ [a, b])&=1\\P(\in [x_1,\,x_2])&=\frac{x_2-x_1}{b-a}\\a\le x_1&\le x_2 \le b \end{align} (식 1) 식 1을 기반으로 확률변수 X에 대한 누적분포함수(CDF)는 식 2와 같이 나타낼 수 있습니다. $$F(X)=\begin{cases}0&\text{for}\; x \le a\\\frac{x-a}{b-a}&\text{for}\; a \le x \le b\\1&\text{for}\; x \ge b \end{cases}$$ (식 2) 사실 연속변수의 경우 한 지점에서의 확률은 정의할 수 없으므로 기호 "≤" 와 "<"의 차이 역시 정의 할 수 없습니다. [연속확률함수의 조건] 식 3의 관계가 성립하기 위해서는 함수 f(x)가 모든 x에서 대응하는 값을 정의할 수 있는 연속함수(continuous function)이어야 합니다. F(x) = P(X ≤ x) (식 3) 다시말하면 누적분포함수인 F(x)는 모든 범위에서 미분가능한 함수이어야 합니다. 확률밀도함수(Probability Density Function, PDF) 이산확률함수에 각 경우의 확률은 확률질량함수(PMF)와 누적분포함수(CDF)...

Uniform and Normal distribution

Contents Uniform Distribution Mean and Variance Normal (Gaussian) Distribution Possibility Desnity Function(PDF) Cumulative Distribution Function(CDF) Uniform Distribution If the probability density function of a random variable X is constant over the range [a, b] as in Equation 1, then the variable is said to be uniformly distributed. $$\begin{align}\tag{1}f(x)=\begin{cases}\frac{1}{b-a}& \quad a \lt x \lt b\\ 0&\quad \text{otherwise} \end{cases}\end{align}$$ A uniform distribution is expressed as $$X \sim \text{Uniform(a, b)}$$ Example 1)   If the variable X is uniformly distributed in the range [0,10], try calculating the following probabilities: $$\begin{align}&f(x)=\frac{1}{10-0}\\&F(x)=\int^b_a \frac{1}{10-0} \, dx \quad 0 \le a \lt b \le 10 \end{align}$$ import numpy as np import pandas as pd from sympy import * import matplotlib.pyplot as plt from scipy import stats a, b, x=symbols("a b x") f=Rational(1, 10) f $\quad \colo...

Continuous Possibility Distribution:PDF

Contents Probability Density Function(PDF) Continuous Possibility Distribution If the probability of randomly selecting a number in a certain interval [a, b] is the same, the number becomes a random variable, and since the number of the interval is infinite, a single point cannot be specified. In other words, the probability at a particular point in a continuous variable cannot be defined. Instead, if intervals with equal probabilities are grouped, the probability of selecting a group can be defined as the length of that selected portion over the length of the entire interval. This relationship can be expressed as Equation 1. $$\begin{align}\tag{1} P(X \in [a, b])&=1\\ P(X \in [x_1, x_2])& \varpropto (x_2-x_1)\\&= \frac{x_2-x_1}{b-a}\\ a\le x_1 \le x_2\le b \end{align}$$ Based on the above expression, the cumulative distribution function (CDF) for the random variable X is written as Equation 2. $$\begin{align}\tag{2} F(X)=\begin{cases} 0 & \quad \text{fo...