clear
clc
close all
addpath(fullfile(cd, '/ssm'))
m=xlsread('bls.xls','nsa','B3:EW126');
for j=1:152;
    airline     = ssm_airline;
    airline = estimate(m(:,j)',airline,0.1,[], 'fmin', 'simplex', 'disp', 'off', 'maxiter', 1000);
    theta1=airline.param(1); theta12=airline.param(2);
    if theta12<-0.75; s=15; end;
    if theta12>-0.75 & theta12<-0.65; s=9; end;
    if theta12>-0.65 & theta12<-0.55; s=5; end;
    if theta12>-0.55 & theta12<-0.45; 
        if theta1<-0.3 & theta1>-0.65; s=5; else; s=3; end;
    end;
    if theta12>-0.45; s=3; end;
    v(j)=s;
end;
disp([3 length(find(v==3))]);
disp([5 length(find(v==5))]);
disp([9 length(find(v==9))]);
disp([15 length(find(v==15))]);
