This is an expected behavior in System Identification Toolbox 7.1(R2007b). The reason for this behavior is as follows:
m is a dynamic model with one state. So any simulation or prediction calculation requires prescription of initial conditions. When one uses FILTER directly, one is implicitly setting the initial conditions (x0) to zero. Hence with FILTER, the first "error" value is x(1)-x0 = x(1).
However, commands such as PE and RESID estimate initial conditions in such a way that the overall prediction errors are minimized. While RESID does not allow one to change the default handling of initial conditions, PE does. One can enforce zero initial conditions by using:
e2 = pe(m, x', 'init', 'z');
Then e2 would be same as e. However, if you type:
or,
[e3, x0] = pe(m, x', 'init', 'e');
one sees that e3 is same as output of RESID e1. Also, x0 is calculated to be equal to x(1), which leads to zero value for e3(1).
Best Answer