AB 테스팅 (온라인 실험)

[책 A/B 테스트] (Ch03) "실험 중 통계적 오류" Trustworthy Online Controlled Experiments

W[더블유] 2022. 5. 23. 10:40

Ch03 Twyman’s Law and Experimentation Trustworthiness

요약

지나치게 좋은 통계적 결과는 오류에 기반할 가능성이 큽니다. 우선, 통계치를 잘못 해석할 위험이 있습니다. 예를 들어, p-value 를 부정확하게 해석하거나 통계적으로 유의한 결과만 선택하거나, 많은 테스트를 통해서 확률적으로 유의한 결과를 찾는 경우입니다. SUTVA가 성립하는가, Treatment 그룹에서 유저를 어디로 redirect 하는가, 실험과 관련된 백엔드의 성능이 변하는가에 따라서 internal validity 에 문제가 발생할 수 있습니다.  실험 과정에서 특정 그룹이 과다 샘플링 된다면, 분석을 일반화하기 어려운 external validity 문제가 발생할 수 있습니다. Treatment effect 의 집단 별 이질성을 고려할 필요가 있습니다.

 

의문점

Sample Ratio Mismatch (SRM)?

 

실무

Heterogenous treatment effect 관련해서 아마존과 우버에서는 causal forest 관심이 있다고 하는데, 구체적인 적용 사례가 궁금합니다.

 

Reference

(Microsoft Blog) Diagnosing Sample Ratio Mismatch in A/B Testing

Link: https://www.microsoft.com/en-us/research/group/experimentation-platform-exp/articles/diagnosing-sample-ratio-mismatch-in-a-b-testing/

The essential guide to Sample Ratio Mismatch for your A/B tests

Link: https://towardsdatascience.com/the-essential-guide-to-sample-ratio-mismatch-for-your-a-b-tests-96a4db81d7a4

(영상) Peeking AB Tests

Sequential AB 테스팅과 관련해서 스터디 중에 해결이 되지 않아서 이후에 더 찾아보았습니다. 

 

유튜브 영상 Link: https://www.youtube.com/watch?v=AJX4W3MwKzU&t=2607s

원 논문 링크: http://library.usc.edu.ph/ACM/KKD 2017/pdfs/p1517.pdf

{16분 36초} Figure 2. 를 replicate 하는 방법에 대해 더 자세히 설명되어 있다.

100명이 AA test 를 하고, 최대 방문자수가 n 명 이라 할 때, 몇 명이 significant 한 결과를 얻고 일찍 실험을 종료하는가?

[정원혁: 영상에서 이해한 바에 따르면, 전체 100명 중에 일찍 종료한 숫자가 x 명이라면 x/100 을 false positive probability 로 정의하는 것 같다. Simulation 을 직접 해보면 좋을 것 같다.]

{34분 00초} 칠판으로 가서 설명을 시작한다.

CLT 에서는 standard error 가 $\frac{1}{\sqrt{n}}$ 이라서 교수님이 {37분 05초} 부터 그리는 그림처럼 swing 이 boundary 를 hit 할 가능성이 커진다.

[정원혁: 일종의 고등학교 때 배운 표본평균의 분포 CLT 를 생각해보면, $\frac{\sigma}{\sqrt{n}}$ (LaTeX 의 엄밀한 표현을 빌리면 $\frac{\sigma}{\sqrt{n}}$) 가 표본평균의 표준편차인데 이러한 느낌으로 CLT standard error 를 말한 것이 아닌가 추측. $\sigma = 1$ 로 분포를 정의해서 $\frac{1}{\sqrt{n}} 이라 하지 않았을까 싶음.].

{39:51} $\frac{1}{\sqrt{n}}$ 이 boundary 일 때 앞서 제기한 문제를 해결하기 위해서, $constant \times \frac{\sqrt{log(n)}}{n}$ 을 등장시킴. 칠판에 그리는 그림에 따르면, 앞의 $\frac{1}{\sqrt{n}}$보다 bound 범위가 넓음. 그래서 잘못 hitting 하는 경우가 줄어듬.

[정원혁: 근데, 논문에서는 $constant \times \frac{\sqrt{log(n)}}{n}$ 을 직접적으로 못봤는데, 관련 수식이 어디에 있을까...]

 

영상 중 두 개의 서로 다른 confidence interval 을 비교한 그래프.

 

{45:10} So the rule we give:

That the p-value at any given n is the lowest $\alpha$ s.t. $T_\alpha$ was before $n$.

[정원혁: $T_\alpha$ 는 stopping 할 때 observation 의 개수를 말하고, $n$ 은 실험해서의 최대 observation 값을 의미하지 않는가 추측]

What is the smallest $\alpha$ that I would have stopped by now. And that is the p-value that we display.

[정원혁: 계속 observation 이 하나씩 들어오는 상황에서 현재까지 있었던 모든 p-value 중에 가장 작은 값을 의미하는듯하다. 이 값이 $\alpha$ 보다 작으면 실험을 멈추는 것으로 추측]

{46:14} Likelihood Ratio Statistics

We compute version of likelihood ratio test of alternative & null. How large is the LRT relate to $\frac{1}{\alpha}$.

[정원혁: 교수님께서 이전에 설명한 개념들을 실행하는 테크니컬한 디테일이라고 말씀하심. 논문에서도 LRT 와 $\frac{1}{\alpha}$ 를 비교하는데, sequential testing 에서 LRT 개념이 생소해서 공부하는데 시간이 걸릴듯…]

{46:48}

$T_\alpha$ 와 관련된 내용인듯?

p-value at time n: smallest $\alpha$ s.t. T$_\alpha < n$

Two nice properties:

(1) Imagine now is the first time p-value falls below alpha. What is that amount to?

Stopping the first time p-value falls below alpha is stopping at $T_\alpha$ by definition. Why is it nice? It is because $T_\alpha$ is chosen so that it guarantees chosen false positive $\alpha$.

(2) (Additionally) No matter when the user choose to stop, the false positive would be bounded by \alpha.

(추가) 이 논문에 대한 테크니컬한 디테일은 다음 논문 (Johari et al., Always Valid Inference: Continuous Monitoring of A/B Tests) 과 설명하는 영상을 참조하면 좋을 것 같습니다.

논문 링크: https://arxiv.org/pdf/1512.04922.pdf

영상 링크: https://www.youtube.com/watch?v=BanBrr3Hzm8