기본 콘텐츠로 건너뛰기

라벨이 Kolmogorov-Smirnov인 게시물 표시

[matplotlib]quiver()함수

[data analysis]Kolmogorov-Smirnov Test

Kolmogorov-Smirnov Test 관련된 내용 Q-Q plot shapiro-Wilk test Kolmogorov-Smirnov Test Anderson-Darling 검정 Jarque-Bera test Kolmogorov-Smirnov 검정 (K-S test)은 표본이 특정 분포를 가진 모집단에서 추출되었는지 결정하는 데 사용됩니다. 즉, 자료의 분포가 특정한 분포와의 일치정도를 정량화하여 검정하는 방법입니다. 분석대상 자료의 분포를 알 수 없으므로 식 1에 의해 생성된 경험적 분포 함수 (Emperical distribution fucntion, ECDF) 와 특정분포를 비교합니다. $$ECDF =\frac{n(i)}{N}$$ (식 1) 식 1의 n(i)는 데이터를 오름차순으로 정렬한 경우의 각 요소의 위치이며 분모인 N은 전체 자료수입니다. 자료가 오름차순으로 정렬되면 각 값까지의 누적확률은 그것이 위치하는 순서에 의존됩니다. 예를 들어 총 20개의 데이터 중의 2번째의 값의 누적확률은 0.1(2/20)이 됩니다. 전체적으로 각 데이터마다 1/20씩 증가하는계단함수가 됩니다. 이것을 경험적 누적분포함수라고 하며 이 함수가 정규분포의 누적함수와의 일치 정도로 자료의 정규성을 검정합니다. 그림 1은 100개의 랜덤 샘플에 대한 경험적 누적분포함수와 정규누적분포함수를 작성한 것입니다. np.random.seed(3) N=100 da=np.sort(np.random.randn(N)) ecdf=[i/N for i in range(1, N+1)] nCdf=stats.norm.cdf(da) plt.figure(figsize=(4,2)) plt.plot(da, ecdf, color="blue", label="ECDF") plt.plot(da, nCdf, color="red", label="normCDF") plt.legend(loc=...

Normality Test

Contents Q-Q plot shapiro-Wilk test Kolmogorov-Smirnov Test Normality Test The central limit theorem approaches normal distribution as the number of samples in the data increases. In particular, the distribution of sample means corresponds to the normal distribution. However, for raw data other than the mean, it is sometimes important to match the normal distribution. For example, in regression, the difference between the observed values and the predicted values by the regression model is called residuals, and is performed on the assumption that the residuals conform to the normal distribution. Whether it fits the assumption or not is the basis for determining the fit of the established model. The normality test uses the following methods: Quantile-Quantile plot: Determination by visual analysis Shaprio-Wilks test: primarily used for number of samples (n < 2000) Kolmogoroves-Smrinov test: used when n>2000 Q-Q plot The Q-Q (Quadrant) plot i...