기본 콘텐츠로 건너뛰기

라벨이 kurtosis인 게시물 표시

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

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

R 기술통계

내용 기술통계(descriptive statistics) 그룹화에 의한 기술통계 패키지 함수 적용 기본통계 기술통계(descriptive statistics) mtcars vars<-c('mpg', 'hp', 'wt') mt1<-mtcars[vars] head(mt1) #1~6행을 반환 mpg hp wt Mazda RX4 21.0 110 2.620 Mazda RX4 Wag 21.0 110 2.875 Datsun 710 22.8 93 2.320 Hornet 4 Drive 21.4 110 3.215 Hornet Sportabout 18.7 175 3.440 Valiant 18.1 105 3.460 summary(mt1)#요약통계량을 반환 mpg hp wt Min. :10.40 Min. : 52.0 Min. :1.513 1st Qu.:15.43 1st Qu.: 96.5 1st Qu.:2.581 Median :19.20 Median :123.0 Median :3.325 Mean :20.09 Mean :146.7 Mean :3.217 3rd Qu.:22.80 3rd Qu.:180.0 3rd Qu.:3.610 Max. :33.90 Max. :335.0 Max. :5.424 apply(객체, 1 or 2, FUN)는 객체의 행 또는 열에 함수를 적용합니다. 1: row, 2:column sapply(객체, FUN)는 객체의 각 열에 함수를 적용합니다. 위 함수에서 객체의 결측치를 제외하기 위해 함수에 인자 na.omit=True를 첨가합니다. 위 함수들의 인수중 FUN에 사용되는 전형적인 함수들은 다음과 같

확률과 주요통계량: 왜도와 첨도

내용 왜도 첨도 확률과 주요통계량: 왜도와 첨도 확률분포의 특성을 나타내는 통계량으로 평균과 분산 외에 왜도(skewness) 와 첨도(kurtosis) 역시 빈번하게 사용합니다. 왜도는 분포의 중심 즉, 평균을 기준으로 좌우의 비대칭성의 정도를 나타내고 첨도는 분포의 peak 즉 봉우리의 뾰족한 정도를 표시하는 지표입니다. 왜도와 첨도는 각각 식 1과 식 2와 같이 정의됩니다. 이 통계량들은 확률변수와 평균의 차이에 대해 3제곱과 4 제곱을 적용한 새로운 확률변수에 대한 기대값입니다. 결과적으로 왜도와 첨도는 각각 3차와 4차 모멘트 를 사용하여 계산됩니다. 왜도 표준정규분포의 왜도 = 0 skewness > 0: 분포가 오른쪽으로 기울어진 형태(skewed to right) skewness < 0: 분포가 왼쪽으로 기울어진 형태(skew to left) $$\begin{align}\tag{1} \text{Skewness(왜도)}&=E\left(\frac{X-\mu}{\sigma} \right)^3\\&=\frac{E(X-\mu)^3}{\sigma^3 } \end{align}$$ 첨도 표준정규분포의 첨도는 0 kurtosis > 0: 표준정규분포 보다 더 뾰족합니다. kurtosis < 0: 표준정규분포 보다 덜 뾰족합니다. $$\begin{align}\tag{2} \text{Kurtosis(첨도)}&=E\left(\frac{X-\mu}{\sigma} \right)^4-3\\&=\frac{E(X-\mu)^4}{\sigma^4}-3 \end{align}$$ import numpy as np import pandas as pd from scipy import stats import matplotlib.pyplot as plt 예 1)  성공확률 p

Skewness and Kurtosis

Skewness and Kurtosis Skewness and kurtosis are also frequently used in addition to the mean and variance as a statistic that indicates the characteristics of the probability distribution. Skewness indicates the degree of asymmetry between the left and right with respect to the center of the distribution, that is, the mean, and kurtosis is an index indicating the sharpness of the peak of the distribution. Skewness and kurtosis can be calculated with Equations 1 and 2, respectively. As shown in these equations, these statistics are the expected values for a new random variable, applying the third and fourth powers to the difference between the random variable and the mean. As a result, skewness and kurtosis are calculated using third and fourth-order moments, respectively. Skewness The skewness of the standard normal distribution is 0 skewness <0: Distribution skewed to right skewness >0: Distribution skewed to left $$\begin{align