2016년 1월 19일 화요일

가설 검정을 위한 scipy 라이브러리 모음

통계적 추론의 가설 검정을 위해 사용한 scipy 라이브러리를 정리한다.

scipy는 과학 기술 컴퓨팅을 다루는 과학자, 분석가, 엔지니어링이 사용하는 오픈소스 파이썬 라이브러리 이다. matplotlib, SymPy, Pandas와 같이 NumPy를 기반으로 사용된다.

T 검정

scipy.stats.ttest_1samp 
Calculates the T-test for the mean of ONE group of scores.

scipy.stats.ttest_ind
Calculates the T-test for the means of TWO INDEPENDENT samples of scores.
This is a two-sided test for the null hypothesis that 2 independent samples have identical average (expected) values. This test assumes that the populations have identical variances by default.

scipy.stats.ttest_rel
Calculates the T-test on TWO RELATED samples of scores, a and b.
This is a two-sided test for the null hypothesis that 2 related or repeated samples have identical average (expected) values.


정규성 검정

scipy.stats.kstest
Perform the Kolmogorov-Smirnov test for goodness of fit.
D(max distance)

scipy.stats.shapiro
Perform the Shapiro-Wilk test for normality.
The Shapiro-Wilk test tests the null hypothesis that the data was drawn from a normal distribution.


등분산 검정 (equal variances)

scipy.stats.levene
Perform Levene test for equal variances.
The Levene test tests the null hypothesis that all input samples are from populations with equal variances. Levene’s test is an alternative to Bartlett’s test bartlett in the case where there are significant deviations from normality.

scipy.stats.bartlett
Perform Bartlett’s test for equal variances
Bartlett’s test tests the null hypothesis that all input samples are from populations with equal variances. For samples from significantly non-normal populations, Levene’s test levene is more robust.


신뢰 구간 (confidence interval)

scipy.stats.bayes_mvs(<데이터>, alpha=<신뢰도>)

0 개의 댓글:

댓글 쓰기