기본 콘텐츠로 건너뛰기

라벨이 binomial인 게시물 표시

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

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은 열단위 즉, 행 방향으

베르누이와 이항확률분포

내용 베르누이분포(Bernoulli distribution) 이항확률분포(Binomial distribution) 이항분포의 기대값과 분산 베르누이분포(Bernoulli distribution) 한번의 시행에서 성공 또는 실패(1또는 0)의 결과만을 보이는 확률분포를 베르누이분포 라고 합니다. 즉, 이 확률변수는 두개의 값만을 포함합니다. 이 분포의 확률질량함수는 식 1과 같이 나타낼 수 있습니다. $$\begin{equation}\tag{1} f(x)=P(X=x)=\begin{cases}p&\quad \text{for}\; x=1\\1-p&\quad \text{for}\; x=0\\ p&\quad \text{for}\; x=\text{otherwise} \end{cases} \end{equation}$$ 위 확률질량함수(PMF)는 하나의 매개변수(parameter) 즉, 확률 p에 의해 결정됩니다. 그러므로 이 분포는 다음과 같이 나타냅니다. X ∼ Bernoulli(p) import numpy as np import pandas as pd from scipy import stats from sympy import * import matplotlib.pyplot as plt 예 1)  1개의 주사위를 시행하는 경우 확률변수는 다음과 같습니다. $$\begin{align}&\text{눈의 수 1 or 3 : x=1}\\ &\text{Any other value: x=0}\end{align}$$ 이 분포의 확률질량함수(PMF)와 E(x) ? $$\begin{align} &f(x)=\left(\frac{1}{3}\right)^x\left(\frac{2}{3}\right)^{1-x}\\ &\begin{aligned}E(x)&=1 \cdot \frac{1}{3}+0 \cdot \frac{2}{3}\\&=\frac{1}{3}\end{aligne

Discrete probability distribution I : Bernoulli and Binomial

Contents probability mass function Cumulative Distribution Function(CDF) Bernoulli and the binomial probability distribution Discrete probability distribution The probability distribution is created based on the probability of each point or each interval in the sample space. Such a probability can be written as a function, and if the event (random variable) that is the object of the probability is a discrete variable, it is called probability mass function (PMF). Also, if it is a continuous variable, it is called probability density function (PDF). In both cases, the sum of each probability in a constant variable interval is called Cumulative Probability Distribution Function (CDF). The probability distribution can be expressed visually as a correspondence between the values ​​of each random variable and a function. The shape of these distributions tends to follow the distributions implemented by a particular function. Therefore, various statistical methods can be applied by a