기본 콘텐츠로 건너뛰기

라벨이 conditional_probability인 게시물 표시

통계관련 함수와 메서드 사전

A B C d E F G H I K L M N O P Q R S T U V W Z A statsmodels.ap.stats.anova_lm(x) statsmodels.formula.api.ols 에 의해 생성되는 모형 즉, 클래스 인스턴스(x)를 인수로 받아 anova를 실행합니다. np.argsort(x, axis=-1, kind=None) 객체 x를 정렬할 경우 각 값에 대응하는 인덱스를 반환합니다. Axis는 기준 축을 지정하기 위한 매개변수로서 정렬의 방향을 조정할 수 있음(-1은 기본값으로 마지막 축) pandas.Series.autocorr(lag=1) lag에 전달한 지연수에 따른 값들 사이의 자기상관을 계산 B scipy.stats.bernoulli(x, p) 베르누이분포에 관련된 통계량을 계산하기 위한 클래스를 생성합니다. x: 랜덤변수 p: 단일 시행에서의 확률 scipy.stats.binom(x, n, p) 이항분포에 관련된 통계량을 계산하기 위한 클래스를 생성합니다. x: 랜덤변수 n: 총 시행횟수 p: 단일 시행에서의 확률 C scipy.stats.chi2.pdf(x, df, loc=0, scale=1) 카이제곱분포의 확률밀도함수를 계산 $$f(x, k) =\frac{1}{2^{\frac{k}{2}−1}Γ(\frac{k}{2})}x^{k−1}\exp\left(−\frac{x^2}{2}\right)$$ x: 확률변수 df: 자유도 pd.concat(objs, axis=0, join=’outer’, …) 두 개이상의 객체를 결합한 새로운 객체를 반환. objs: Series, DataFrame 객체. Axis=0은 행단위 즉, 열 방향으로 결합, Axis=1은 열단위 즉, 행 방향으

독립과 조건부 확률

내용 독립 합공식 조건부확률 베이즈정리 독립과 조건부확률 독립 함께 일어날 수 없는 상태 즉, 교집합이 공집합인 사건들은 독립사건 또는 상호 배타적 결과들(disjoint or mutually exclusive outcomes) 이 됩니다. 예를 들어 하나의 주사위를 시행하는 경우 1과 2가 함께 나오는 경우는 일어날 수 없으므로 독립 사건이 됩니다. 한편 1과 홀수가 나올 확률은 1이 이미 홀수이므로 동시에 발생할 수 있지요. 그러므로 이 사건은 상호 배타적 결과들이 아닙니다. 독립사건의 확률을 계산하는 것은 비교적 쉽습니다. 즉, 1개의 주사위 시행에서 1 또는 2가 나올 사건의 확률은 상호독립이므로 식 1과 같이 각 확률의 합이 됩니다. $$\begin{equation}\tag{1}P(1 \, \text{or} \, 2) =P(1)+P(2)= \frac{1}{6}+\frac{1}{6}=\frac{1}{3}\end{equation}$$ 위와 달리 어떤 사건이 동시에 일어날 수 있는 사건이 존재하는 경우 즉, 사건 A, B가 독립사건이 아닌 경우 위의 합은 식 2와 같이 수정됩니다. $$\begin{align}\tag{2}P(A\; \text{or} \;B) &= P(A)+ P(B) - P(A\; \text{and} \;B)\\ & \text{또는}\\ P(A \cup B) &= P(A)+P(B) - P(A \cap B) \end{align}$$ 합공식 두 독립사건 $E_1, E_2$이라면 이 둘이 발생할 확률은 단순히 두 확률의 합으로 계산됩니다. $$\begin{equation}P(E_1 \;\text{or} \; E_2) =P(E_1 \cup E_2)= P(E_1) + P(E_2)\end{equation}$$ 위 식의 확장으로 2개 이상의 독립사건들에 대한 모든 확률은 식 3과 같이 계산됩니다 $$\begin{align}\tag{3}&P(E_1 \;\tex

Independence and Conditional Probability

contents Independence and Conditional Probability Independence Conditional Probability Independence and Conditional Probability Independence Events whose intersection is the empty set are independent events or mutually exclusive outcomes. For example, if a single die is rolled, it is an independent event because it cannot happen that both 1 and 2 are rolled together. On the other hand, the probability of 1 and an odd number can occur at the same time because 1 is already odd. Therefore, these events are not mutually exclusive results. Calculating the probabilities of independent events is relatively easy. In other words, the probabilities of an event of 1 or 2 in a single die trial are mutually independent and therefore the sum of their probabilities. $$P(1 \, \text{or} \, 2) =P(1)+P(2)= \frac{1}{6}+\frac{1}{6}=\frac{1}{3}$$ Contrary to the above, if events A and B are not independent events, the above sum is modified as