기본 콘텐츠로 건너뛰기

라벨이 comparison인 게시물 표시

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

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

두 독립집단의 비교

내용 두 표본의 비교 소규모 표본에서 등분산 소규모표본에서 이분산 대규모 표본 두 독립집단의 비교 두 표본의 비교 다음과 같이 각각 정규분포를 따르는 두 개의 독립 확률변수 X, Y의 평균을 비교하기 하기 위해 가설검정을 적용합니다. $$\begin{align}\bar{X}&=\frac{\sum^n_{i=1} X_i}{n_X} \sim N\left(\mu_X, \frac{\text{s}_X}{n_X}\right)\\ \bar{Y}&=\frac{\sum^n_{i=1} Y_i}{n_Y} \sim N\left(\mu_Y, \frac{\text{s}_Y}{n_Y}\right)\end{align}$$ 각 표본집단이 정규분포를 가정하지 않더라도 중심극한정리에 따라 근사적으로 정규분포를 만족하게 됩니다. 두 집단을 비교하기 위해 각 평균의 차이에 대한 다음의 귀무가설을 설정합니다. H0 : μ X - μ Y = 0 귀무가설의 검정통계량은 두 집단이 결합한 분포로부터 계산됩니다. 즉, X, Y의 결합확률분포의 평균과 표준편차는 식 1과 같이 계산됩니다. $$\begin{align}\tag{1} &\begin{aligned} E(X-Y)&=E(X)-E(Y)\\ &=\mu_X -\mu_Y\end{aligned}\\ &\begin{aligned}\text{Var}(X-Y) &=\text{Var}(X)+\text{Var}(Y)-\text{Cov}(X,Y)\\ &=\frac{\sigma^2_X}{n_X}+\frac{\sigma^2_Y}{n_Y}\end{aligned}\\ &\text{Cov}(X,Y)=0\quad \because \; X, Y: \text{독립}\\\end{align}$$ 식 1에서 Cov는 공분산 을 의미합니다. 즉, X, Y 두 집단 사이에 교호작용의 효과를 고려하는 것으로 두 집단이 독립이라는 가정에 의해 0이 됩니다

Comparison of two independent groups

Contents Equal Variances in Small Sampless> Different Variances in Small Samples Large sample Comparison of two independent groups The means of two independent probability variables, X and Y, each of which follows a normal distribution, can be compared by applying a hypothesis test: $$\begin{align}\bar{X}&=\frac{\sum^n_{i=1} X_i}{n_X} \sim N\left(\mu_X, \frac{\text{s}_X}{n_X}\right)\\ \bar{Y}&=\frac{\sum^n_{i=1} Y_i}{n_Y} \sim N\left(\mu_Y, \frac{\text{s}_Y}{n_Y}\right)\end{align}$$ Even if each sample group does not assume a normal distribution, approximately normal distribution is satisfied according to the central limit theorem . To compare the two groups, set the following null hypothesis for the difference between each mean: $$\text{H0} : \mu_X -\mu_Y =0$$ The hypothetical test statistics are calculated from a combined distribution of two groups. That is, the mean and standard deviation of the combined probability distributions of X and Y are calculated as

코틀린 연산자 (2)

비트 연산자 연산자 의미 and, .and(bits)       and, 모두 true일경우만 true or, .or(bits)        or, 모두 false일경우만 false xor, .xor(bits)         배타적 OR, 두 값이 다르면 true .inv(bits)          not,  보수 연산으로 반전 .shr(bits)          not,  지정한 비트수 만큼 오른쪽으로 이동 .shl(bits)          not,  지정한 비트수 만큼 왼쪽으로 이동 .ushr(bits)          not,  부호 고려하지 않고 지정한 비트수 만큼 오른쪽으로 이동 fun main() {     val a = 1     val b = 0     println("and: ${a and b},  or: ${a or b}, xor: ${a.xor(b)}, inv: ${a.inv()}") }       and: 0,  or: 1, xor: 1, inv: -2 1 shl 2  //1을 왼쪽으로 2 비트 이동  res1: kotlin.Int = 4 4 shr 2 //4를 오른쪽으로 2비트 이동 res2: kotlin.Int = 1 10진수를 2진수로 변환하기 위해 다음 메소드를 적용합니다. 객체.toString(2) : 10 진수인 객체를 2진수로 변환 다음과 같이 1과 4를 이진수로 변환하면 다음과 같습니다. 1.toString(2) res3: kotlin.String = 1 // ....001 4.toString(2) res4: kotlin.String = 100 // ....100 위에서 하나의 수는 1비트를 나타내며 1을 왼쪽으로 2비트 이동시키면 4가 됩니다. 이와같이 비트를 이동시키기 위해 shr(shift right) 또는 shl(shift left) 연산자를 적용합니다. or, and 연산