function rho_1 = rho1(x)
% function rho_1 = rho1(x)
% calculates the rho_1 index defined by yamashita for
% stiction detection.

% count the 'IS' and 'DS' periods found
n = 0;   % counter
for i = 1:length(x)
    if (x{i}(1) == 'I')&(x{i}(2) == 'S')
        n = n + 1;
    end
    if (x{i}(1) == 'D')&(x{i}(2) == 'S')
        n = n + 1;
    end
end
rho_1 = n/length(x);

return
