기본 콘텐츠로 건너뛰기

라벨이 uniform_distribution인 게시물 표시

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

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

균등분포(Uniform Distribution)

내용 균등분포 평균과 분산 균등분포(Uniform Distribution) 균등분포 확률 변수 X의 확률밀도 함수가 식 1과 같이 범위 [a, b]에서 일정한 경우 이 변수는 균등분포를 따른다고 합니다. $$\begin{equation}f(x)=\begin{cases}\frac{1}{b-a}& \quad a \lt x \lt b\\ 0&\quad \text{otherwise} \end{cases}\end{equation}$$ 균등 분포는 다음과 같이 나타냅니다. X ∼ Uniform(a, b) 예 1)   변수 X가 [0,10]의 범위에서 균등 분포를 이룬다면 다음 확률을 계산해 봅니다. $$\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 import matplotlib.pyplot as plt from scipy import stats from sympy import * a, b, x=symbols("a b x") f=Rational(1, 10) f $\quad \small \color{navy}{\frac{1}{10}}$ 1) 2 < X < 9 ? F1=f.integrate((x, 2, 9)) F1 $\quad \small \color{navy}{\frac{7}{10}}$ 2) 1 < x < 4 ? F1=f.integrate((x, 1, 4)) F1 $\quad \small \color{navy}{\frac{3}{10}}$ 3) x > 6 ? F1=f.integrate((x, 6, 10)) F1 $\quad \small \color{navy}{\frac{2}{5}}$ 예 2)   버스가 7시에 출발하여 특정 정

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