ML

Causal Inference - causal mediation analysis vs DID vs SCM vs causal impact

sapziling 2022. 6. 10. 15:35

주로 궁금한 것은 마케팅 캠페인 집행후 얼마나 구매나 구독에 영향이  있었는가이다.

예를 들어 아래의 T의 Y에 대한 인과 효과를 알고 싶은 경우가 많다. 그래야 다음에 또 같은 마케팅을 할지 참고 할 수 있기 때문이다.

T: 마케팅

Y : 구매/이탈 등

본래는 하나의 유저에 대해 T의 Y에 대한 효과를 알고 싶을때이나, 현실적으로는 T=0/T=1 둘다 조치를 취할 수 없고 하나만 있음.

 

- 방법론

causal mediation analysis vs. did vs. scm vs. causal impact 

 

- causal mediation analysis (observational data)

: cofounder 등을 고려한 causal graph(DAG)를 사용하여, cofounder 통제하여 LM등으로 계수 파악.

   - ipw : collider 의 영향 안 받는 pesudo graph 알고 T->Y 영향을 알고 싶어서.. peusdo population을 통해 treatment effect 얻는다.

   - causal forest 

 

아래 세가지는 time series 특화.

- did (이중 차분법)

: 해당 마케팅이 없었던 시즌에서 Y=1, Y=0의 차이를 참고하여, 해당 마케팅이 있던 시즌에서 Y=1, Y=0의 차이를 비교한다.

참고 : https://danbi-ncsoft.github.io/study/2019/08/13/causality-part4-DID.html

- scm

: 데이터가 T=1만 있으면 T=0일때 Y값은 T에 영향을 받지 않는 다른 변수들로 예측하여 구한다. 

 p(causal effect estimate | Y, X, T ) 의 분포를 베이지안 방법론으로 구한다.

- causal impact

: 데이터가 T=1만 있으면  T=0인 값은 time-series 모델로 예측하여 구한다.

google의 causal impact 패키지는 bayesian structured time series model 사용하였음, 하지만 다른 것으로 예측해도 됨. 시계열은.

- scm vs. causal impact

scm은 이벤트 이전 데이터만, causal impact는 이벤트 전후를  다 넣어 학습. (??)

 

next to do : https://towardsdatascience.com/beyond-a-b-testing-primer-on-causal-inference-d8e462d90a0b

 

reference:

https://medium.com/bondata/quasi-experiments-인과-관계-이벤트의-효과-를-측정하는-방법-da34ceefc34f

 

https://tv.naver.com/v/23650648

베이지안 시계열: https://2stndard.tistory.com/15