residual, detrending, differencingを実装