<aside> 💡 Notion Tip: Here at Notion we use this template to help teams plan, design and develop products with the greatest chance for success. It helps teams think through their work more deeply, improves asynchronous communication with other teams, and creates space for collaboration.

</aside>

👀Residual(殘差)

觀察值$y_t$和預測值${\hat{y}}t$的差 ie $e{t}=y_t-{\hat{y}}_t$

outliers就是那些和殘差誤差很大的觀察值

若是殘差是stationary,則可用一個threshold $\delta$和以下基準:

$$ e_t=|y_y-{\hat{y}}_t|>\delta $$

來判斷觀察值是否為outlier

但是,如果不是stationary,則以上方法不是很有效

Threshold的選取

可以用IQR法則,步驟如下:

  1. 計算$\hat{y}_t$ (例如: rolling mean)
  2. 計算$e_t=y_y-\hat{y}_t$
  3. 計算殘差的$Q_1$、$Q_3$以及$IQR=Q_3-Q_1$
  4. 若是符合以下:

$$ e_t>\delta_{upper}=Q_3+\alpha \times IQR \\ e_t<\delta_{lower}=Q_1-\alpha \times IQR $$


則判定為outlier

$\alpha$值的選取可能是1.5(因為這符合在常態分佈下,3個標準差的距離),但也可能更大 eg: $\alpha=3$

優缺點