▐    概念一：干预效果 Treatment Effect

▐    概念二：ATT Average Treatment Effect on the Treated

▐    计算ATT所需满足的假设

▐    估算ATT

PSM实现

▐    倾向得分预测

▐    匹配算法

### Caliper and Radius Matching 有边界限制的半径匹配

Caliper Matching：匹配时引入倾向分差值的忍受度，高于忍受度的样本丢弃。理论上通过避免低质量匹配降低了bias，但在样本数量较少时也可能因为匹配过少而升高了variance；

### Stratification and Interval Matching 分层区间匹配

▐    匹配示例SQL

````with matching_detail as (`
`    select t1.user_id as treatment_userid,`
`      t1.score as treatment_pscore,`
`      t2.user_id as control_userid,`
`      t2.score as control_pscore,`
`      row_number() over (partition by t1.user_id order by abs(t1.score-t2.score) asc) as rn`
`    from propensity_score_treatment t1`
`    left join propensity_score_control t2`
`      -- 分层匹配`
`        on t1.gender = t2.gender and round(t1.score, 1)*10 =  round(t2.score, 1)*10`
`    where abs(t1.score-t2.score) <= 0.05 -- caliper matching`
`)`
`select * from matching_detail where rn = 1  # rn大于1时为多邻居/radius匹配````

▐    匹配质量检验

▐    匹配结果示例

▐    增量计算

▐    其他情况

▐    ATT与ATE的区别

ATE：average treatment effect

ATT：average treatment effect on the treated

▐    Bias与Variance

Bias 偏差：期望预测与真实结果之间的偏离程度，刻画算法本身的拟合能力

Variance 方差：同样大小训练集的变动所导致的学习性能变化，刻画数据扰动所造成的影响

 算法 Bias Variance NN+多邻居 + – NN+最近邻 – + +边界值 – + 无边界值 + – 有放回 – + 无放回 + –

▐    敏感性测试 Sensitivity Analysis

▐    完整流程

▐   PSM的优缺点

PSM最主要的一个缺点是——使用者永远无法保证所有的混淆变量都被包含在建模用的特征当中；

Evaluating the performance of propensity score matching methods

Some Practical Guidance for the Implementation of Propensity Score Matching

✿    拓展阅读