This...
model2 =
EstimatedProcess[data2[[All, 2]], ARProcess[{a1, a2, a3, a4}, v]]
resids1 =
Rest[data2[[All, 2]] - KalmanFilter[model2, data2[[All, 2]]]]
...works fine when the process is linear. But not so when we have a Fractional Brownian Motion Process. Does anyone know of a package that does that in Mathematica?