MATLAB: Am I having a problem using PEM on a step response using the System Identification Toolbox 5.0.2 (R13)

idpemrankrepsonsestepsysSystem Identification Toolbox

I am running the following code:
y=[vec(1); vec];
u=[0; ones(size(vec))];
data=iddata(y,u,300);
ml=pem(data,2);
I get this warning:
Warning: Rank deficient, rank = 3 tol = 4.0772e-013.
> In D:\Applications\MATLAB6P5\toolbox\ident\ident\n4sid.m (estK) at line 627
In D:\Applications\MATLAB6P5\toolbox\ident\ident\n4sid.m at line 405
In D:\Applications\MATLAB6P5\toolbox\ident\ident\pem.m at line 113
In L:\972823\three\modelfit23.m at line 11
>>

Best Answer

There may be a variety of reasons for getting a rank deficiency warning. In general, this warning indicates that the data does not have enough information for estimation of parameters of the chosen (type and order) model.
In the case here, the input is 1 throughout, except the first value, which is zero. This type of input is not persistently exciting, which means that any models of order greater than 1 cannot be reliably estimated using this data. Here the input is intended to be a step input.
A way to prevent the warning is to append more zeros to both the input and output data, in the beginning as shown in the following code:
y = [zeros(10,1);vec];
u = [zeros(10,1);ones(size(vec))];
m1 = pem(data,2);
compare(data,m1)